]> git.lizzy.rs Git - rust.git/commitdiff
Rename test and add comment
authorAaron Hill <aa1ronham@gmail.com>
Sun, 28 Jul 2019 23:12:04 +0000 (19:12 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Sun, 28 Jul 2019 23:12:27 +0000 (19:12 -0400)
src/test/ui/existential-type/issue-52843-closure-constrain.rs [new file with mode: 0644]
src/test/ui/existential-type/issue-52843-closure-constrain.stderr [new file with mode: 0644]
src/test/ui/existential-type/issue-52843.rs [deleted file]
src/test/ui/existential-type/issue-52843.stderr [deleted file]

diff --git a/src/test/ui/existential-type/issue-52843-closure-constrain.rs b/src/test/ui/existential-type/issue-52843-closure-constrain.rs
new file mode 100644 (file)
index 0000000..b2bbc1f
--- /dev/null
@@ -0,0 +1,12 @@
+// Checks to ensure that we properly detect when a closure constrains an existential type
+#![feature(existential_type)]
+
+use std::fmt::Debug;
+
+fn main() {
+    existential type Existential: Debug;
+    fn _unused() -> Existential { String::new() }
+    //~^ ERROR: concrete type differs from previous defining existential type use
+    let null = || -> Existential { 0 };
+    println!("{:?}", null());
+}
diff --git a/src/test/ui/existential-type/issue-52843-closure-constrain.stderr b/src/test/ui/existential-type/issue-52843-closure-constrain.stderr
new file mode 100644 (file)
index 0000000..424d65a
--- /dev/null
@@ -0,0 +1,20 @@
+error: concrete type differs from previous defining existential type use
+  --> $DIR/issue-52843-closure-constrain.rs:8:5
+   |
+LL |     fn _unused() -> Existential { String::new() }
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, got `std::string::String`
+   |
+note: previous use here
+  --> $DIR/issue-52843-closure-constrain.rs:6:1
+   |
+LL | / fn main() {
+LL | |     existential type Existential: Debug;
+LL | |     fn _unused() -> Existential { String::new() }
+LL | |
+LL | |     let null = || -> Existential { 0 };
+LL | |     println!("{:?}", null());
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/existential-type/issue-52843.rs b/src/test/ui/existential-type/issue-52843.rs
deleted file mode 100644 (file)
index c625909..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#![feature(existential_type)]
-
-use std::fmt::Debug;
-
-fn main() {
-    existential type Existential: Debug;
-    fn _unused() -> Existential { String::new() }
-    //~^ ERROR: concrete type differs from previous defining existential type use
-    let null = || -> Existential { 0 };
-    println!("{:?}", null());
-}
diff --git a/src/test/ui/existential-type/issue-52843.stderr b/src/test/ui/existential-type/issue-52843.stderr
deleted file mode 100644 (file)
index 337e84b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-error: concrete type differs from previous defining existential type use
-  --> $DIR/issue-52843.rs:7:5
-   |
-LL |     fn _unused() -> Existential { String::new() }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, got `std::string::String`
-   |
-note: previous use here
-  --> $DIR/issue-52843.rs:5:1
-   |
-LL | / fn main() {
-LL | |     existential type Existential: Debug;
-LL | |     fn _unused() -> Existential { String::new() }
-LL | |
-LL | |     let null = || -> Existential { 0 };
-LL | |     println!("{:?}", null());
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-