mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
17 lines
252 B
Rust
17 lines
252 B
Rust
// run-pass
|
|
#![allow(path_statements)]
|
|
#![allow(dead_code)]
|
|
|
|
struct WithDrop;
|
|
|
|
impl Drop for WithDrop {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
fn reborrow_from_closure(r: &mut ()) -> &mut () {
|
|
let d = WithDrop;
|
|
(move || { d; &mut *r })()
|
|
}
|
|
|
|
fn main() {}
|