]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/trait-suggest-where-clause.rs
1 // ignore-x86 FIXME: missing sysroot spans (#53081)
4 struct Misc
<T
:?Sized
>(T
);
6 fn check
<T
: Iterator
, U
: ?Sized
>() {
7 // suggest a where-clause, if needed
9 //~^ ERROR the size for values of type
11 mem
::size_of
::<Misc
<U
>>();
12 //~^ ERROR the size for values of type
14 // ... even if T occurs as a type parameter
16 <u64 as From
<T
>>::from
;
17 //~^ ERROR `u64: std::convert::From<T>` is not satisfied
19 <u64 as From
<<T
as Iterator
>::Item
>>::from
;
20 //~^ ERROR `u64: std::convert::From<<T as std::iter::Iterator>::Item>` is not satisfied
22 // ... but not if there are inference variables
24 <Misc
<_
> as From
<T
>>::from
;
25 //~^ ERROR `Misc<_>: std::convert::From<T>` is not satisfied
27 // ... and also not if the error is not related to the type
29 mem
::size_of
::<[T
]>();
30 //~^ ERROR the size for values of type
32 mem
::size_of
::<[&U
]>();
33 //~^ ERROR the size for values of type