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