diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-39970.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-39970.rs b/src/test/ui/issues/issue-39970.rs new file mode 100644 index 000000000..f51e3b522 --- /dev/null +++ b/src/test/ui/issues/issue-39970.rs @@ -0,0 +1,21 @@ +trait Array<'a> { + type Element: 'a; +} + +trait Visit { + fn visit() {} +} + +impl<'a> Array<'a> for () { + type Element = &'a (); +} + +impl Visit for () where + //(): for<'a> Array<'a, Element=&'a ()>, // No ICE + (): for<'a> Array<'a, Element=()>, // ICE +{} + +fn main() { + <() as Visit>::visit(); + //~^ ERROR type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()` +} |