]> git.proxmox.com Git - rustc.git/blame - src/test/ui/impl-trait/negative-reasoning.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / impl-trait / negative-reasoning.rs
CommitLineData
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
8trait OpaqueTrait {}
9impl<T> OpaqueTrait for T {}
e74abb32 10type OpaqueType = impl OpaqueTrait;
f035d41b
XL
11fn mk_opaque() -> OpaqueType {
12 ()
13}
e74abb32
XL
14
15#[derive(Debug)]
16struct D<T>(T);
17
f035d41b
XL
18trait AnotherTrait {}
19impl<T: std::fmt::Debug> AnotherTrait for T {}
e74abb32
XL
20
21// This is in error, because we cannot assume that `OpaqueType: !Debug`
22impl AnotherTrait for D<OpaqueType> {
f035d41b 23 //~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
e74abb32
XL
24}
25
26fn main() {}