summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/issue-52086.rs
blob: 0414428e48150ca498a9baca8a23e96823ecebb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::rc::Rc;
use std::sync::Arc;

struct Bar { field: Vec<i32> }

fn main() {
    let x = Rc::new(Bar { field: vec![] });
    drop(x.field);
//~^ ERROR cannot move out of an `Rc`

    let y = Arc::new(Bar { field: vec![] });
    drop(y.field);
//~^ ERROR cannot move out of an `Arc`
}