2017-11-27 02:07:58 -06:00
|
|
|
fn test() {
|
2019-04-22 02:40:08 -05:00
|
|
|
let b = Box::new(1); //~ NOTE first assignment
|
2021-04-12 17:29:09 -05:00
|
|
|
//~| HELP consider making this binding mutable
|
2019-04-22 02:40:08 -05:00
|
|
|
//~| SUGGESTION mut b
|
2017-11-27 02:07:58 -06:00
|
|
|
drop(b);
|
2019-04-22 02:40:08 -05:00
|
|
|
b = Box::new(2); //~ ERROR cannot assign twice to immutable variable `b`
|
|
|
|
//~| NOTE cannot assign twice to immutable
|
2023-02-08 15:29:52 -06:00
|
|
|
//~| NOTE in this expansion of desugaring of drop and replace
|
2017-11-27 02:07:58 -06:00
|
|
|
drop(b);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|