blob: 65efb69041d5907339b1fa9317cdddbd9d5d0c49 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Test which of the builtin types are considered sendable.
fn assert_send<T:Send>() { }
// owned content are ok
fn test30() { assert_send::<Box<isize>>(); }
fn test31() { assert_send::<String>(); }
fn test32() { assert_send::<Vec<isize> >(); }
// but not if they own a bad thing
fn test40() {
assert_send::<Box<*mut u8>>();
//~^ ERROR `*mut u8` cannot be sent between threads safely
}
fn main() { }
|