Closed
Description
= help: try with
&mut $ crate :: fmt :: format ( format_args ! ( $ ( $ arg ) * ) )
should be
= help: try with
&mut format!("foo")
at the minimum. Even better would be to suggest *s
for the s
on the lhs of the assignment.
fn main() {
let s = &mut String::new();
s = format!("foo");
}
produces
error[E0308]: mismatched types
--> <anon>:3:9
|
3 | s = format!("foo");
| ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
|
= note: expected type `&mut std::string::String`
found type `std::string::String`
= help: try with `&mut $ crate :: fmt :: format ( format_args ! ( $ ( $ arg ) * ) )`
= note: this error originates in a macro outside of the current crate