]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/no-send-res-ports.rs
doc: remove incomplete sentence
[rust.git] / src / test / compile-fail / no-send-res-ports.rs
1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![feature(unsafe_destructor)]
12
13 use std::task;
14 use std::rc::Rc;
15
16 #[derive(Show)]
17 struct Port<T>(Rc<T>);
18
19 fn main() {
20     #[derive(Show)]
21     struct foo {
22       _x: Port<()>,
23     }
24
25     #[unsafe_destructor]
26     impl Drop for foo {
27         fn drop(&mut self) {}
28     }
29
30     fn foo(x: Port<()>) -> foo {
31         foo {
32             _x: x
33         }
34     }
35
36     let x = foo(Port(Rc::new(())));
37
38     task::spawn(move|| {
39         //~^ ERROR `core::kinds::Send` is not implemented
40         //~^^ ERROR `core::kinds::Send` is not implemented
41         let y = x;
42         println!("{}", y);
43     });
44 }