mirror of https://github.com/rust-lang/rust
22 lines
345 B
Rust
22 lines
345 B
Rust
#![feature(negative_impls)]
|
|
|
|
struct MySendable {
|
|
t: *mut u8
|
|
}
|
|
|
|
unsafe impl Send for MySendable {}
|
|
|
|
struct MyNotSendable {
|
|
t: *mut u8
|
|
}
|
|
|
|
impl !Send for MyNotSendable {}
|
|
|
|
fn is_send<T: Send>() {}
|
|
|
|
fn main() {
|
|
is_send::<MySendable>();
|
|
is_send::<MyNotSendable>();
|
|
//~^ ERROR `MyNotSendable` cannot be sent between threads safely
|
|
}
|