use -Znll -Zborrowck=mir -Zverbose consistently
This commit is contained in:
parent
75cf482651
commit
86e7b5c12a
6 changed files with 9 additions and 28 deletions
|
|
@ -13,13 +13,12 @@
|
|||
// a variety of errors from the older, AST-based machinery (notably
|
||||
// borrowck), and then we get the NLL error at the end.
|
||||
|
||||
// compile-flags:-Znll
|
||||
// compile-flags:-Znll -Zborrowck=mir -Zverbose
|
||||
|
||||
fn foo(x: &u32) -> &'static u32 {
|
||||
&*x
|
||||
//~^ WARN not reporting region error due to -Znll
|
||||
//~| ERROR `*x` does not live long enough
|
||||
//~| ERROR free region `'_#1r` does not outlive free region `'static`
|
||||
//~| ERROR free region `'_#1r` does not outlive free region `ReStatic`
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -4,29 +4,11 @@ warning: not reporting region error due to -Znll
|
|||
19 | &*x
|
||||
| ^^^
|
||||
|
||||
error[E0597]: `*x` does not live long enough
|
||||
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:6
|
||||
|
|
||||
19 | &*x
|
||||
| ^^ does not live long enough
|
||||
|
|
||||
= note: borrowed value must be valid for the static lifetime...
|
||||
note: ...but borrowed value is only valid for the anonymous lifetime #1 defined on the function body at 18:1
|
||||
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:18:1
|
||||
|
|
||||
18 | / fn foo(x: &u32) -> &'static u32 {
|
||||
19 | | &*x
|
||||
20 | | //~^ WARN not reporting region error due to -Znll
|
||||
21 | | //~| ERROR `*x` does not live long enough
|
||||
22 | | //~| ERROR free region `'_#1r` does not outlive free region `'static`
|
||||
23 | | }
|
||||
| |_^
|
||||
|
||||
error: free region `'_#1r` does not outlive free region `'static`
|
||||
error: free region `'_#1r` does not outlive free region `ReStatic`
|
||||
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:5
|
||||
|
|
||||
19 | &*x
|
||||
| ^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@
|
|||
// a variety of errors from the older, AST-based machinery (notably
|
||||
// borrowck), and then we get the NLL error at the end.
|
||||
|
||||
// compile-flags:-Znll -Zborrowck=mir
|
||||
// compile-flags:-Znll -Zborrowck=mir -Zverbose
|
||||
|
||||
fn foo<'a>(x: &'a u32) -> &'static u32 {
|
||||
&*x
|
||||
//~^ WARN not reporting region error due to -Znll
|
||||
//~| ERROR free region `'_#1r` does not outlive free region `'static`
|
||||
//~| ERROR free region `'_#1r` does not outlive free region `ReStatic`
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ warning: not reporting region error due to -Znll
|
|||
19 | &*x
|
||||
| ^^^
|
||||
|
||||
error: free region `'_#1r` does not outlive free region `'static`
|
||||
error: free region `'_#1r` does not outlive free region `ReStatic`
|
||||
--> $DIR/region-lbr-named-does-not-outlive-static.rs:19:5
|
||||
|
|
||||
19 | &*x
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
// a variety of errors from the older, AST-based machinery (notably
|
||||
// borrowck), and then we get the NLL error at the end.
|
||||
|
||||
// compile-flags:-Znll -Zborrowck=mir
|
||||
// compile-flags:-Znll -Zborrowck=mir -Zverbose
|
||||
|
||||
fn foo<'a, 'b>(x: &'a u32, y: &'b u32) -> &'b u32 {
|
||||
&*x
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// Basic test for free regions in the NLL code. This test does not
|
||||
// report an error because of the (implied) bound that `'b: 'a`.
|
||||
|
||||
// compile-flags:-Znll
|
||||
// compile-flags:-Znll -Zborrowck=mir -Zverbose
|
||||
// must-compile-successfully
|
||||
|
||||
#![allow(warnings)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue