2015-03-30 21:49:30 +00:00
|
|
|
// aux-build:coherence_copy_like_lib.rs
|
|
|
|
|
|
|
|
// Test that we are able to introduce a negative constraint that
|
|
|
|
// `MyType: !MyTrait` along with other "fundamental" wrappers.
|
|
|
|
|
|
|
|
extern crate coherence_copy_like_lib as lib;
|
|
|
|
|
|
|
|
struct MyType { x: i32 }
|
|
|
|
|
2017-02-25 21:16:27 +00:00
|
|
|
trait MyTrait { fn foo() {} }
|
2015-12-30 05:18:24 +00:00
|
|
|
impl<T: lib::MyCopy> MyTrait for T { }
|
2015-03-30 21:49:30 +00:00
|
|
|
|
|
|
|
// `MyStruct` is not declared fundamental, therefore this would
|
|
|
|
// require that
|
|
|
|
//
|
|
|
|
// MyStruct<MyType>: !MyTrait
|
|
|
|
//
|
|
|
|
// which we cannot approve.
|
2018-12-28 23:11:13 +00:00
|
|
|
impl MyTrait for lib::MyStruct<MyType> { }
|
2019-10-26 15:28:02 +00:00
|
|
|
//~^ ERROR E0119
|
2015-03-30 21:49:30 +00:00
|
|
|
|
|
|
|
fn main() { }
|