File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,8 @@ fn main() {
33 //~^ ERROR mismatched types
44 let b: String = & format ! ( "b" ) ;
55 //~^ ERROR mismatched types
6+ let c: String = & mut format ! ( "c" ) ;
7+ //~^ ERROR mismatched types
8+ let d: String = & mut ( format ! ( "d" ) ) ;
9+ //~^ ERROR mismatched types
610}
Original file line number Diff line number Diff line change @@ -18,6 +18,26 @@ LL | let b: String = &format!("b");
1818 | | help: consider removing the borrow: `format!("b")`
1919 | expected due to this
2020
21- error: aborting due to 2 previous errors
21+ error[E0308]: mismatched types
22+ --> $DIR/format-borrow.rs:6:21
23+ |
24+ LL | let c: String = &mut format!("c");
25+ | ------ ^^^^^^^^^^^^^^^^^
26+ | | |
27+ | | expected struct `String`, found `&mut String`
28+ | | help: consider removing the borrow: `format!("c")`
29+ | expected due to this
30+
31+ error[E0308]: mismatched types
32+ --> $DIR/format-borrow.rs:8:21
33+ |
34+ LL | let d: String = &mut (format!("d"));
35+ | ------ ^^^^^^^^^^^^^^^^^^^
36+ | | |
37+ | | expected struct `String`, found `&mut String`
38+ | | help: consider removing the borrow: `format!("d")`
39+ | expected due to this
40+
41+ error: aborting due to 4 previous errors
2242
2343For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments