Skip to content

Commit efc57fb

Browse files
committed
add test for ice #90691 ICE: resolution failed during building vtable representation
Fixes #90691
1 parent 3c1db06 commit efc57fb

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// ICE #90691 Encountered error `Unimplemented` selecting ...
2+
//@ build-pass
3+
4+
trait TError: std::fmt::Debug {}
5+
impl TError for () {}
6+
7+
trait SuperTrait {
8+
type Error;
9+
}
10+
11+
trait Trait: SuperTrait<Error: TError> {}
12+
13+
impl<T> Trait for T
14+
where
15+
T: SuperTrait,
16+
<T as SuperTrait>::Error: TError,
17+
{
18+
}
19+
20+
struct SomeTrait<S>(S);
21+
struct BoxedTrait(Box<dyn Trait<Error = ()>>);
22+
23+
impl<S: 'static> From<SomeTrait<S>> for BoxedTrait {
24+
fn from(other: SomeTrait<S>) -> Self {
25+
Self(Box::new(other))
26+
}
27+
}
28+
29+
impl<S> SuperTrait for SomeTrait<S> {
30+
type Error = ();
31+
}
32+
33+
impl From<()> for BoxedTrait {
34+
fn from(c: ()) -> Self {
35+
Self::from(SomeTrait(c))
36+
}
37+
}
38+
39+
fn main() {
40+
let _: BoxedTrait = ().into();
41+
}

0 commit comments

Comments
 (0)