code refactor, modify compile-fail tests

This commit is contained in:
gaurikholkar 2018-03-10 20:24:59 +05:30
parent 7a266a6902
commit 0c7fc046d3
6 changed files with 93 additions and 57 deletions

View file

@ -27,7 +27,7 @@ fn indirect_write_to_imm_box() {
let y: Box<_> = box &mut x;
let p = &y;
***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference
//[mir]~^ ERROR cannot assign to immutable item `***p`
//[mir]~^ ERROR cannot assign through `&`-reference `p`
drop(p);
}

View file

@ -70,5 +70,5 @@ fn main() {
};
s[2] = 20;
//[ast]~^ ERROR cannot assign to immutable indexed content
//[mir]~^^ ERROR cannot assign to immutable item
//[mir]~^^ ERROR cannot assign through immutable item
}