1 error[E0308]: mismatched types
2 --> $DIR/format-borrow.rs:2:21
4 LL | let a: String = &String::from("a");
5 | ------ ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
9 help: consider removing the borrow
11 LL - let a: String = &String::from("a");
12 LL + let a: String = String::from("a");
14 help: alternatively, consider changing the type annotation
16 LL | let a: &String = &String::from("a");
19 error[E0308]: mismatched types
20 --> $DIR/format-borrow.rs:4:21
22 LL | let b: String = &format!("b");
23 | ------ ^^^^^^^^^^^^^ expected struct `String`, found `&String`
25 | expected due to this
27 help: consider removing the borrow
29 LL - let b: String = &format!("b");
30 LL + let b: String = format!("b");
32 help: alternatively, consider changing the type annotation
34 LL | let b: &String = &format!("b");
37 error[E0308]: mismatched types
38 --> $DIR/format-borrow.rs:6:21
40 LL | let c: String = &mut format!("c");
41 | ------ ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
43 | expected due to this
45 help: consider removing the borrow
47 LL - let c: String = &mut format!("c");
48 LL + let c: String = format!("c");
50 help: alternatively, consider changing the type annotation
52 LL | let c: &mut String = &mut format!("c");
55 error[E0308]: mismatched types
56 --> $DIR/format-borrow.rs:8:21
58 LL | let d: String = &mut (format!("d"));
59 | ------ ^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
61 | expected due to this
63 help: consider removing the borrow
65 LL - let d: String = &mut (format!("d"));
66 LL + let d: String = format!("d"));
68 help: alternatively, consider changing the type annotation
70 LL | let d: &mut String = &mut (format!("d"));
73 error: aborting due to 4 previous errors
75 For more information about this error, try `rustc --explain E0308`.