We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49ba323 commit 103771cCopy full SHA for 103771c
src/test/ui/specialization/issue-70442.rs
@@ -0,0 +1,23 @@
1
+#![feature(specialization)]
2
+
3
+// check-pass
4
5
+trait Trait {
6
+ type Assoc;
7
+}
8
9
+impl<T> Trait for T {
10
+ default type Assoc = bool;
11
12
13
+// This impl inherits the `Assoc` definition from above and "locks it in", or finalizes it, making
14
+// child impls unable to further specialize it. However, since the specialization graph didn't
15
+// correctly track this, we would refuse to project `Assoc` from this impl, even though that should
16
+// happen for items that are final.
17
+impl Trait for () {}
18
19
+fn foo<X: Trait<Assoc=bool>>() {}
20
21
+fn main() {
22
+ foo::<()>(); // `<() as Trait>::Assoc` is normalized to `bool` correctly
23
0 commit comments