improve conflict error reporting

This commit is contained in:
Ariel Ben-Yehuda 2017-12-03 17:55:41 +02:00
parent f8c35d9e41
commit cbcae7f694
3 changed files with 21 additions and 11 deletions

View file

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

View file

@ -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);