Skip to content

Commit 5613502

Browse files
committed
Add long diagnostic for E0067
1 parent 750f2c6 commit 5613502

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ enum variant, one of the fields was not provided. Each field should be specified
4646
exactly once.
4747
"##,
4848

49+
E0067: r##"
50+
The left-hand side of an assignment operator must be an lvalue expression. An
51+
lvalue expression represents a memory location and includes item paths (ie,
52+
namespaced variables), dereferences, indexing expressions, and field references.
53+
54+
```
55+
use std::collections::LinkedList;
56+
57+
// Good
58+
let mut list = LinkedList::new();
59+
60+
61+
// Bad: assignment to non-lvalue expression
62+
LinkedList::new() += 1;
63+
```
64+
"##,
65+
4966
E0081: r##"
5067
Enum discriminants are used to differentiate enum variants stored in memory.
5168
This error indicates that the same value was used for two or more variants,
@@ -149,7 +166,6 @@ register_diagnostics! {
149166
E0060,
150167
E0061,
151168
E0066,
152-
E0067,
153169
E0068,
154170
E0069,
155171
E0070,

0 commit comments

Comments
 (0)