]> git.lizzy.rs Git - rust.git/blob - tests/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / dropck / dropck-eyepatch-implies-unsafe-impl.stderr
1 error[E0569]: requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
2   --> $DIR/dropck-eyepatch-implies-unsafe-impl.rs:21:1
3    |
4 LL | impl<#[may_dangle] A, B: fmt::Debug> Drop for Pt<A, B> {
5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: the trait `Drop` 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
8 help: add `unsafe` to this trait implementation
9    |
10 LL | unsafe impl<#[may_dangle] A, B: fmt::Debug> Drop for Pt<A, B> {
11    | ++++++
12
13 error[E0569]: requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
14   --> $DIR/dropck-eyepatch-implies-unsafe-impl.rs:27:1
15    |
16 LL | impl<#[may_dangle] 'a, 'b, B: fmt::Debug> Drop for Pr<'a, 'b, B> {
17    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18    |
19    = note: the trait `Drop` 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<#[may_dangle] 'a, 'b, B: fmt::Debug> Drop for Pr<'a, 'b, B> {
23    | ++++++
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0569`.