diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-08-09 06:41:37 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-09 06:41:37 +0900 |
| commit | bc3ee48fd2a14e6b6d9a30bd98723daafa39960a (patch) | |
| tree | f750c2dcbcc5e8313650c1316142c767965c8f01 /src/librustc_error_codes/error_codes | |
| parent | 55f2490a5966f7ac935d708cf064ea30e101e370 (diff) | |
| parent | 17db7a4b5ca2f6439d8b8699029c060717e217f8 (diff) | |
| download | rust-bc3ee48fd2a14e6b6d9a30bd98723daafa39960a.tar.gz rust-bc3ee48fd2a14e6b6d9a30bd98723daafa39960a.zip | |
Rollup merge of #75291 - GuillaumeGomez:cleanup-e0750, r=pickfire
Clean up E0750 r? @Dylan-DPC
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. |
