about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-08-08 13:59:54 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-08-08 21:17:36 +0200
commit259d35011168d68e5adcdaf02ab0a00e2f05c7a4 (patch)
tree6e3f3232d5da978e96e403de92818603165b1b44 /src/librustc_error_codes/error_codes
parentd19d7e27552b8da17932384b8db53927a1f4e00e (diff)
downloadrust-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.md22
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.