Skip to content

Commit cc54a1f

Browse files
Clean up E0749 explanation
1 parent 8e73853 commit cc54a1f

File tree

1 file changed

+19
-4
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+19
-4
lines changed
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
Negative impls are not allowed to have any items. Negative impls
2-
declare that a trait is **not** implemented (and never will be) and
3-
hence there is no need to specify the values for trait methods or
4-
other items.
1+
An item was added on a negative impl.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0749
6+
# #![feature(negative_impls)]
7+
trait MyTrait {
8+
type Foo;
9+
}
10+
11+
impl !MyTrait for u32 {
12+
type Foo = i32; // error!
13+
}
14+
# fn main() {}
15+
```
16+
17+
Negative impls are not allowed to have any items. Negative impls declare that a
18+
trait is **not** implemented (and never will be) and hence there is no need to
19+
specify the values for trait methods or other items.

0 commit comments

Comments
 (0)