clean up e0200 explanation
This commit is contained in:
@@ -1,14 +1,23 @@
|
|||||||
Unsafe traits must have unsafe implementations. This error occurs when an
|
An unsafe trait was implemented without an unsafe implementation.
|
||||||
implementation for an unsafe trait isn't marked as unsafe. This may be resolved
|
|
||||||
by marking the unsafe implementation as unsafe.
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0200
|
```compile_fail,E0200
|
||||||
struct Foo;
|
struct Foo;
|
||||||
|
|
||||||
unsafe trait Bar { }
|
unsafe trait Bar { }
|
||||||
|
|
||||||
// this won't compile because Bar is unsafe and impl isn't unsafe
|
impl Bar for Foo { } // error!
|
||||||
impl Bar for Foo { }
|
```
|
||||||
// this will compile
|
|
||||||
unsafe impl Bar for Foo { }
|
Unsafe traits must have unsafe implementations. This error occurs when an
|
||||||
|
implementation for an unsafe trait isn't marked as unsafe. This may be resolved
|
||||||
|
by marking the unsafe implementation as unsafe.
|
||||||
|
|
||||||
|
```
|
||||||
|
struct Foo;
|
||||||
|
|
||||||
|
unsafe trait Bar { }
|
||||||
|
|
||||||
|
unsafe impl Bar for Foo { } // ok!
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user