]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-default-trait-impl.stderr
Rollup merge of #102689 - ayrtonm:master, r=cjgillot
[rust.git] / src / test / ui / coherence / coherence-default-trait-impl.stderr
1 error[E0199]: implementing the trait `MySafeTrait` is not unsafe
2   --> $DIR/coherence-default-trait-impl.rs:8:1
3    |
4 LL | unsafe impl MySafeTrait for Foo {}
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7 help: remove `unsafe` from this trait implementation
8    |
9 LL - unsafe impl MySafeTrait for Foo {}
10 LL + impl MySafeTrait for Foo {}
11    |
12
13 error[E0200]: the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
14   --> $DIR/coherence-default-trait-impl.rs:13:1
15    |
16 LL | impl MyUnsafeTrait for Foo {}
17    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18    |
19    = note: the trait `MyUnsafeTrait` 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
20 help: add `unsafe` to this trait implementation
21    |
22 LL | unsafe impl MyUnsafeTrait for Foo {}
23    | ++++++
24
25 error: aborting due to 2 previous errors
26
27 Some errors have detailed explanations: E0199, E0200.
28 For more information about an error, try `rustc --explain E0199`.