-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Expand file tree
/
Copy pathcoerce-suggestions.stderr
More file actions
149 lines (139 loc) · 3.95 KB
/
Copy pathcoerce-suggestions.stderr
File metadata and controls
149 lines (139 loc) · 3.95 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:8:20
|
LL | let x: usize = String::new();
| ----- ^^^^^^^^^^^^^ expected `usize`, found `String`
| |
| expected due to this
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:10:19
|
LL | let x: &str = String::new();
| ---- ^^^^^^^^^^^^^ expected `&str`, found `String`
| |
| expected due to this
|
help: consider borrowing here
|
LL | let x: &str = &String::new();
| +
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:13:10
|
LL | test(&y);
| ---- ^^ types differ in mutability
| |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut String`
found reference `&String`
note: function defined here
--> $DIR/coerce-suggestions.rs:1:4
|
LL | fn test(_x: &mut String) {}
| ^^^^ ---------------
help: consider using `&mut` instead
|
LL | test(&mut y);
| +++
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:15:10
|
LL | test(&raw const y);
| ---- ^^^^^^^^^^^^ expected `&mut String`, found `*const String`
| |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut String`
found raw pointer `*const String`
note: function defined here
--> $DIR/coerce-suggestions.rs:1:4
|
LL | fn test(_x: &mut String) {}
| ^^^^ ---------------
help: consider using `&mut` instead
|
LL - test(&raw const y);
LL + test(&mut y);
|
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:17:10
|
LL | test(&raw mut y);
| ---- ^^^^^^^^^^ expected `&mut String`, found `*mut String`
| |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut String`
found raw pointer `*mut String`
note: function defined here
--> $DIR/coerce-suggestions.rs:1:4
|
LL | fn test(_x: &mut String) {}
| ^^^^ ---------------
help: consider using `&mut` instead
|
LL - test(&raw mut y);
LL + test(&mut y);
|
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:19:11
|
LL | test2(&y);
| ----- ^^ types differ in mutability
| |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut i32`
found reference `&String`
note: function defined here
--> $DIR/coerce-suggestions.rs:3:4
|
LL | fn test2(_x: &mut i32) {}
| ^^^^^ ------------
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:22:9
|
LL | s = format!("foo");
| ^^^^^^^^^^^^^^ expected `&mut String`, found `String`
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:25:11
|
LL | test3(&raw const s);
| ----- ^^^^^^^^^^^^ types differ in mutability
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*mut String`
found raw pointer `*const String`
note: function defined here
--> $DIR/coerce-suggestions.rs:5:4
|
LL | fn test3(_x: *mut String) {}
| ^^^^^ ---------------
help: consider using `&raw mut` instead
|
LL - test3(&raw const s);
LL + test3(&raw mut s);
|
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:27:11
|
LL | test3(&s);
| ----- ^^ types differ in mutability
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*mut String`
found reference `&String`
note: function defined here
--> $DIR/coerce-suggestions.rs:5:4
|
LL | fn test3(_x: *mut String) {}
| ^^^^^ ---------------
help: consider using `&mut` instead
|
LL | test3(&mut s);
| +++
error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0308`.