fix method substs

This commit is contained in:
Ali MJ Al-Nasrawy 2022-10-29 20:13:40 +03:00
parent be5a45d392
commit 37b40e471a
4 changed files with 53 additions and 46 deletions

View file

@ -68,8 +68,8 @@ fn test_variants<'a, 'b, 'c>() {
}
fn test_method_call<'a>(x: MyTy<()>) {
// FIXME This should fail.
x.method2::<Ty<'a>>();
//~^ ERROR lifetime may not live long enough
}
fn test_struct_path<'a, 'b, 'c, 'd>() {

View file

@ -114,6 +114,14 @@ help: the following changes may resolve your lifetime errors
= help: replace `'b` with `'static`
= help: replace `'c` with `'static`
error: lifetime may not live long enough
--> $DIR/normalization-2.rs:71:7
|
LL | fn test_method_call<'a>(x: MyTy<()>) {
| -- lifetime `'a` defined here
LL | x.method2::<Ty<'a>>();
| ^^^^^^^ requires that `'a` must outlive `'static`
error: lifetime may not live long enough
--> $DIR/normalization-2.rs:88:5
|
@ -190,5 +198,5 @@ help: the following changes may resolve your lifetime errors
= help: replace `'b` with `'static`
= help: replace `'c` with `'static`
error: aborting due to 18 previous errors
error: aborting due to 19 previous errors