fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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