]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/format-borrow.stderr
Rollup merge of #106798 - scottmcm:signum-via-cmp, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / format-borrow.stderr
1 error[E0308]: mismatched types
2   --> $DIR/format-borrow.rs:2:21
3    |
4 LL |     let a: String = &String::from("a");
5    |            ------   ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
6    |            |
7    |            expected due to this
8    |
9 help: consider removing the borrow
10    |
11 LL -     let a: String = &String::from("a");
12 LL +     let a: String = String::from("a");
13    |
14 help: alternatively, consider changing the type annotation
15    |
16 LL |     let a: &String = &String::from("a");
17    |            +
18
19 error[E0308]: mismatched types
20   --> $DIR/format-borrow.rs:4:21
21    |
22 LL |     let b: String = &format!("b");
23    |            ------   ^^^^^^^^^^^^^ expected struct `String`, found `&String`
24    |            |
25    |            expected due to this
26    |
27 help: consider removing the borrow
28    |
29 LL -     let b: String = &format!("b");
30 LL +     let b: String = format!("b");
31    |
32 help: alternatively, consider changing the type annotation
33    |
34 LL |     let b: &String = &format!("b");
35    |            +
36
37 error[E0308]: mismatched types
38   --> $DIR/format-borrow.rs:6:21
39    |
40 LL |     let c: String = &mut format!("c");
41    |            ------   ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
42    |            |
43    |            expected due to this
44    |
45 help: consider removing the borrow
46    |
47 LL -     let c: String = &mut format!("c");
48 LL +     let c: String = format!("c");
49    |
50 help: alternatively, consider changing the type annotation
51    |
52 LL |     let c: &mut String = &mut format!("c");
53    |            ++++
54
55 error[E0308]: mismatched types
56   --> $DIR/format-borrow.rs:8:21
57    |
58 LL |     let d: String = &mut (format!("d"));
59    |            ------   ^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
60    |            |
61    |            expected due to this
62    |
63 help: consider removing the borrow
64    |
65 LL -     let d: String = &mut (format!("d"));
66 LL +     let d: String = format!("d"));
67    |
68 help: alternatively, consider changing the type annotation
69    |
70 LL |     let d: &mut String = &mut (format!("d"));
71    |            ++++
72
73 error: aborting due to 4 previous errors
74
75 For more information about this error, try `rustc --explain E0308`.