improve conflict error reporting
This commit is contained in:
parent
f8c35d9e41
commit
cbcae7f694
3 changed files with 21 additions and 11 deletions
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
fn cplusplus_mode(x: isize) -> &'static isize {
|
||||
&x //[ast]~ ERROR `x` does not live long enough
|
||||
//[mir]~^ ERROR borrowed value does not live long enough
|
||||
}
|
||||
//[mir]~^ ERROR borrowed value does not live long enough
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
fn cplusplus_mode_exceptionally_unsafe(x: &mut Option<&'static mut isize>) {
|
||||
let mut z = (0, 0);
|
||||
*x = Some(&mut z.1); //[ast]~ ERROR [E0597]
|
||||
//[mir]~^ ERROR [E0597]
|
||||
panic!("catch me for a dangling pointer!")
|
||||
}
|
||||
//[mir]~^ ERROR [E0597]
|
||||
|
||||
fn main() {
|
||||
cplusplus_mode_exceptionally_unsafe(&mut None);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue