]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/issues/issue-62742.rs
1 use std
::marker
::PhantomData
;
5 //~^ ERROR the trait bound `RawImpl<_>: Raw<_>` is not satisfied
6 WrongImpl
::<()>::foo(0i32);
7 //~^ ERROR the trait bound `RawImpl<()>: Raw<()>` is not satisfied
8 //~| ERROR trait bounds were not satisfied
9 CorrectImpl
::foo(0i32);
12 pub trait Raw
<T
: ?Sized
> {
16 pub type WrongImpl
<T
> = SafeImpl
<T
, RawImpl
<T
>>;
18 pub type CorrectImpl
<T
> = SafeImpl
<[T
], RawImpl
<T
>>;
20 pub struct RawImpl
<T
>(PhantomData
<T
>);
22 impl<T
> Raw
<[T
]> for RawImpl
<T
> {
26 pub struct SafeImpl
<T
: ?Sized
, A
: Raw
<T
>>(PhantomData
<(A
, T
)>);
28 impl<T
: ?Sized
, A
: Raw
<T
>> SafeImpl
<T
, A
> {
29 pub fn foo(value
: A
::Value
) {}