]> git.lizzy.rs Git - rust.git/commitdiff
Add a regression test for issue-71443
authorYuki Okushi <huyuumi.dev@gmail.com>
Fri, 9 Oct 2020 09:33:03 +0000 (18:33 +0900)
committerYuki Okushi <huyuumi.dev@gmail.com>
Fri, 9 Oct 2020 09:33:03 +0000 (18:33 +0900)
src/test/ui/associated-type-bounds/issue-71443-1.rs [new file with mode: 0644]
src/test/ui/associated-type-bounds/issue-71443-1.stderr [new file with mode: 0644]
src/test/ui/associated-type-bounds/issue-71443-2.rs [new file with mode: 0644]

diff --git a/src/test/ui/associated-type-bounds/issue-71443-1.rs b/src/test/ui/associated-type-bounds/issue-71443-1.rs
new file mode 100644 (file)
index 0000000..5d2a3e6
--- /dev/null
@@ -0,0 +1,9 @@
+#![feature(associated_type_bounds)]
+
+struct Incorrect;
+
+fn hello<F: for<'a> Iterator<Item: 'a>>() {
+    Incorrect //~ERROR: mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/associated-type-bounds/issue-71443-1.stderr b/src/test/ui/associated-type-bounds/issue-71443-1.stderr
new file mode 100644 (file)
index 0000000..a9459ee
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-71443-1.rs:6:5
+   |
+LL | fn hello<F: for<'a> Iterator<Item: 'a>>() {
+   |                                           - help: try adding a return type: `-> Incorrect`
+LL |     Incorrect
+   |     ^^^^^^^^^ expected `()`, found struct `Incorrect`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/associated-type-bounds/issue-71443-2.rs b/src/test/ui/associated-type-bounds/issue-71443-2.rs
new file mode 100644 (file)
index 0000000..813dcd6
--- /dev/null
@@ -0,0 +1,11 @@
+// check-pass
+
+#![feature(associated_type_bounds)]
+
+fn hello<'b, F>()
+where
+    for<'a> F: Iterator<Item: 'a> + 'b,
+{
+}
+
+fn main() {}