File tree 3 files changed +36
-3
lines changed
compiler/rustc_trait_selection/src/traits 3 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -172,9 +172,7 @@ fn do_normalize_predicates<'tcx>(
172
172
// the normalized predicates.
173
173
let errors = infcx. resolve_regions ( & outlives_env) ;
174
174
if !errors. is_empty ( ) {
175
- // @lcnr: Let's still ICE here for now. I want a test case
176
- // for that.
177
- tcx. dcx ( ) . span_bug (
175
+ tcx. dcx ( ) . span_delayed_bug (
178
176
span,
179
177
format ! ( "failed region resolution while normalizing {elaborated_env:?}: {errors:?}" ) ,
180
178
) ;
Original file line number Diff line number Diff line change
1
+ trait Bar {
2
+ type Type ;
3
+ }
4
+ struct Foo < ' a > ( & ' a ( ) ) ;
5
+ impl < ' a > Bar for Foo < ' f > { //~ ERROR undeclared lifetime
6
+ type Type = u32 ;
7
+ }
8
+
9
+ fn test ( ) //~ ERROR implementation of `Bar` is not general enough
10
+ where
11
+ for < ' a > <Foo < ' a > as Bar >:: Type : Sized ,
12
+ {
13
+ }
14
+
15
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0261]: use of undeclared lifetime name `'f`
2
+ --> $DIR/issue-121414.rs:5:22
3
+ |
4
+ LL | impl<'a> Bar for Foo<'f> {
5
+ | - ^^ undeclared lifetime
6
+ | |
7
+ | help: consider introducing lifetime `'f` here: `'f,`
8
+
9
+ error: implementation of `Bar` is not general enough
10
+ --> $DIR/issue-121414.rs:9:4
11
+ |
12
+ LL | fn test()
13
+ | ^^^^ implementation of `Bar` is not general enough
14
+ |
15
+ = note: `Bar` would have to be implemented for the type `Foo<'0>`, for any lifetime `'0`...
16
+ = note: ...but `Bar` is actually implemented for the type `Foo<'1>`, for some specific lifetime `'1`
17
+
18
+ error: aborting due to 2 previous errors
19
+
20
+ For more information about this error, try `rustc --explain E0261`.
You can’t perform that action at this time.
0 commit comments