]> git.lizzy.rs Git - rust.git/commitdiff
Clean up E0198 explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 16 Jan 2020 13:35:37 +0000 (14:35 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 17 Jan 2020 18:47:48 +0000 (19:47 +0100)
src/librustc_error_codes/error_codes/E0198.md

index 6504d60dbd1d53d1abcb95433e9913f0941410a1..687214a205096ff62c0c5454062938714c309ea7 100644 (file)
@@ -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)