]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/safety-trait-impl-cc.stderr
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / safety-trait-impl-cc.stderr
1 error[E0200]: the trait `Foo` requires an `unsafe impl` declaration
2   --> $DIR/safety-trait-impl-cc.rs:9:1
3    |
4 LL | / impl lib::Foo for Bar {
5 LL | |     fn foo(&self) -> isize {
6 LL | |         panic!();
7 LL | |     }
8 LL | | }
9    | |_^
10    |
11    = note: the trait `Foo` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
12 help: add `unsafe` to this trait implementation
13    |
14 LL | unsafe impl lib::Foo for Bar {
15    | ++++++
16
17 error: aborting due to previous error
18
19 For more information about this error, try `rustc --explain E0200`.