Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/librustc_error_codes/error_codes/E0750.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
Negative impls cannot be default impls. A default impl supplies
default values for the items within to be used by other impls, whereas
a negative impl declares that there are no other impls. These don't
make sense to combine.
A negative impl was made default impl.

Erroneous code example:

```compile_fail,E0750
# #![feature(negative_impls)]
# #![feature(specialization)]
trait MyTrait {
type Foo;
}

default impl !MyTrait for u32 {} // error!
# fn main() {}
```

Negative impls cannot be default impls. A default impl supplies default values
for the items within to be used by other impls, whereas a negative impl declares
that there are no other impls. Combining it does not make sense.
3 changes: 1 addition & 2 deletions src/tools/tidy/src/error_codes_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const EXEMPTED_FROM_TEST: &[&str] = &[
];

// Some error codes don't have any tests apparently...
const IGNORE_EXPLANATION_CHECK: &[&str] =
&["E0570", "E0601", "E0602", "E0639", "E0729", "E0749", "E0750"];
const IGNORE_EXPLANATION_CHECK: &[&str] = &["E0570", "E0601", "E0602", "E0639", "E0729", "E0749"];

fn check_error_code_explanation(
f: &str,
Expand Down