aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/pinned_drop/unsafe-call.rs
blob: 2f400c1de89e920e04684a28560ab74fb7e17250 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use pin_project::{pin_project, pinned_drop};
use std::pin::Pin;

#[pin_project(PinnedDrop)]
struct Struct {
    #[pin]
    field: u8,
}

#[pinned_drop]
impl PinnedDrop for Struct {
    fn drop(self: Pin<&mut Self>) {
        self.project().field.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133]
    }
}

fn main() {}