diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-08 13:59:54 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-08 21:17:36 +0200 |
| commit | 259d35011168d68e5adcdaf02ab0a00e2f05c7a4 (patch) | |
| tree | 6e3f3232d5da978e96e403de92818603165b1b44 /src/librustc_error_codes/error_codes | |
| parent | d19d7e27552b8da17932384b8db53927a1f4e00e (diff) | |
| download | rust-259d35011168d68e5adcdaf02ab0a00e2f05c7a4.tar.gz rust-259d35011168d68e5adcdaf02ab0a00e2f05c7a4.zip | |
Clean up E0750 explanation
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0750.md | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/librustc_error_codes/error_codes/E0750.md b/src/librustc_error_codes/error_codes/E0750.md index e0cf56f716f..905e852f8d5 100644 --- a/src/librustc_error_codes/error_codes/E0750.md +++ b/src/librustc_error_codes/error_codes/E0750.md @@ -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. |
