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