]>
git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #85939 - m-ou-se:fix-remove-ref-macro-invocation, r=estebank
Fix suggestion for removing &mut from &mut macro!().
Fixes #85933
Before: (Note the suggestions.)
```
error[E0308]: mismatched types
--> src/main.rs:2:21
|
2 | let _: String = &mut format!("");
| ------ ^^^^^^^^^^^^^^^^
| | |
| | expected struct `String`, found `&mut String`
| | help: consider removing the borrow: `mut format!("")`
| expected due to this
error[E0308]: mismatched types
--> src/main.rs:3:21
|
3 | let _: String = &mut (format!(""));
| ------ ^^^^^^^^^^^^^^^^^^
| | |
| | expected struct `String`, found `&mut String`
| | help: consider removing the borrow: `mut (format!(""))`
| expected due to this
```
After:
```
error[E0308]: mismatched types
--> src/main.rs:2:21
|
2 | let _: String = &mut format!("");
| ------ ^^^^^^^^^^^^^^^^
| | |
| | expected struct `String`, found `&mut String`
| | help: consider removing the borrow: `format!("")`
| expected due to this
error[E0308]: mismatched types
--> src/main.rs:3:21
|
3 | let _: String = &mut (format!(""));
| ------ ^^^^^^^^^^^^^^^^^^
| | |
| | expected struct `String`, found `&mut String`
| | help: consider removing the borrow: `format!("")`
| expected due to this
```