diff options
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() {} |
