We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1a0aea commit 6f1bdb4Copy full SHA for 6f1bdb4
src/librustc_error_codes/error_codes/E0197.md
@@ -1,13 +1,20 @@
1
+An inherent implementation was marked unsafe.
2
+
3
+Erroneous code example:
4
5
+```compile_fail,E0197
6
+struct Foo;
7
8
+unsafe impl Foo { } // error!
9
+```
10
11
Inherent implementations (one that do not implement a trait but provide
12
methods associated with a type) are always safe because they are not
13
implementing an unsafe trait. Removing the `unsafe` keyword from the inherent
14
implementation will resolve this error.
15
-```compile_fail,E0197
16
17
struct Foo;
18
-// this will cause this error
-unsafe impl Foo { }
-// converting it to this will fix it
-impl Foo { }
19
+impl Foo { } // ok!
20
```
0 commit comments