]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/traits/object/with-self-in-projection-output-bad.rs
1 // Regression test for #56288. Checks that if a supertrait defines an associated type
2 // projection that references `Self`, then that associated type must still be explicitly
3 // specified in the `dyn Trait` variant, since we don't know what `Self` is anymore.
9 trait Helper
: Base
<Output
=<Self as Helper
>::Target
> {
27 impl<T
: ?Sized
> ConstI32
for T
{
31 // Test that you still need to manually give a projection type if the Output type
33 trait NormalizableHelper
:
34 Base
<Output
=<Self as ConstI32
>::Out
>
39 impl NormalizableHelper
for u32
45 let _x
: Box
<dyn Helper
<Target
=i32>> = Box
::new(2u32);
46 //~^ ERROR the value of the associated type `Output` (from trait `Base`) must be specified
48 let _y
: Box
<dyn NormalizableHelper
<Target
=i32>> = Box
::new(2u32);
49 //~^ ERROR the value of the associated type `Output` (from trait `Base`) must be specified