Skip to content

Commit

Permalink
Make "no def-id for fresh lifetime" a span_delayed_bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Feb 22, 2024
1 parent 96f609a commit 3fe0325
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
if let Some(old_def_id) = self.orig_opt_local_def_id(param) {
old_def_id
} else {
self.dcx().span_bug(lifetime.ident.span, "no def-id for fresh lifetime");
self.dcx()
.span_delayed_bug(lifetime.ident.span, "no def-id for fresh lifetime");
continue;
}
}

Expand Down
4 changes: 4 additions & 0 deletions tests/ui/lowering/issue-121431.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn bug<T>() -> impl CallbackMarker< Item = [(); { |_: &mut ()| 3; 4 }] > {}
//~^ ERROR cannot find trait `CallbackMarker` in this scope

fn main() {}
9 changes: 9 additions & 0 deletions tests/ui/lowering/issue-121431.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0405]: cannot find trait `CallbackMarker` in this scope
--> $DIR/issue-121431.rs:1:21
|
LL | fn bug<T>() -> impl CallbackMarker< Item = [(); { |_: &mut ()| 3; 4 }] > {}
| ^^^^^^^^^^^^^^ not found in this scope

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0405`.

0 comments on commit 3fe0325

Please sign in to comment.