]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-45199.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-45199.rs
1 fn test_drop_replace() {
2 let b: Box<isize>;
3 //~^ HELP make this binding mutable
4 //~| SUGGESTION mut b
5 b = Box::new(1); //~ NOTE first assignment
6 b = Box::new(2); //~ ERROR cannot assign twice to immutable variable `b`
7 //~| NOTE cannot assign twice to immutable
8 }
9
10 fn test_call() {
11 let b = Box::new(1); //~ NOTE first assignment
12 //~| HELP make this binding mutable
13 //~| SUGGESTION mut b
14 b = Box::new(2); //~ ERROR cannot assign twice to immutable variable `b`
15 //~| NOTE cannot assign twice to immutable
16 }
17
18 fn test_args(b: Box<i32>) { //~ HELP make this binding mutable
19 //~| SUGGESTION mut b
20 b = Box::new(2); //~ ERROR cannot assign to immutable argument `b`
21 //~| NOTE cannot assign to immutable argument
22 }
23
24 fn main() {}