code refactor, modify compile-fail tests
This commit is contained in:
parent
7a266a6902
commit
0c7fc046d3
6 changed files with 93 additions and 57 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue