Skip to content

Commit b6f9a41

Browse files
committed
Add long diagnostic for E0067
1 parent 67ba6dc commit b6f9a41

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/librustc_typeck/diagnostics.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ let x_is_nonzero = x as bool;
3434
```
3535
"##,
3636

37+
E0067: r##"
38+
The left-hand side of an assignment operator must be an lvalue expression. An
39+
lvalue expression represents a memory location and includes item paths (ie,
40+
namespaced variables), dereferences, indexing expressions, and field references.
41+
42+
```
43+
use std::collections::LinkedList;
44+
45+
// Good
46+
let mut list = LinkedList::new();
47+
48+
49+
// Bad: assignment to non-lvalue expression
50+
LinkedList::new() += 1;
51+
```
52+
53+
```
54+
"##,
55+
3756
E0081: r##"
3857
Enum discriminants are used to differentiate enum variants stored in memory.
3958
This error indicates that the same value was used for two or more variants,
@@ -139,7 +158,6 @@ register_diagnostics! {
139158
E0062,
140159
E0063,
141160
E0066,
142-
E0067,
143161
E0068,
144162
E0069,
145163
E0070,

0 commit comments

Comments
 (0)