rust/tests/ui/nll/issue-48623-closure.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
253 B
Rust
Raw Normal View History

//@ 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() {}