about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2019-10-04 14:21:12 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2019-10-04 14:21:12 +0200
commit6dd86b411f08b3287ea565b41582641d496b66bf (patch)
tree3c6d3db17c41cc256dbbc6d78deac4f6e654f6d0
parentc59d33a063c34cf2b5da440947acb158b3755b99 (diff)
downloadrust-6dd86b411f08b3287ea565b41582641d496b66bf.tar.gz
rust-6dd86b411f08b3287ea565b41582641d496b66bf.zip
Regression test for #63154.
-rw-r--r--src/test/ui/nll/issue-63154-normalize.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/ui/nll/issue-63154-normalize.rs b/src/test/ui/nll/issue-63154-normalize.rs
new file mode 100644
index 00000000000..2c18dc5d8e0
--- /dev/null
+++ b/src/test/ui/nll/issue-63154-normalize.rs
@@ -0,0 +1,34 @@
+// Regression test for rust-lang/rust#63154
+//
+// Before, we would ICE after faiing to normalize the destination type
+// when checking call destinations and also when checking MIR
+// assignment statements.
+
+// check-pass
+
+trait HasAssocType {
+    type Inner;
+}
+
+impl HasAssocType for () {
+    type Inner = ();
+}
+
+trait Tr<I, T>: Fn(I) -> Option<T> {}
+impl<I, T, Q: Fn(I) -> Option<T>> Tr<I, T> for Q {}
+
+fn f<T: HasAssocType>() -> impl Tr<T, T::Inner> {
+    |_| None
+}
+
+fn g<T, Y>(f: impl Tr<T, Y>) -> impl Tr<T, Y> {
+    f
+}
+
+fn h() {
+    g(f())(());
+}
+
+fn main() {
+    h();
+}