提交 86e7b5c1 编写于 作者: N Niko Matsakis

use `-Znll -Zborrowck=mir -Zverbose` consistently

上级 75cf4826
......@@ -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)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册