fn main() { let lock1 = Lock::new(); let lock2 = Lock::new(); drop(lock1); } #[non_exhaustive] pub struct Lock; impl Lock { pub fn new() -> Self { borrow_mutably::(); Self } } impl Drop for Lock { fn drop(&mut self) { unborrow_mutably::(); } } fn borrow_mutably() { fn __autoken_borrow_mutably() {} __autoken_borrow_mutably::(); } fn borrow_immutably() { fn __autoken_borrow_immutably() {} __autoken_borrow_immutably::(); } fn unborrow_mutably() { fn __autoken_unborrow_mutably() {} __autoken_unborrow_mutably::(); } fn unborrow_immutably() { fn __autoken_unborrow_immutably() {} __autoken_unborrow_immutably::(); }