]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/kindck-send-owned.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / kindck-send-owned.rs
CommitLineData
1a4d82fc
JJ
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// Test which of the builtin types are considered sendable.
12
13fn assert_send<T:Send>() { }
14
15// owned content are ok
16fn test30() { assert_send::<Box<isize>>(); }
17fn test31() { assert_send::<String>(); }
18fn test32() { assert_send::<Vec<isize> >(); }
19
20// but not if they own a bad thing
85aaf69f 21fn test40() {
54a0048b 22 assert_send::<Box<*mut u8>>(); //~ ERROR : std::marker::Send` is not satisfied
1a4d82fc
JJ
23}
24
25fn main() { }