summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/associated-types-normalize-in-bounds-binding.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/associated-types-normalize-in-bounds-binding.rs')
-rw-r--r--src/test/ui/associated-types/associated-types-normalize-in-bounds-binding.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/associated-types-normalize-in-bounds-binding.rs b/src/test/ui/associated-types/associated-types-normalize-in-bounds-binding.rs
new file mode 100644
index 000000000..7c54efb83
--- /dev/null
+++ b/src/test/ui/associated-types/associated-types-normalize-in-bounds-binding.rs
@@ -0,0 +1,38 @@
+// run-pass
+#![allow(unused_variables)]
+// Test that we normalize associated types that appear in a bound that
+// contains a binding. Issue #21664.
+
+// pretty-expanded FIXME #23616
+
+#![allow(dead_code)]
+
+pub trait Integral {
+ type Opposite;
+}
+
+impl Integral for i32 {
+ type Opposite = u32;
+}
+
+impl Integral for u32 {
+ type Opposite = i32;
+}
+
+pub trait FnLike<A> {
+ type R;
+
+ fn dummy(&self, a: A) -> Self::R { loop { } }
+}
+
+fn foo<T>()
+ where T : FnLike<<i32 as Integral>::Opposite, R=bool>
+{
+ bar::<T>();
+}
+
+fn bar<T>()
+ where T : FnLike<u32, R=bool>
+{}
+
+fn main() { }