diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/nll/issue-52086.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-52086.rs b/src/test/ui/nll/issue-52086.rs new file mode 100644 index 000000000..0414428e4 --- /dev/null +++ b/src/test/ui/nll/issue-52086.rs @@ -0,0 +1,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` +} |