Skip to content

Commit fe413c7

Browse files
authored
Rollup merge of rust-lang#68279 - GuillaumeGomez:clean-up-e0198, r=Dylan-DPC
Clean up E0198 explanation r? @Dylan-DPC
2 parents 7f44666 + 9c6c2f1 commit fe413c7

File tree

1 file changed

+9
-8
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+9
-8
lines changed

src/librustc_error_codes/error_codes/E0198.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
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
96
struct 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+
1516
This will compile:
1617

1718
```ignore (ignore auto_trait future compatibility warning)

0 commit comments

Comments
 (0)