rust/tests/ui/nll/issue-52086.rs

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

15 lines
289 B
Rust
Raw Normal View History

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