summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-25515.rs
blob: e7b9ea3acfc01e225263bdeffa68cc7f8de480d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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;

    {
        let _: Rc<dyn Send> = Rc::new(Foo(&mut drops));
    }

    assert_eq!(1, drops);
}