diff options
| author | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-05-21 15:14:11 -0400 |
|---|---|---|
| committer | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-05-22 15:21:27 -0400 |
| commit | 12a2d7967c48f418e99ed4ff8fa5e662e1f34ffb (patch) | |
| tree | 2925e43d05f17e8a4c825fc22260dc0b4a7dda35 /src/test/ui/error-codes | |
| parent | 99daba2a4a17c733f4edf781fde6fa8cb30975a0 (diff) | |
| download | rust-12a2d7967c48f418e99ed4ff8fa5e662e1f34ffb.tar.gz rust-12a2d7967c48f418e99ed4ff8fa5e662e1f34ffb.zip | |
Use revisions for NLL in various directories
Diffstat (limited to 'src/test/ui/error-codes')
| -rw-r--r-- | src/test/ui/error-codes/E0490.base.stderr (renamed from src/test/ui/error-codes/E0490.stderr) | 26 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0490.nll.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0490.rs | 12 |
3 files changed, 24 insertions, 18 deletions
diff --git a/src/test/ui/error-codes/E0490.stderr b/src/test/ui/error-codes/E0490.base.stderr index 96e99bd88a4..5cb62e19ccf 100644 --- a/src/test/ui/error-codes/E0490.stderr +++ b/src/test/ui/error-codes/E0490.base.stderr @@ -1,72 +1,72 @@ error[E0490]: a value of type `&'b ()` is borrowed for too long - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ | note: the type is valid for the lifetime `'a` as defined here - --> $DIR/E0490.rs:1:6 + --> $DIR/E0490.rs:5:6 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: but the borrow lasts for the lifetime `'b` as defined here - --> $DIR/E0490.rs:1:10 + --> $DIR/E0490.rs:5:10 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ | note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/E0490.rs:1:10 + --> $DIR/E0490.rs:5:10 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that the type `&'b ()` is not borrowed for too long - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/E0490.rs:1:6 + --> $DIR/E0490.rs:5:6 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that reference does not outlive borrowed content - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ | note: first, the lifetime cannot outlive the lifetime `'b` as defined here... - --> $DIR/E0490.rs:1:10 + --> $DIR/E0490.rs:5:10 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that the expression is assignable - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | let x: &'a _ = &y; | ^^ = note: expected `&'a &()` found `&'a &'b ()` note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/E0490.rs:1:6 + --> $DIR/E0490.rs:5:6 | LL | fn f<'a, 'b>(y: &'b ()) { | ^^ note: ...so that the reference type `&'a &()` does not outlive the data it points at - --> $DIR/E0490.rs:2:12 + --> $DIR/E0490.rs:6:12 | LL | let x: &'a _ = &y; | ^^^^^ diff --git a/src/test/ui/error-codes/E0490.nll.stderr b/src/test/ui/error-codes/E0490.nll.stderr index a1c33bbcd5f..80bf076e2bd 100644 --- a/src/test/ui/error-codes/E0490.nll.stderr +++ b/src/test/ui/error-codes/E0490.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/E0490.rs:2:12 + --> $DIR/E0490.rs:6:12 | LL | fn f<'a, 'b>(y: &'b ()) { | -- -- lifetime `'b` defined here @@ -11,7 +11,7 @@ LL | let x: &'a _ = &y; = help: consider adding the following bound: `'b: 'a` error[E0597]: `y` does not live long enough - --> $DIR/E0490.rs:2:20 + --> $DIR/E0490.rs:6:20 | LL | fn f<'a, 'b>(y: &'b ()) { | -- lifetime `'a` defined here diff --git a/src/test/ui/error-codes/E0490.rs b/src/test/ui/error-codes/E0490.rs index 36bafa2bd86..304548215dc 100644 --- a/src/test/ui/error-codes/E0490.rs +++ b/src/test/ui/error-codes/E0490.rs @@ -1,8 +1,14 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn f<'a, 'b>(y: &'b ()) { let x: &'a _ = &y; - //~^ E0490 - //~| E0495 - //~| E0495 + //[base]~^ E0490 + //[base]~| E0495 + //[base]~| E0495 + //[nll]~^^^^ lifetime may not live long enough + //[nll]~| E0597 } fn main() {} |
