Skip to content

Commit aba0bed

Browse files
authored
Rollup merge of #86349 - yerke:add-test-for-issue-78632, r=Mark-Simulacrum
Add regression test for issue #78632 Add regression test for issue #78632 Closes #78632 Took this test from #78632 (what was committed to glacier in #78632 (comment)). Tested that the we get ICE on 1.52.1 on the playground (https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b86d51fee4cded9d24b50d8ecbc48c6a).
2 parents 58e7411 + 782824c commit aba0bed

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

src/test/ui/traits/issue-78632.rs

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// check-pass
2+
//
3+
// Regression test for issue #78632
4+
5+
#![crate_type = "lib"]
6+
7+
pub trait Corge<T> {
8+
type Fred;
9+
}
10+
11+
impl Corge<u8> for () {
12+
type Fred = u32;
13+
}
14+
15+
pub trait Waldo {
16+
type Quax;
17+
}
18+
19+
impl Waldo for u32 {
20+
type Quax = u8;
21+
}
22+
23+
pub trait Grault
24+
where
25+
(): Corge<Self::Thud>,
26+
{
27+
type Thud;
28+
fn bar(_: <() as Corge<Self::Thud>>::Fred) {}
29+
}
30+
31+
impl<T> Grault for T
32+
where
33+
T: Waldo,
34+
(): Corge<T::Quax>,
35+
<() as Corge<T::Quax>>::Fred: Waldo,
36+
{
37+
type Thud = u8;
38+
}
39+
40+
pub trait Plugh<I> {
41+
fn baz();
42+
}
43+
44+
#[derive(Copy, Clone, Debug)]
45+
pub struct Qiz<T> {
46+
foo: T,
47+
}
48+
49+
impl<T> Plugh<<() as Corge<T::Thud>>::Fred> for Qiz<T>
50+
where
51+
T: Grault,
52+
(): Corge<T::Thud>,
53+
{
54+
fn baz() {}
55+
}
56+
57+
pub fn test() {
58+
<Qiz<u32> as Plugh<u32>>::baz();
59+
}

0 commit comments

Comments
 (0)