]> git.lizzy.rs Git - rust.git/blob - src/test/compile-fail/kindck-send-object2.rs
Auto merge of #22541 - Manishearth:rollup, r=Gankro
[rust.git] / src / test / compile-fail / kindck-send-object2.rs
1 // Copyright 2014 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 // Continue kindck-send-object1.rs.
12
13 use std::marker::MarkerTrait;
14
15 fn assert_send<T:Send>() { }
16 trait Dummy : MarkerTrait { }
17
18 fn test50() {
19     assert_send::<&'static Dummy>(); //~ ERROR the trait `core::marker::Sync` is not implemented
20 }
21
22 fn test53() {
23     assert_send::<Box<Dummy>>(); //~ ERROR the trait `core::marker::Send` is not implemented
24 }
25
26 // ...unless they are properly bounded
27 fn test60() {
28     assert_send::<&'static (Dummy+Sync)>();
29 }
30 fn test61() {
31     assert_send::<Box<Dummy+Send>>();
32 }
33
34 fn main() { }