We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ab2ee50 + 111ebbf commit 3d3acfeCopy full SHA for 3d3acfe
tests/ui/associated-type.rs
@@ -0,0 +1,18 @@
1
+use inherent::inherent;
2
+
3
+pub trait Trait {
4
+ type Assoc;
5
+ fn f() -> Self::Assoc;
6
+}
7
8
+pub struct Struct;
9
10
+#[inherent]
11
+impl Trait for Struct {
12
+ type Assoc = ();
13
14
+ // TODO: https://github.com/dtolnay/inherent/issues/15
15
+ fn f() -> Self::Assoc {}
16
17
18
+fn main() {}
tests/ui/associated-type.stderr
@@ -0,0 +1,5 @@
+error[E0223]: ambiguous associated type
+ --> tests/ui/associated-type.rs:15:15
+ |
+15 | fn f() -> Self::Assoc {}
+ | ^^^^^^^^^^^ help: use the fully-qualified path: `<Struct as Trait>::Assoc`
0 commit comments