diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-36839.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-36839.rs b/src/test/ui/issues/issue-36839.rs new file mode 100644 index 000000000..ca3d66b1c --- /dev/null +++ b/src/test/ui/issues/issue-36839.rs @@ -0,0 +1,21 @@ +// check-pass + +pub trait Foo { + type Bar; +} + +pub trait Broken { + type Assoc; + fn broken(&self) where Self::Assoc: Foo; +} + +impl<T> Broken for T { + type Assoc = (); + fn broken(&self) where Self::Assoc: Foo { + let _x: <Self::Assoc as Foo>::Bar; + } +} + +fn main() { + let _m: &dyn Broken<Assoc=()> = &(); +} |