]>
Commit | Line | Data |
---|---|---|
e74abb32 XL |
1 | // Tests that we cannot assume that an opaque type does *not* implement some |
2 | // other trait | |
6a06907d XL |
3 | // revisions: min_tait full_tait |
4 | #![feature(min_type_alias_impl_trait)] | |
5 | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] | |
6 | //[full_tait]~^ WARN incomplete | |
e74abb32 | 7 | |
f035d41b XL |
8 | trait OpaqueTrait {} |
9 | impl<T> OpaqueTrait for T {} | |
e74abb32 | 10 | type OpaqueType = impl OpaqueTrait; |
f035d41b XL |
11 | fn mk_opaque() -> OpaqueType { |
12 | () | |
13 | } | |
e74abb32 XL |
14 | |
15 | #[derive(Debug)] | |
16 | struct D<T>(T); | |
17 | ||
f035d41b XL |
18 | trait AnotherTrait {} |
19 | impl<T: std::fmt::Debug> AnotherTrait for T {} | |
e74abb32 XL |
20 | |
21 | // This is in error, because we cannot assume that `OpaqueType: !Debug` | |
22 | impl AnotherTrait for D<OpaqueType> { | |
f035d41b | 23 | //~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>` |
e74abb32 XL |
24 | } |
25 | ||
26 | fn main() {} |