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