2018-09-30 21:21:31 +02:00
|
|
|
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);
|
2018-11-27 10:56:36 +01:00
|
|
|
//~^ ERROR cannot move out of an `Rc`
|
2018-09-30 21:21:31 +02:00
|
|
|
|
|
|
|
|
let y = Arc::new(Bar { field: vec![] });
|
|
|
|
|
drop(y.field);
|
2018-11-27 10:56:36 +01:00
|
|
|
//~^ ERROR cannot move out of an `Arc`
|
2018-09-30 21:21:31 +02:00
|
|
|
}
|