diff options
| author | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2022-10-29 20:13:40 +0300 |
|---|---|---|
| committer | Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com> | 2023-01-07 13:38:40 +0300 |
| commit | 37b40e471a62425cb34781bad763b5cb5047f13c (patch) | |
| tree | 182d6d2b07716ac713d1d5a67a727a6a9e3adc91 /src/test | |
| parent | be5a45d39240ab3f6410c4808b0840142c657228 (diff) | |
| download | rust-37b40e471a62425cb34781bad763b5cb5047f13c.tar.gz rust-37b40e471a62425cb34781bad763b5cb5047f13c.zip | |
fix method substs
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/nll/user-annotations/normalization-2.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/nll/user-annotations/normalization-2.stderr | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/test/ui/nll/user-annotations/normalization-2.rs b/src/test/ui/nll/user-annotations/normalization-2.rs index 92600155c7f..232b957d51f 100644 --- a/src/test/ui/nll/user-annotations/normalization-2.rs +++ b/src/test/ui/nll/user-annotations/normalization-2.rs @@ -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>() { diff --git a/src/test/ui/nll/user-annotations/normalization-2.stderr b/src/test/ui/nll/user-annotations/normalization-2.stderr index 5dbdb2ecea8..50382cfd953 100644 --- a/src/test/ui/nll/user-annotations/normalization-2.stderr +++ b/src/test/ui/nll/user-annotations/normalization-2.stderr @@ -115,6 +115,14 @@ help: the following changes may resolve your lifetime errors = 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 | LL | fn test_struct_path<'a, 'b, 'c, 'd>() { @@ -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 |
