File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 1- A negative implementation is one that excludes a type from implementing a
2- particular trait. Not being able to use a trait is always a safe operation,
3- so negative implementations are always safe and never need to be marked as
4- unsafe.
1+ A negative implementation was marked as unsafe.
52
6- ``` compile_fail
7- #![feature(optin_builtin_traits)]
3+ Erroneous code example:
84
5+ ``` compile_fail
96struct Foo;
107
11- // unsafe is unnecessary
12- unsafe impl !Clone for Foo { }
8+ unsafe impl !Clone for Foo { } // error!
139```
1410
11+ A negative implementation is one that excludes a type from implementing a
12+ particular trait. Not being able to use a trait is always a safe operation,
13+ so negative implementations are always safe and never need to be marked as
14+ unsafe.
15+
1516This will compile:
1617
1718``` ignore (ignore auto_trait future compatibility warning)
You can’t perform that action at this time.
0 commit comments