diff --git a/src/test/ui/issues/issue-10291.stderr b/src/test/ui/issues/issue-10291.base.stderr similarity index 86% rename from src/test/ui/issues/issue-10291.stderr rename to src/test/ui/issues/issue-10291.base.stderr index a80b0ba5e91..cad22b2f3ea 100644 --- a/src/test/ui/issues/issue-10291.stderr +++ b/src/test/ui/issues/issue-10291.base.stderr @@ -1,19 +1,21 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-10291.rs:3:9 + --> $DIR/issue-10291.rs:7:9 | LL | x | ^ | note: ...the reference is valid for the anonymous lifetime #1 defined here... - --> $DIR/issue-10291.rs:2:69 + --> $DIR/issue-10291.rs:6:69 | LL | drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { | _____________________________________________________________________^ LL | | x +LL | | +LL | | LL | | })); | |_____^ note: ...but the borrowed content is only valid for the lifetime `'x` as defined here - --> $DIR/issue-10291.rs:1:9 + --> $DIR/issue-10291.rs:5:9 | LL | fn test<'x>(x: &'x isize) { | ^^ diff --git a/src/test/ui/issues/issue-10291.nll.stderr b/src/test/ui/issues/issue-10291.nll.stderr index a7b827d27a8..47c4d4945f3 100644 --- a/src/test/ui/issues/issue-10291.nll.stderr +++ b/src/test/ui/issues/issue-10291.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-10291.rs:3:9 + --> $DIR/issue-10291.rs:7:9 | LL | fn test<'x>(x: &'x isize) { | -- lifetime `'x` defined here diff --git a/src/test/ui/issues/issue-10291.rs b/src/test/ui/issues/issue-10291.rs index 559c5fcac95..8ee3ce44d3d 100644 --- a/src/test/ui/issues/issue-10291.rs +++ b/src/test/ui/issues/issue-10291.rs @@ -1,6 +1,12 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn test<'x>(x: &'x isize) { drop:: FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { - x //~ ERROR E0312 + x + //[base]~^ ERROR E0312 + //[nll]~^^ ERROR lifetime may not live long enough })); } diff --git a/src/test/ui/issues/issue-13058.stderr b/src/test/ui/issues/issue-13058.base.stderr similarity index 94% rename from src/test/ui/issues/issue-13058.stderr rename to src/test/ui/issues/issue-13058.base.stderr index 53a2c987c52..2b9fff3f981 100644 --- a/src/test/ui/issues/issue-13058.stderr +++ b/src/test/ui/issues/issue-13058.base.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `cont` - --> $DIR/issue-13058.rs:14:26 + --> $DIR/issue-13058.rs:18:26 | LL | fn check<'r, I: Iterator, T: Itble<'r, usize, I>>(cont: &T) -> bool | -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T` diff --git a/src/test/ui/issues/issue-13058.nll.stderr b/src/test/ui/issues/issue-13058.nll.stderr index 8368978deab..ddefa8a62c9 100644 --- a/src/test/ui/issues/issue-13058.nll.stderr +++ b/src/test/ui/issues/issue-13058.nll.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `cont` - --> $DIR/issue-13058.rs:14:21 + --> $DIR/issue-13058.rs:18:21 | LL | fn check<'r, I: Iterator, T: Itble<'r, usize, I>>(cont: &T) -> bool | -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T` diff --git a/src/test/ui/issues/issue-13058.rs b/src/test/ui/issues/issue-13058.rs index a5806feb720..cbd52a802e8 100644 --- a/src/test/ui/issues/issue-13058.rs +++ b/src/test/ui/issues/issue-13058.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + use std::ops::Range; trait Itble<'r, T, I: Iterator> { fn iter(&'r self) -> I; } diff --git a/src/test/ui/issues/issue-15034.stderr b/src/test/ui/issues/issue-15034.base.stderr similarity index 93% rename from src/test/ui/issues/issue-15034.stderr rename to src/test/ui/issues/issue-15034.base.stderr index 3ede5ba4fa3..293692c1ddc 100644 --- a/src/test/ui/issues/issue-15034.stderr +++ b/src/test/ui/issues/issue-15034.base.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `lexer` - --> $DIR/issue-15034.rs:17:25 + --> $DIR/issue-15034.rs:21:25 | LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { | ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>` diff --git a/src/test/ui/issues/issue-15034.nll.stderr b/src/test/ui/issues/issue-15034.nll.stderr index f142e260a23..54af22fb726 100644 --- a/src/test/ui/issues/issue-15034.nll.stderr +++ b/src/test/ui/issues/issue-15034.nll.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `lexer` - --> $DIR/issue-15034.rs:17:9 + --> $DIR/issue-15034.rs:21:9 | LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { | ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>` diff --git a/src/test/ui/issues/issue-15034.rs b/src/test/ui/issues/issue-15034.rs index 9ea6ed89ca2..f95275e3a7b 100644 --- a/src/test/ui/issues/issue-15034.rs +++ b/src/test/ui/issues/issue-15034.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + pub struct Lexer<'a> { input: &'a str, } diff --git a/src/test/ui/issues/issue-16683.stderr b/src/test/ui/issues/issue-16683.base.stderr similarity index 83% rename from src/test/ui/issues/issue-16683.stderr rename to src/test/ui/issues/issue-16683.base.stderr index d4e18df8de3..f684dd04a36 100644 --- a/src/test/ui/issues/issue-16683.stderr +++ b/src/test/ui/issues/issue-16683.base.stderr @@ -1,26 +1,26 @@ error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements - --> $DIR/issue-16683.rs:4:14 + --> $DIR/issue-16683.rs:8:14 | LL | self.a(); | ^ | note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/issue-16683.rs:3:10 + --> $DIR/issue-16683.rs:7:10 | LL | fn b(&self) { | ^^^^^ note: ...so that reference does not outlive borrowed content - --> $DIR/issue-16683.rs:4:9 + --> $DIR/issue-16683.rs:8:9 | LL | self.a(); | ^^^^ note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/issue-16683.rs:1:9 + --> $DIR/issue-16683.rs:5:9 | LL | trait T<'a> { | ^^ note: ...so that the types are compatible - --> $DIR/issue-16683.rs:4:14 + --> $DIR/issue-16683.rs:8:14 | LL | self.a(); | ^ diff --git a/src/test/ui/issues/issue-16683.nll.stderr b/src/test/ui/issues/issue-16683.nll.stderr index fff681b2e0b..308d6352602 100644 --- a/src/test/ui/issues/issue-16683.nll.stderr +++ b/src/test/ui/issues/issue-16683.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-16683.rs:4:9 + --> $DIR/issue-16683.rs:8:9 | LL | trait T<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-16683.rs b/src/test/ui/issues/issue-16683.rs index bbbd4daa4c5..05969bc7b9f 100644 --- a/src/test/ui/issues/issue-16683.rs +++ b/src/test/ui/issues/issue-16683.rs @@ -1,7 +1,13 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait T<'a> { fn a(&'a self) -> &'a bool; fn b(&self) { - self.a(); //~ ERROR cannot infer + self.a(); + //[base]~^ ERROR cannot infer + //[nll]~^^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/issues/issue-16922.stderr b/src/test/ui/issues/issue-16922.base.stderr similarity index 95% rename from src/test/ui/issues/issue-16922.stderr rename to src/test/ui/issues/issue-16922.base.stderr index 53405a660f8..e139de2019d 100644 --- a/src/test/ui/issues/issue-16922.stderr +++ b/src/test/ui/issues/issue-16922.base.stderr @@ -1,5 +1,5 @@ error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/issue-16922.rs:4:14 + --> $DIR/issue-16922.rs:8:14 | LL | fn foo(value: &T) -> Box { | -- this data with an anonymous lifetime `'_`... diff --git a/src/test/ui/issues/issue-16922.nll.stderr b/src/test/ui/issues/issue-16922.nll.stderr index 9d9f32a97c0..00a42e67242 100644 --- a/src/test/ui/issues/issue-16922.nll.stderr +++ b/src/test/ui/issues/issue-16922.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-16922.rs:4:5 + --> $DIR/issue-16922.rs:8:5 | LL | fn foo(value: &T) -> Box { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/issues/issue-16922.rs b/src/test/ui/issues/issue-16922.rs index f048ccd2427..1767017eb3d 100644 --- a/src/test/ui/issues/issue-16922.rs +++ b/src/test/ui/issues/issue-16922.rs @@ -1,7 +1,13 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + use std::any::Any; fn foo(value: &T) -> Box { - Box::new(value) as Box //~ ERROR E0759 + Box::new(value) as Box + //[base]~^ ERROR E0759 + //[nll]~^^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/issues/issue-17728.stderr b/src/test/ui/issues/issue-17728.base.stderr similarity index 96% rename from src/test/ui/issues/issue-17728.stderr rename to src/test/ui/issues/issue-17728.base.stderr index 943c63667e0..b52dc444593 100644 --- a/src/test/ui/issues/issue-17728.stderr +++ b/src/test/ui/issues/issue-17728.base.stderr @@ -1,5 +1,5 @@ error[E0623]: lifetime mismatch - --> $DIR/issue-17728.rs:15:28 + --> $DIR/issue-17728.rs:19:28 | LL | fn attemptTraverse(&self, room: &Room, directionStr: &str) -> Result<&Room, &str> { | ----- ------------------- @@ -16,7 +16,7 @@ LL | fn attemptTraverse<'a>(&'a self, room: &'a Room, directionStr: &str) -> | ++++ ++ ++ error[E0308]: `match` arms have incompatible types - --> $DIR/issue-17728.rs:109:14 + --> $DIR/issue-17728.rs:113:14 | LL | / match to_parse { LL | | "w" | "west" => RoomDirection::West, diff --git a/src/test/ui/issues/issue-17728.nll.stderr b/src/test/ui/issues/issue-17728.nll.stderr index a13d2dfa1fb..ddfb890eac3 100644 --- a/src/test/ui/issues/issue-17728.nll.stderr +++ b/src/test/ui/issues/issue-17728.nll.stderr @@ -1,5 +1,5 @@ error[E0308]: `match` arms have incompatible types - --> $DIR/issue-17728.rs:109:14 + --> $DIR/issue-17728.rs:113:14 | LL | / match to_parse { LL | | "w" | "west" => RoomDirection::West, diff --git a/src/test/ui/issues/issue-17728.rs b/src/test/ui/issues/issue-17728.rs index bec52d87d29..91b71ad6d0b 100644 --- a/src/test/ui/issues/issue-17728.rs +++ b/src/test/ui/issues/issue-17728.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + use std::fmt::{Debug, Formatter, Error}; use std::collections::HashMap; @@ -13,7 +17,7 @@ trait TraversesWorld { let maybe_room = room.direction_to_room.get(&direction); match maybe_room { Some(entry) => Ok(entry), - //~^ ERROR lifetime mismatch [E0623] + //[base]~^ ERROR lifetime mismatch [E0623] _ => Err("Direction does not exist in room.") } } diff --git a/src/test/ui/issues/issue-17758.stderr b/src/test/ui/issues/issue-17758.base.stderr similarity index 83% rename from src/test/ui/issues/issue-17758.stderr rename to src/test/ui/issues/issue-17758.base.stderr index 711217033a1..202238a49cb 100644 --- a/src/test/ui/issues/issue-17758.stderr +++ b/src/test/ui/issues/issue-17758.base.stderr @@ -1,26 +1,26 @@ error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements - --> $DIR/issue-17758.rs:7:14 + --> $DIR/issue-17758.rs:11:14 | LL | self.foo(); | ^^^ | note: first, the lifetime cannot outlive the anonymous lifetime defined here... - --> $DIR/issue-17758.rs:6:12 + --> $DIR/issue-17758.rs:10:12 | LL | fn bar(&self) { | ^^^^^ note: ...so that reference does not outlive borrowed content - --> $DIR/issue-17758.rs:7:9 + --> $DIR/issue-17758.rs:11:9 | LL | self.foo(); | ^^^^ note: but, the lifetime must be valid for the lifetime `'a` as defined here... - --> $DIR/issue-17758.rs:4:11 + --> $DIR/issue-17758.rs:8:11 | LL | trait Foo<'a> { | ^^ note: ...so that the types are compatible - --> $DIR/issue-17758.rs:7:14 + --> $DIR/issue-17758.rs:11:14 | LL | self.foo(); | ^^^ diff --git a/src/test/ui/issues/issue-17758.nll.stderr b/src/test/ui/issues/issue-17758.nll.stderr index 613ef6b907c..32030540a84 100644 --- a/src/test/ui/issues/issue-17758.nll.stderr +++ b/src/test/ui/issues/issue-17758.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-17758.rs:7:9 + --> $DIR/issue-17758.rs:11:9 | LL | trait Foo<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-17758.rs b/src/test/ui/issues/issue-17758.rs index d0dbd3455df..8090022b6d0 100644 --- a/src/test/ui/issues/issue-17758.rs +++ b/src/test/ui/issues/issue-17758.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + // Test that regionck suggestions in a provided method of a trait // don't ICE @@ -5,7 +9,8 @@ trait Foo<'a> { fn foo(&'a self); fn bar(&self) { self.foo(); - //~^ ERROR cannot infer + //[base]~^ ERROR cannot infer + //[nll]~^^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/issues/issue-26217.stderr b/src/test/ui/issues/issue-26217.base.stderr similarity index 88% rename from src/test/ui/issues/issue-26217.stderr rename to src/test/ui/issues/issue-26217.base.stderr index f5c641be2d4..8b1ef806abb 100644 --- a/src/test/ui/issues/issue-26217.stderr +++ b/src/test/ui/issues/issue-26217.base.stderr @@ -1,5 +1,5 @@ error[E0477]: the type `&'a i32` does not fulfill the required lifetime - --> $DIR/issue-26217.rs:4:5 + --> $DIR/issue-26217.rs:8:5 | LL | foo::<&'a i32>(); | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-26217.nll.stderr b/src/test/ui/issues/issue-26217.nll.stderr index c7601caacdc..c8b7d620557 100644 --- a/src/test/ui/issues/issue-26217.nll.stderr +++ b/src/test/ui/issues/issue-26217.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-26217.rs:4:5 + --> $DIR/issue-26217.rs:8:5 | LL | fn bar<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-26217.rs b/src/test/ui/issues/issue-26217.rs index 05e04621909..6cc60b05dc6 100644 --- a/src/test/ui/issues/issue-26217.rs +++ b/src/test/ui/issues/issue-26217.rs @@ -1,8 +1,13 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn foo() where for<'a> T: 'a {} fn bar<'a>() { foo::<&'a i32>(); - //~^ ERROR the type `&'a i32` does not fulfill the required lifetime + //[base]~^ ERROR the type `&'a i32` does not fulfill the required lifetime + //[nll]~^^ ERROR lifetime may not live long enough } fn main() { diff --git a/src/test/ui/issues/issue-40000.stderr b/src/test/ui/issues/issue-40000.base.stderr similarity index 91% rename from src/test/ui/issues/issue-40000.stderr rename to src/test/ui/issues/issue-40000.base.stderr index 00543c5fff4..a8518dde22e 100644 --- a/src/test/ui/issues/issue-40000.stderr +++ b/src/test/ui/issues/issue-40000.base.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-40000.rs:6:9 + --> $DIR/issue-40000.rs:10:9 | LL | foo(bar); | ^^^ one type is more general than the other diff --git a/src/test/ui/issues/issue-40000.nll.stderr b/src/test/ui/issues/issue-40000.nll.stderr index e6f0b5fbfba..81df9969a4f 100644 --- a/src/test/ui/issues/issue-40000.nll.stderr +++ b/src/test/ui/issues/issue-40000.nll.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/issue-40000.rs:6:9 + --> $DIR/issue-40000.rs:10:9 | LL | foo(bar); | ^^^ one type is more general than the other @@ -8,7 +8,7 @@ LL | foo(bar); found trait object `dyn Fn(&i32)` error[E0308]: mismatched types - --> $DIR/issue-40000.rs:6:9 + --> $DIR/issue-40000.rs:10:9 | LL | foo(bar); | ^^^ one type is more general than the other diff --git a/src/test/ui/issues/issue-40000.rs b/src/test/ui/issues/issue-40000.rs index 9d5ef481afc..3639413bfaf 100644 --- a/src/test/ui/issues/issue-40000.rs +++ b/src/test/ui/issues/issue-40000.rs @@ -1,7 +1,13 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn main() { let bar: fn(&mut u32) = |_| {}; fn foo(x: Box) {} let bar = Box::new(|x: &i32| {}) as Box; - foo(bar); //~ ERROR E0308 + foo(bar); + //~^ ERROR E0308 + //[nll]~^^ ERROR mismatched types } diff --git a/src/test/ui/issues/issue-46983.stderr b/src/test/ui/issues/issue-46983.base.stderr similarity index 93% rename from src/test/ui/issues/issue-46983.stderr rename to src/test/ui/issues/issue-46983.base.stderr index ed9f1884c42..97ed4d65093 100644 --- a/src/test/ui/issues/issue-46983.stderr +++ b/src/test/ui/issues/issue-46983.base.stderr @@ -1,5 +1,5 @@ error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement - --> $DIR/issue-46983.rs:2:5 + --> $DIR/issue-46983.rs:6:5 | LL | fn foo(x: &u32) -> &'static u32 { | ---- this data with an anonymous lifetime `'_`... diff --git a/src/test/ui/issues/issue-46983.nll.stderr b/src/test/ui/issues/issue-46983.nll.stderr index 38a219bbd7b..1327ff80c80 100644 --- a/src/test/ui/issues/issue-46983.nll.stderr +++ b/src/test/ui/issues/issue-46983.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-46983.rs:2:5 + --> $DIR/issue-46983.rs:6:5 | LL | fn foo(x: &u32) -> &'static u32 { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/issues/issue-46983.rs b/src/test/ui/issues/issue-46983.rs index 87ed8928944..e3ecdc8deac 100644 --- a/src/test/ui/issues/issue-46983.rs +++ b/src/test/ui/issues/issue-46983.rs @@ -1,6 +1,11 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn foo(x: &u32) -> &'static u32 { &*x - //~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] + //[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759] + //[nll]~^^ ERROR lifetime may not live long enough } fn main() {} diff --git a/src/test/ui/issues/issue-52533.stderr b/src/test/ui/issues/issue-52533.base.stderr similarity index 84% rename from src/test/ui/issues/issue-52533.stderr rename to src/test/ui/issues/issue-52533.base.stderr index ccedbcfec7a..6556a52de14 100644 --- a/src/test/ui/issues/issue-52533.stderr +++ b/src/test/ui/issues/issue-52533.base.stderr @@ -1,16 +1,16 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... - --> $DIR/issue-52533.rs:5:16 + --> $DIR/issue-52533.rs:9:16 | LL | foo(|a, b| b) | ^ | note: ...the reference is valid for the anonymous lifetime #1 defined here... - --> $DIR/issue-52533.rs:5:9 + --> $DIR/issue-52533.rs:9:9 | LL | foo(|a, b| b) | ^^^^^^^^ note: ...but the borrowed content is only valid for the anonymous lifetime #2 defined here - --> $DIR/issue-52533.rs:5:9 + --> $DIR/issue-52533.rs:9:9 | LL | foo(|a, b| b) | ^^^^^^^^ diff --git a/src/test/ui/issues/issue-52533.nll.stderr b/src/test/ui/issues/issue-52533.nll.stderr index c764736d798..75fe5a5b862 100644 --- a/src/test/ui/issues/issue-52533.nll.stderr +++ b/src/test/ui/issues/issue-52533.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-52533.rs:5:16 + --> $DIR/issue-52533.rs:9:16 | LL | foo(|a, b| b) | - - ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` diff --git a/src/test/ui/issues/issue-52533.rs b/src/test/ui/issues/issue-52533.rs index a35f5a80a87..bc6264d0e2f 100644 --- a/src/test/ui/issues/issue-52533.rs +++ b/src/test/ui/issues/issue-52533.rs @@ -1,7 +1,12 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn foo(_: impl for<'a> FnOnce(&'a u32, &u32) -> &'a u32) { } fn main() { foo(|a, b| b) - //~^ ERROR lifetime of reference outlives lifetime of borrowed content... + //[base]~^ ERROR lifetime of reference outlives lifetime of borrowed content... + //[nll]~^^ ERROR lifetime may not live long enough } diff --git a/src/test/ui/issues/issue-54302-cases.stderr b/src/test/ui/issues/issue-54302-cases.base.stderr similarity index 91% rename from src/test/ui/issues/issue-54302-cases.stderr rename to src/test/ui/issues/issue-54302-cases.base.stderr index baa75f28d37..db91edf51e3 100644 --- a/src/test/ui/issues/issue-54302-cases.stderr +++ b/src/test/ui/issues/issue-54302-cases.base.stderr @@ -1,5 +1,5 @@ error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:63:5 + --> $DIR/issue-54302-cases.rs:67:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -8,7 +8,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:69:5 + --> $DIR/issue-54302-cases.rs:73:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -17,7 +17,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:75:5 + --> $DIR/issue-54302-cases.rs:79:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -26,7 +26,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:81:5 + --> $DIR/issue-54302-cases.rs:85:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/src/test/ui/issues/issue-54302-cases.nll.stderr b/src/test/ui/issues/issue-54302-cases.nll.stderr index 6e8b69c4bee..89725d3b03a 100644 --- a/src/test/ui/issues/issue-54302-cases.nll.stderr +++ b/src/test/ui/issues/issue-54302-cases.nll.stderr @@ -1,5 +1,5 @@ error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:63:5 + --> $DIR/issue-54302-cases.rs:67:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -8,7 +8,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:69:5 + --> $DIR/issue-54302-cases.rs:73:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -17,7 +17,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:75:5 + --> $DIR/issue-54302-cases.rs:79:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -26,7 +26,7 @@ LL | >::ref_foo(a) = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1` error: implementation of `Foo` is not general enough - --> $DIR/issue-54302-cases.rs:81:5 + --> $DIR/issue-54302-cases.rs:85:5 | LL | >::ref_foo(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/src/test/ui/issues/issue-54302-cases.rs b/src/test/ui/issues/issue-54302-cases.rs index faa116269ee..f712d9b7718 100644 --- a/src/test/ui/issues/issue-54302-cases.rs +++ b/src/test/ui/issues/issue-54302-cases.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + trait Mirror { type Image; fn coerce(self) -> Self::Image; diff --git a/src/test/ui/issues/issue-54943.stderr b/src/test/ui/issues/issue-54943.base.stderr similarity index 86% rename from src/test/ui/issues/issue-54943.stderr rename to src/test/ui/issues/issue-54943.base.stderr index e917958c05e..ebd679996d0 100644 --- a/src/test/ui/issues/issue-54943.stderr +++ b/src/test/ui/issues/issue-54943.base.stderr @@ -1,11 +1,11 @@ error[E0477]: the type `&'a u32` does not fulfill the required lifetime - --> $DIR/issue-54943.rs:6:13 + --> $DIR/issue-54943.rs:10:13 | LL | let x = foo::<&'a u32>(); | ^^^^^^^^^^^^^^ | note: type must satisfy the static lifetime as required by this binding - --> $DIR/issue-54943.rs:1:11 + --> $DIR/issue-54943.rs:5:11 | LL | fn foo() { } | ^^^^^^^ diff --git a/src/test/ui/issues/issue-54943.nll.stderr b/src/test/ui/issues/issue-54943.nll.stderr index 59be0f983b9..2c86a5a3390 100644 --- a/src/test/ui/issues/issue-54943.nll.stderr +++ b/src/test/ui/issues/issue-54943.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-54943.rs:6:13 + --> $DIR/issue-54943.rs:10:13 | LL | fn boo<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-54943.rs b/src/test/ui/issues/issue-54943.rs index 85722300bf0..ad463e7a466 100644 --- a/src/test/ui/issues/issue-54943.rs +++ b/src/test/ui/issues/issue-54943.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + fn foo() { } fn boo<'a>() { diff --git a/src/test/ui/issues/issue-55731.stderr b/src/test/ui/issues/issue-55731.base.stderr similarity index 94% rename from src/test/ui/issues/issue-55731.stderr rename to src/test/ui/issues/issue-55731.base.stderr index de327cd3cc2..26b1c9ec468 100644 --- a/src/test/ui/issues/issue-55731.stderr +++ b/src/test/ui/issues/issue-55731.base.stderr @@ -1,5 +1,5 @@ error: implementation of `DistributedIteratorMulti` is not general enough - --> $DIR/issue-55731.rs:48:5 + --> $DIR/issue-55731.rs:52:5 | LL | multi(Map { | ^^^^^ implementation of `DistributedIteratorMulti` is not general enough diff --git a/src/test/ui/issues/issue-55731.nll.stderr b/src/test/ui/issues/issue-55731.nll.stderr index 97fd6678c99..168a2cbccd7 100644 --- a/src/test/ui/issues/issue-55731.nll.stderr +++ b/src/test/ui/issues/issue-55731.nll.stderr @@ -1,5 +1,5 @@ error: implementation of `DistributedIteratorMulti` is not general enough - --> $DIR/issue-55731.rs:48:5 + --> $DIR/issue-55731.rs:52:5 | LL | / multi(Map { LL | | i: Cloned(PhantomData), diff --git a/src/test/ui/issues/issue-55731.rs b/src/test/ui/issues/issue-55731.rs index 7b4f4e2cd3b..c6a0ee12589 100644 --- a/src/test/ui/issues/issue-55731.rs +++ b/src/test/ui/issues/issue-55731.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + use std::marker::PhantomData; trait DistributedIterator { diff --git a/src/test/ui/issues/issue-55796.stderr b/src/test/ui/issues/issue-55796.base.stderr similarity index 84% rename from src/test/ui/issues/issue-55796.stderr rename to src/test/ui/issues/issue-55796.base.stderr index 569a13f45bc..a4c5d68472d 100644 --- a/src/test/ui/issues/issue-55796.stderr +++ b/src/test/ui/issues/issue-55796.base.stderr @@ -1,22 +1,22 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/issue-55796.rs:16:9 + --> $DIR/issue-55796.rs:20:9 | LL | Box::new(self.out_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/issue-55796.rs:5:17 + --> $DIR/issue-55796.rs:9:17 | LL | pub trait Graph<'a> { | ^^ -note: ...so that the type `Map<>::EdgesIter, [closure@$DIR/issue-55796.rs:16:40: 16:54]>` will meet its required lifetime bounds - --> $DIR/issue-55796.rs:16:9 +note: ...so that the type `Map<>::EdgesIter, [closure@$DIR/issue-55796.rs:20:40: 20:54]>` will meet its required lifetime bounds + --> $DIR/issue-55796.rs:20:9 | LL | Box::new(self.out_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: but, the lifetime must be valid for the static lifetime... note: ...so that the types are compatible - --> $DIR/issue-55796.rs:16:9 + --> $DIR/issue-55796.rs:20:9 | LL | Box::new(self.out_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -24,24 +24,24 @@ LL | Box::new(self.out_edges(u).map(|e| e.target())) found `Box>::Node>>` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/issue-55796.rs:21:9 + --> $DIR/issue-55796.rs:26:9 | LL | Box::new(self.in_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/issue-55796.rs:5:17 + --> $DIR/issue-55796.rs:9:17 | LL | pub trait Graph<'a> { | ^^ -note: ...so that the type `Map<>::EdgesIter, [closure@$DIR/issue-55796.rs:21:39: 21:53]>` will meet its required lifetime bounds - --> $DIR/issue-55796.rs:21:9 +note: ...so that the type `Map<>::EdgesIter, [closure@$DIR/issue-55796.rs:26:39: 26:53]>` will meet its required lifetime bounds + --> $DIR/issue-55796.rs:26:9 | LL | Box::new(self.in_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: but, the lifetime must be valid for the static lifetime... note: ...so that the types are compatible - --> $DIR/issue-55796.rs:21:9 + --> $DIR/issue-55796.rs:26:9 | LL | Box::new(self.in_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-55796.nll.stderr b/src/test/ui/issues/issue-55796.nll.stderr index 5809a56cd4b..2b7d231871a 100644 --- a/src/test/ui/issues/issue-55796.nll.stderr +++ b/src/test/ui/issues/issue-55796.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-55796.rs:16:9 + --> $DIR/issue-55796.rs:20:9 | LL | pub trait Graph<'a> { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | Box::new(self.out_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/issue-55796.rs:21:9 + --> $DIR/issue-55796.rs:26:9 | LL | pub trait Graph<'a> { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-55796.rs b/src/test/ui/issues/issue-55796.rs index d802ce3b6cf..a0bc63dd2a7 100644 --- a/src/test/ui/issues/issue-55796.rs +++ b/src/test/ui/issues/issue-55796.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + pub trait EdgeTrait { fn target(&self) -> N; } @@ -14,12 +18,14 @@ pub trait Graph<'a> { fn out_neighbors(&'a self, u: &Self::Node) -> Box> { Box::new(self.out_edges(u).map(|e| e.target())) - //~^ ERROR cannot infer + //[base]~^ ERROR cannot infer + //[nll]~^^ ERROR lifetime may not live long enough } fn in_neighbors(&'a self, u: &Self::Node) -> Box> { Box::new(self.in_edges(u).map(|e| e.target())) - //~^ ERROR cannot infer + //[base]~^ ERROR cannot infer + //[nll]~^^ ERROR lifetime may not live long enough } } diff --git a/src/test/ui/issues/issue-75777.stderr b/src/test/ui/issues/issue-75777.base.stderr similarity index 89% rename from src/test/ui/issues/issue-75777.stderr rename to src/test/ui/issues/issue-75777.base.stderr index f440d7d1932..d2c6738cb59 100644 --- a/src/test/ui/issues/issue-75777.stderr +++ b/src/test/ui/issues/issue-75777.base.stderr @@ -1,16 +1,16 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements - --> $DIR/issue-75777.rs:11:14 + --> $DIR/issue-75777.rs:15:14 | LL | Box::new(move |_| fut) | ^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime `'a` as defined here... - --> $DIR/issue-75777.rs:9:11 + --> $DIR/issue-75777.rs:13:11 | LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box BoxFuture<'a, A>> { | ^^ note: ...so that the types are compatible - --> $DIR/issue-75777.rs:11:14 + --> $DIR/issue-75777.rs:15:14 | LL | Box::new(move |_| fut) | ^^^^^^^^^^^^ @@ -18,7 +18,7 @@ LL | Box::new(move |_| fut) found `(Pin + Send + 'a)>>,)` = note: but, the lifetime must be valid for the static lifetime... note: ...so that the types are compatible - --> $DIR/issue-75777.rs:11:5 + --> $DIR/issue-75777.rs:15:5 | LL | Box::new(move |_| fut) | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-75777.nll.stderr b/src/test/ui/issues/issue-75777.nll.stderr index 370cd72fd55..d1f8d388676 100644 --- a/src/test/ui/issues/issue-75777.nll.stderr +++ b/src/test/ui/issues/issue-75777.nll.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-75777.rs:11:5 + --> $DIR/issue-75777.rs:15:5 | LL | fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box BoxFuture<'a, A>> { | -- lifetime `'a` defined here diff --git a/src/test/ui/issues/issue-75777.rs b/src/test/ui/issues/issue-75777.rs index 357c07c7cec..930cd7ad37b 100644 --- a/src/test/ui/issues/issue-75777.rs +++ b/src/test/ui/issues/issue-75777.rs @@ -1,3 +1,7 @@ +// revisions: base nll +// ignore-compare-mode-nll +//[nll] compile-flags: -Z borrowck=mir + // Regression test for #75777. // Checks that a boxed future can be properly constructed. @@ -9,7 +13,8 @@ type BoxFuture<'a, T> = Pin + 'a + Send>>; fn inject<'a, Env: 'a, A: 'a + Send>(v: A) -> Box BoxFuture<'a, A>> { let fut: BoxFuture<'a, A> = Box::pin(future::ready(v)); Box::new(move |_| fut) - //~^ ERROR: cannot infer an appropriate lifetime + //[base]~^ ERROR: cannot infer an appropriate lifetime + //[nll]~^^ ERROR: lifetime may not live long enough } fn main() {}