diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-7013.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-7013.rs b/src/test/ui/issues/issue-7013.rs new file mode 100644 index 000000000..c1f400b33 --- /dev/null +++ b/src/test/ui/issues/issue-7013.rs @@ -0,0 +1,28 @@ +#![feature(box_syntax)] + +use std::cell::RefCell; +use std::rc::Rc; + +trait Foo { + fn set(&mut self, v: Rc<RefCell<A>>); +} + +struct B { + v: Option<Rc<RefCell<A>>> +} + +impl Foo for B { + fn set(&mut self, v: Rc<RefCell<A>>) + { + self.v = Some(v); + } +} + +struct A { + v: Box<dyn Foo + Send>, +} + +fn main() { + let a = A {v: box B{v: None} as Box<dyn Foo + Send>}; + //~^ ERROR `Rc<RefCell<A>>` cannot be sent between threads safely +} |