File tree 2 files changed +25
-1
lines changed
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,8 @@ fn main() {
3
3
//~^ ERROR mismatched types
4
4
let b: String = & format ! ( "b" ) ;
5
5
//~^ 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
6
10
}
Original file line number Diff line number Diff line change @@ -18,6 +18,26 @@ LL | let b: String = &format!("b");
18
18
| | help: consider removing the borrow: `format!("b")`
19
19
| expected due to this
20
20
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
22
42
23
43
For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments