@@ -124,8 +124,8 @@ be specified exactly one time.
124
124
125
125
E0063 : r##"
126
126
This error indicates that during an attempt to build a struct or struct-like
127
- enum variant, one of the fields was not provided. Each field should be specified
128
- exactly once.
127
+ enum variant, one of the fields was not provided. Each field should be
128
+ specified exactly once.
129
129
"## ,
130
130
131
131
E0066 : r##"
@@ -141,7 +141,8 @@ and [RFC 809] for more details.
141
141
E0067 : r##"
142
142
The left-hand side of an assignment operator must be an lvalue expression. An
143
143
lvalue expression represents a memory location and includes item paths (ie,
144
- namespaced variables), dereferences, indexing expressions, and field references.
144
+ namespaced variables), dereferences, indexing expressions, and field
145
+ references.
145
146
146
147
```
147
148
use std::collections::LinkedList;
@@ -170,6 +171,37 @@ Since `return;` is just like `return ();`, there is a mismatch between the
170
171
function's return type and the value being returned.
171
172
"## ,
172
173
174
+ E0070 : r##"
175
+ The left-hand side of an assignment operator must be an lvalue expression. An
176
+ lvalue expression represents a memory location and includes item paths (ie,
177
+ namespaced variables), dereferences, indexing expressions, and field
178
+ references.
179
+
180
+ More details can be found here:
181
+ https://doc.rust-lang.org/reference.html#lvalues,-rvalues-and-temporaries
182
+
183
+ Now, we can go further. Here are some bad examples:
184
+ ```
185
+ const SOME_CONST : i32 = 12;
186
+
187
+ fn some_other_func() {}
188
+
189
+ fn some_function() {
190
+ SOME_CONST = 14; // error : a constant value cannot be changed !
191
+ 1=3; // error : 1 isn't a valid lvalue !
192
+ some_other_func() = 4; // error : we can't assign value to a function !
193
+ }
194
+ ```
195
+
196
+ And now let's give good examples:
197
+
198
+ ```
199
+ let mut i : i32 = 1; // that's good
200
+
201
+ i = 3; // that's good !
202
+ ```
203
+ "## ,
204
+
173
205
E0081 : r##"
174
206
Enum discriminants are used to differentiate enum variants stored in memory.
175
207
This error indicates that the same value was used for two or more variants,
@@ -658,7 +690,6 @@ register_diagnostics! {
658
690
E0060 ,
659
691
E0061 ,
660
692
E0068 ,
661
- E0070 ,
662
693
E0071 ,
663
694
E0072 ,
664
695
E0073 ,
0 commit comments