Skip to content

Commit a081507

Browse files
committed
beta fallout.
1 parent b1d53a4 commit a081507

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

compiler/rustc_resolve/src/late/lifetimes.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -2360,12 +2360,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
23602360
Scope::Binder {
23612361
where_bound_origin: Some(hir::PredicateOrigin::ImplTrait), ..
23622362
} => {
2363-
let mut err = self.tcx.sess.struct_span_err(
2364-
lifetime_ref.span,
2365-
"`impl Trait` can only mention lifetimes bound at the fn or impl level",
2366-
);
2367-
err.span_note(self.tcx.def_span(region_def_id), "lifetime declared here");
2368-
err.emit();
2363+
self.tcx
2364+
.sess
2365+
.struct_span_err(
2366+
lifetime_ref.span,
2367+
"`impl Trait` can only mention lifetimes bound at the fn or impl level",
2368+
)
2369+
.emit();
23692370
return;
23702371
}
23712372
Scope::Root => break,

src/test/ui/impl-trait/universal_wrong_hrtb.stderr

-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ error: `impl Trait` can only mention lifetimes bound at the fn or impl level
33
|
44
LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
55
| ^^
6-
|
7-
note: lifetime declared here
8-
--> $DIR/universal_wrong_hrtb.rs:5:39
9-
|
10-
LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {}
11-
| ^^
126

137
error: aborting due to previous error
148

0 commit comments

Comments
 (0)