diff --git a/tests/ui/associated-type-bounds/resolution-failure-building-vtable-representation-ice-90691.rs b/tests/ui/associated-type-bounds/resolution-failure-building-vtable-representation-ice-90691.rs new file mode 100644 index 00000000000..33776809a79 --- /dev/null +++ b/tests/ui/associated-type-bounds/resolution-failure-building-vtable-representation-ice-90691.rs @@ -0,0 +1,41 @@ +// ICE #90691 Encountered error `Unimplemented` selecting ... +//@ build-pass + +trait TError: std::fmt::Debug {} +impl TError for () {} + +trait SuperTrait { + type Error; +} + +trait Trait: SuperTrait {} + +impl Trait for T +where + T: SuperTrait, + ::Error: TError, +{ +} + +struct SomeTrait(S); +struct BoxedTrait(Box>); + +impl From> for BoxedTrait { + fn from(other: SomeTrait) -> Self { + Self(Box::new(other)) + } +} + +impl SuperTrait for SomeTrait { + type Error = (); +} + +impl From<()> for BoxedTrait { + fn from(c: ()) -> Self { + Self::from(SomeTrait(c)) + } +} + +fn main() { + let _: BoxedTrait = ().into(); +}