2015-03-30 17:49:30 -04:00
|
|
|
// Test that we are able to introduce a negative constraint that
|
|
|
|
// `MyType: !MyTrait` along with other "fundamental" wrappers.
|
|
|
|
|
|
|
|
//@ aux-build:coherence_copy_like_lib.rs
|
2019-07-03 06:30:28 +09:00
|
|
|
//@ build-pass (FIXME(62277): could be check-pass?)
|
2018-10-31 13:08:01 +01:00
|
|
|
// skip-codgen
|
2015-03-30 17:49:30 -04:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
extern crate coherence_copy_like_lib as lib;
|
|
|
|
|
|
|
|
struct MyType { x: i32 }
|
|
|
|
|
2017-02-25 16:16:27 -05:00
|
|
|
trait MyTrait { fn foo() {} }
|
2015-03-30 17:49:30 -04:00
|
|
|
impl<T: lib::MyCopy> MyTrait for T { }
|
|
|
|
|
|
|
|
// `MyFundamentalStruct` is declared fundamental, so we can test that
|
|
|
|
//
|
|
|
|
// MyFundamentalStruct<MyTrait>: !MyTrait
|
|
|
|
//
|
|
|
|
// Huzzah.
|
|
|
|
impl MyTrait for lib::MyFundamentalStruct<MyType> { }
|
|
|
|
|
2018-10-31 13:08:01 +01:00
|
|
|
|
|
|
|
fn main() { }
|