Rollup merge of #68279 - GuillaumeGomez:clean-up-e0198, r=Dylan-DPC

Clean up E0198 explanation

r? @Dylan-DPC
This commit is contained in:
Tyler Mandry 2020-01-17 17:28:17 -08:00 committed by GitHub
commit 2a1ab29806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,17 +1,18 @@
A negative implementation was marked as unsafe.
Erroneous code example:
```compile_fail
struct 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.
```compile_fail
#![feature(optin_builtin_traits)]
struct Foo;
// unsafe is unnecessary
unsafe impl !Clone for Foo { }
```
This will compile:
```ignore (ignore auto_trait future compatibility warning)