]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/trait-suggest-where-clause.rs
8405e5ff62e8ec7cb0e91aa839d7ff9ad2662a41
3 struct Misc
<T
:?Sized
>(T
);
5 fn check
<T
: Iterator
, U
: ?Sized
>() {
6 // suggest a where-clause, if needed
8 //~^ ERROR the size for values of type
10 mem
::size_of
::<Misc
<U
>>();
11 //~^ ERROR the size for values of type
13 // ... even if T occurs as a type parameter
15 <u64 as From
<T
>>::from
;
16 //~^ ERROR `u64: std::convert::From<T>` is not satisfied
18 <u64 as From
<<T
as Iterator
>::Item
>>::from
;
19 //~^ ERROR `u64: std::convert::From<<T as std::iter::Iterator>::Item>` is not satisfied
21 // ... but not if there are inference variables
23 <Misc
<_
> as From
<T
>>::from
;
24 //~^ ERROR `Misc<_>: std::convert::From<T>` is not satisfied
26 // ... and also not if the error is not related to the type
28 mem
::size_of
::<[T
]>();
29 //~^ ERROR the size for values of type
31 mem
::size_of
::<[&U
]>();
32 //~^ ERROR the size for values of type