rust/tests/ui/issues/issue-25515.rs

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

21 lines
277 B
Rust
Raw Normal View History

// run-pass
use std::rc::Rc;
struct Foo<'r>(&'r mut i32);
impl<'r> Drop for Foo<'r> {
fn drop(&mut self) {
*self.0 += 1;
}
}
fn main() {
let mut drops = 0;
{
2019-05-28 18:47:21 +00:00
let _: Rc<dyn Send> = Rc::new(Foo(&mut drops));
}
assert_eq!(1, drops);
}