mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
3a9bf45513
It's only valid when applied to a type or lifetime parameter in `Drop` trait implementation.
51 lines
1.7 KiB
Plaintext
51 lines
1.7 KiB
Plaintext
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:8:13
|
|
|
|
|
LL | unsafe impl<#[may_dangle] 'a, T, const N: usize> NotDrop for Implee1<'a, T, N> {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:11:17
|
|
|
|
|
LL | unsafe impl<'a, #[may_dangle] T, const N: usize> NotDrop for Implee2<'a, T, N> {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:14:20
|
|
|
|
|
LL | unsafe impl<'a, T, #[may_dangle] const N: usize> Drop for Implee1<'a, T, N> {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:42:1
|
|
|
|
|
LL | #[may_dangle]
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:45:1
|
|
|
|
|
LL | #[may_dangle]
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:49:1
|
|
|
|
|
LL | #[may_dangle]
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:51:5
|
|
|
|
|
LL | #[may_dangle]
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: `#[may_dangle]` must be applied to a lifetime or type generic parameter in `Drop` impl
|
|
--> $DIR/may_dangle.rs:36:17
|
|
|
|
|
LL | unsafe impl<#[may_dangle] T> Drop for Implee<T> {
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: aborting due to 8 previous errors
|
|
|