]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0200.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0200.md
CommitLineData
dfeec247
XL
1An unsafe trait was implemented without an unsafe implementation.
2
3Erroneous code example:
4
5```compile_fail,E0200
6struct Foo;
7
8unsafe trait Bar { }
9
10impl Bar for Foo { } // error!
11```
12
60c5eb7d
XL
13Unsafe traits must have unsafe implementations. This error occurs when an
14implementation for an unsafe trait isn't marked as unsafe. This may be resolved
15by marking the unsafe implementation as unsafe.
16
dfeec247 17```
60c5eb7d
XL
18struct Foo;
19
20unsafe trait Bar { }
21
dfeec247 22unsafe impl Bar for Foo { } // ok!
60c5eb7d 23```