-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
kennytm and daniellockyer
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.