• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: Apache-2.0 OR MIT
2 
3 use std::pin::Pin;
4 
5 use pin_project::{pin_project, pinned_drop};
6 
7 #[pin_project(PinnedDrop)]
8 struct S {
9     #[pin]
10     f: u8,
11 }
12 
13 #[pinned_drop]
14 impl PinnedDrop for S {
drop(self: Pin<&mut Self>)15     fn drop(self: Pin<&mut Self>) {
16         self.project().f.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133]
17     }
18 }
19 
main()20 fn main() {}
21