summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0200.md
blob: 7245bb59ce5ffa5406f42f82e752ff0b89303643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
An unsafe trait was implemented without an unsafe implementation.

Erroneous code example:

```compile_fail,E0200
struct Foo;

unsafe trait Bar { }

impl Bar for Foo { } // error!
```

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!
```