]> git.lizzy.rs Git - rust.git/blob - tests/ui/kindck/kindck-send-owned.rs
Rollup merge of #106733 - DebugSteven:revert-104552-warn-newer-x, r=jyn514
[rust.git] / tests / ui / kindck / kindck-send-owned.rs
1 // Test which of the builtin types are considered sendable.
2
3 fn assert_send<T:Send>() { }
4
5 // owned content are ok
6 fn test30() { assert_send::<Box<isize>>(); }
7 fn test31() { assert_send::<String>(); }
8 fn test32() { assert_send::<Vec<isize> >(); }
9
10 // but not if they own a bad thing
11 fn test40() {
12     assert_send::<Box<*mut u8>>();
13     //~^ ERROR `*mut u8` cannot be sent between threads safely
14 }
15
16 fn main() { }