2020-01-09 10:56:38 +00:00
|
|
|
#![feature(negative_impls)]
|
2014-12-29 12:52:43 +00:00
|
|
|
|
2015-01-06 22:33:42 +00:00
|
|
|
use std::marker::Send;
|
2014-12-28 22:33:18 +00:00
|
|
|
|
|
|
|
struct TestType;
|
|
|
|
|
|
|
|
impl !TestType {}
|
2017-12-02 19:15:03 +00:00
|
|
|
//~^ ERROR inherent impls cannot be negative
|
2014-12-28 22:33:18 +00:00
|
|
|
|
|
|
|
trait TestTrait {}
|
|
|
|
|
|
|
|
unsafe impl !Send for TestType {}
|
2017-12-02 19:15:03 +00:00
|
|
|
//~^ ERROR negative impls cannot be unsafe
|
2014-12-28 22:33:18 +00:00
|
|
|
impl !TestTrait for TestType {}
|
|
|
|
|
2017-12-02 19:15:03 +00:00
|
|
|
struct TestType2<T>(T);
|
2014-12-28 22:33:18 +00:00
|
|
|
|
|
|
|
impl<T> !TestType2<T> {}
|
2017-12-02 19:15:03 +00:00
|
|
|
//~^ ERROR inherent impls cannot be negative
|
2014-12-28 22:33:18 +00:00
|
|
|
|
|
|
|
unsafe impl<T> !Send for TestType2<T> {}
|
2017-12-02 19:15:03 +00:00
|
|
|
//~^ ERROR negative impls cannot be unsafe
|
2014-12-28 22:33:18 +00:00
|
|
|
impl<T> !TestTrait for TestType2<T> {}
|
|
|
|
|
|
|
|
fn main() {}
|