about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-01-18 01:29:28 +0000
committerbors <bors@rust-lang.org>2020-01-18 01:29:28 +0000
commit8c28fe89c7d33953841e8c210e769ba8ce5ceedb (patch)
tree8903e14709f4326a22a1bde4654cc3253bc1f1aa /src/librustc_error_codes/error_codes
parentd8dcb6345bfac471aadc1e674aef8ddc78ad5c1c (diff)
parent14d779c3f0c824ced78f7381c49074cc07c9d602 (diff)
downloadrust-8c28fe89c7d33953841e8c210e769ba8ce5ceedb.tar.gz
rust-8c28fe89c7d33953841e8c210e769ba8ce5ceedb.zip
Auto merge of #68330 - tmandry:rollup-5v29y9r, r=tmandry
Rollup of 9 pull requests

Successful merges:

 - #66660 (Don't warn about snake case for field puns.)
 - #68093 (Fix deref impl typedef)
 - #68204 (Use named fields for `{ast,hir}::ItemKind::Impl`)
 - #68256 (Do not ICE on malformed suggestion spans)
 - #68279 (Clean up E0198 explanation)
 - #68291 (Update sanitizer tests)
 - #68312 (Add regression test for integer literals in generic arguments in where clauses)
 - #68314 (Stop treating `FalseEdges` and `FalseUnwind` as having semantic value for const eval)
 - #68317 (Clean up E0199 explanation)

Failed merges:

r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0198.md17
-rw-r--r--src/librustc_error_codes/error_codes/E0199.md21
2 files changed, 24 insertions, 14 deletions
diff --git a/src/librustc_error_codes/error_codes/E0198.md b/src/librustc_error_codes/error_codes/E0198.md
index 6504d60dbd1..687214a2050 100644
--- a/src/librustc_error_codes/error_codes/E0198.md
+++ b/src/librustc_error_codes/error_codes/E0198.md
@@ -1,17 +1,18 @@
-A negative implementation is one that excludes a type from implementing a
-particular trait. Not being able to use a trait is always a safe operation,
-so negative implementations are always safe and never need to be marked as
-unsafe.
+A negative implementation was marked as unsafe.
 
-```compile_fail
-#![feature(optin_builtin_traits)]
+Erroneous code example:
 
+```compile_fail
 struct Foo;
 
-// unsafe is unnecessary
-unsafe impl !Clone for Foo { }
+unsafe impl !Clone for Foo { } // error!
 ```
 
+A negative implementation is one that excludes a type from implementing a
+particular trait. Not being able to use a trait is always a safe operation,
+so negative implementations are always safe and never need to be marked as
+unsafe.
+
 This will compile:
 
 ```ignore (ignore auto_trait future compatibility warning)
diff --git a/src/librustc_error_codes/error_codes/E0199.md b/src/librustc_error_codes/error_codes/E0199.md
index d0c12dc6f17..88130e8e5e5 100644
--- a/src/librustc_error_codes/error_codes/E0199.md
+++ b/src/librustc_error_codes/error_codes/E0199.md
@@ -1,14 +1,23 @@
+A trait implementation was marked as unsafe while the trait is safe.
+
+Erroneous code example:
+
+```compile_fail,E0199
+struct Foo;
+
+trait Bar { }
+
+unsafe impl Bar for Foo { } // error!
+```
+
 Safe traits should not have unsafe implementations, therefore marking an
 implementation for a safe trait unsafe will cause a compiler error. Removing
-the unsafe marker on the trait noted in the error will resolve this problem.
+the unsafe marker on the trait noted in the error will resolve this problem:
 
-```compile_fail,E0199
+```
 struct Foo;
 
 trait Bar { }
 
-// this won't compile because Bar is safe
-unsafe impl Bar for Foo { }
-// this will compile
-impl Bar for Foo { }
+impl Bar for Foo { } // ok!
 ```