Skip to content

Commit

Permalink
beta fallout.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Jun 24, 2022
1 parent b1d53a4 commit a081507
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
13 changes: 7 additions & 6 deletions compiler/rustc_resolve/src/late/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2360,12 +2360,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
Scope::Binder {
where_bound_origin: Some(hir::PredicateOrigin::ImplTrait), ..
} => {
let mut err = self.tcx.sess.struct_span_err(
lifetime_ref.span,
"`impl Trait` can only mention lifetimes bound at the fn or impl level",
);
err.span_note(self.tcx.def_span(region_def_id), "lifetime declared here");
err.emit();
self.tcx
.sess
.struct_span_err(
lifetime_ref.span,
"`impl Trait` can only mention lifetimes bound at the fn or impl level",
)
.emit();
return;
}
Scope::Root => break,
Expand Down
6 changes: 0 additions & 6 deletions src/test/ui/impl-trait/universal_wrong_hrtb.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ error: `impl Trait` can only mention lifetimes bound at the fn or impl level
|
LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
| ^^
|
note: lifetime declared here
--> $DIR/universal_wrong_hrtb.rs:5:39
|
LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
| ^^

error: aborting due to previous error

0 comments on commit a081507

Please sign in to comment.