]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0199.md
Auto merge of #66396 - smmalis37:pythontest, r=alexcrichton
[rust.git] / src / librustc_error_codes / error_codes / E0199.md
1 Safe traits should not have unsafe implementations, therefore marking an
2 implementation for a safe trait unsafe will cause a compiler error. Removing
3 the unsafe marker on the trait noted in the error will resolve this problem.
4
5 ```compile_fail,E0199
6 struct Foo;
7
8 trait Bar { }
9
10 // this won't compile because Bar is safe
11 unsafe impl Bar for Foo { }
12 // this will compile
13 impl Bar for Foo { }
14 ```