about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-10-18 15:48:48 -0400
committerNiko Matsakis <niko@alum.mit.edu>2018-10-19 09:34:28 -0400
commit9a7bb0ef249258aacf144d04f5d437ba70533128 (patch)
tree96657ab509a45e40af4d17261b53244a67d1293c /src/test
parentf5cc7dba8a32c1f83f3b3102f398405dc540841f (diff)
normalize the self-type that we extract from impl
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/nll/user-annotations/normalize-self-ty.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/nll/user-annotations/normalize-self-ty.rs b/src/test/ui/nll/user-annotations/normalize-self-ty.rs
new file mode 100644
index 00000000000..d97cc88dd9a
--- /dev/null
+++ b/src/test/ui/nll/user-annotations/normalize-self-ty.rs
@@ -0,0 +1,25 @@
+// Regression test for #55183: check a case where the self type from
+// the inherent impl requires normalization to be equal to the
+// user-provided type.
+//
+// run-pass
+
+#![feature(nll)]
+
+trait Mirror {
+    type Me;
+}
+
+impl<T> Mirror for T {
+    type Me = T;
+}
+
+struct Foo<A, B>(A, B);
+
+impl<A> Foo<A, <A as Mirror>::Me> {
+    fn m(b: A) { }
+}
+
+fn main() {
+    <Foo<&'static u32, &u32>>::m(&22);
+}