summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/print
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/closures/print')
-rw-r--r--src/test/ui/closures/print/closure-print-generic-1.rs23
-rw-r--r--src/test/ui/closures/print/closure-print-generic-1.stderr20
-rw-r--r--src/test/ui/closures/print/closure-print-generic-2.rs13
-rw-r--r--src/test/ui/closures/print/closure-print-generic-2.stderr20
-rw-r--r--src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.rs16
-rw-r--r--src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr20
-rw-r--r--src/test/ui/closures/print/closure-print-generic-verbose-1.rs24
-rw-r--r--src/test/ui/closures/print/closure-print-generic-verbose-1.stderr20
-rw-r--r--src/test/ui/closures/print/closure-print-generic-verbose-2.rs16
-rw-r--r--src/test/ui/closures/print/closure-print-generic-verbose-2.stderr20
-rw-r--r--src/test/ui/closures/print/closure-print-verbose.rs12
-rw-r--r--src/test/ui/closures/print/closure-print-verbose.stderr19
12 files changed, 0 insertions, 223 deletions
diff --git a/src/test/ui/closures/print/closure-print-generic-1.rs b/src/test/ui/closures/print/closure-print-generic-1.rs
deleted file mode 100644
index 504b4adbe..000000000
--- a/src/test/ui/closures/print/closure-print-generic-1.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-fn to_fn_once<F: FnOnce()>(f: F) -> F {
- f
-}
-
-fn f<T: std::fmt::Display>(y: T) {
- struct Foo<U: std::fmt::Display> {
- x: U,
- };
-
- let foo = Foo { x: "x" };
-
- let c = to_fn_once(move || {
- println!("{} {}", foo.x, y);
- });
-
- c();
- c();
- //~^ ERROR use of moved value
-}
-
-fn main() {
- f("S");
-}
diff --git a/src/test/ui/closures/print/closure-print-generic-1.stderr b/src/test/ui/closures/print/closure-print-generic-1.stderr
deleted file mode 100644
index b21734f02..000000000
--- a/src/test/ui/closures/print/closure-print-generic-1.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0382]: use of moved value: `c`
- --> $DIR/closure-print-generic-1.rs:17:5
- |
-LL | let c = to_fn_once(move || {
- | - move occurs because `c` has type `[closure@$DIR/closure-print-generic-1.rs:12:24: 12:31]`, which does not implement the `Copy` trait
-...
-LL | c();
- | --- `c` moved due to this call
-LL | c();
- | ^ value used here after move
- |
-note: this value implements `FnOnce`, which causes it to be moved when called
- --> $DIR/closure-print-generic-1.rs:16:5
- |
-LL | c();
- | ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0382`.
diff --git a/src/test/ui/closures/print/closure-print-generic-2.rs b/src/test/ui/closures/print/closure-print-generic-2.rs
deleted file mode 100644
index 3f77fd26b..000000000
--- a/src/test/ui/closures/print/closure-print-generic-2.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-mod mod1 {
- pub fn f<T: std::fmt::Display>(t: T) {
- let x = 20;
-
- let c = || println!("{} {}", t, x);
- let c1: () = c;
- //~^ ERROR mismatched types
- }
-}
-
-fn main() {
- mod1::f(5i32);
-}
diff --git a/src/test/ui/closures/print/closure-print-generic-2.stderr b/src/test/ui/closures/print/closure-print-generic-2.stderr
deleted file mode 100644
index e53277a93..000000000
--- a/src/test/ui/closures/print/closure-print-generic-2.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/closure-print-generic-2.rs:6:22
- |
-LL | let c = || println!("{} {}", t, x);
- | -- the found closure
-LL | let c1: () = c;
- | -- ^ expected `()`, found closure
- | |
- | expected due to this
- |
- = note: expected unit type `()`
- found closure `[closure@$DIR/closure-print-generic-2.rs:5:17: 5:19]`
-help: use parentheses to call this closure
- |
-LL | let c1: () = c();
- | ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.rs b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.rs
deleted file mode 100644
index 07bf8fe4c..000000000
--- a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// compile-flags: -Ztrim-diagnostic-paths=off -Zverbose
-
-mod mod1 {
- pub fn f<T: std::fmt::Display>(t: T)
- {
- let x = 20;
-
- let c = || println!("{} {}", t, x);
- let c1 : () = c;
- //~^ ERROR mismatched types
- }
-}
-
-fn main() {
- mod1::f(5i32);
-}
diff --git a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr
deleted file mode 100644
index ff89dd340..000000000
--- a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/closure-print-generic-trim-off-verbose-2.rs:9:23
- |
-LL | let c = || println!("{} {}", t, x);
- | -- the found closure
-LL | let c1 : () = c;
- | -- ^ expected `()`, found closure
- | |
- | expected due to this
- |
- = note: expected unit type `()`
- found closure `[mod1::f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
-help: use parentheses to call this closure
- |
-LL | let c1 : () = c();
- | ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-1.rs b/src/test/ui/closures/print/closure-print-generic-verbose-1.rs
deleted file mode 100644
index 67d37f1c5..000000000
--- a/src/test/ui/closures/print/closure-print-generic-verbose-1.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// compile-flags: -Zverbose
-
-fn to_fn_once<F:FnOnce()>(f: F) -> F { f }
-
-fn f<T: std::fmt::Display>(y: T) {
- struct Foo<U: std::fmt::Display> {
- x: U
- };
-
- let foo = Foo{ x: "x" };
-
- let c = to_fn_once(move|| {
- println!("{} {}", foo.x, y);
- });
-
- c();
- c();
- //~^ ERROR use of moved value
-}
-
-
-fn main() {
- f("S");
-}
diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr b/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr
deleted file mode 100644
index 3ab7c66d1..000000000
--- a/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0382]: use of moved value: `c`
- --> $DIR/closure-print-generic-verbose-1.rs:17:5
- |
-LL | let c = to_fn_once(move|| {
- | - move occurs because `c` has type `[f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'_#9r str>, T)]`, which does not implement the `Copy` trait
-...
-LL | c();
- | --- `c` moved due to this call
-LL | c();
- | ^ value used here after move
- |
-note: this value implements `FnOnce`, which causes it to be moved when called
- --> $DIR/closure-print-generic-verbose-1.rs:16:5
- |
-LL | c();
- | ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0382`.
diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-2.rs b/src/test/ui/closures/print/closure-print-generic-verbose-2.rs
deleted file mode 100644
index f460fedff..000000000
--- a/src/test/ui/closures/print/closure-print-generic-verbose-2.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// compile-flags: -Zverbose
-
-mod mod1 {
- pub fn f<T: std::fmt::Display>(t: T)
- {
- let x = 20;
-
- let c = || println!("{} {}", t, x);
- let c1 : () = c;
- //~^ ERROR mismatched types
- }
-}
-
-fn main() {
- mod1::f(5i32);
-}
diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr b/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr
deleted file mode 100644
index 5bbf84f96..000000000
--- a/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/closure-print-generic-verbose-2.rs:9:23
- |
-LL | let c = || println!("{} {}", t, x);
- | -- the found closure
-LL | let c1 : () = c;
- | -- ^ expected `()`, found closure
- | |
- | expected due to this
- |
- = note: expected unit type `()`
- found closure `[f<T>::{closure#0} closure_substs=(unavailable) substs=[T, _#16t, extern "rust-call" fn(()), _#15t]]`
-help: use parentheses to call this closure
- |
-LL | let c1 : () = c();
- | ++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/closures/print/closure-print-verbose.rs b/src/test/ui/closures/print/closure-print-verbose.rs
deleted file mode 100644
index 4b0438a91..000000000
--- a/src/test/ui/closures/print/closure-print-verbose.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// compile-flags: -Zverbose
-
-// Same as closure-coerce-fn-1.rs
-
-// Ensure that capturing closures are never coerced to fns
-// Especially interesting as non-capturing closures can be.
-
-fn main() {
- let mut a = 0u8;
- let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
- //~^ ERROR mismatched types
-}
diff --git a/src/test/ui/closures/print/closure-print-verbose.stderr b/src/test/ui/closures/print/closure-print-verbose.stderr
deleted file mode 100644
index 083717b33..000000000
--- a/src/test/ui/closures/print/closure-print-verbose.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/closure-print-verbose.rs:10:29
- |
-LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
- | ------------ ^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found closure
- | |
- | expected due to this
- |
- = note: expected fn pointer `fn(u8) -> u8`
- found closure `[main::{closure#0} closure_substs=(unavailable) substs=[i8, extern "rust-call" fn((u8,)) -> u8, _#6t]]`
-note: closures can only be coerced to `fn` types if they do not capture any variables
- --> $DIR/closure-print-verbose.rs:10:39
- |
-LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a };
- | ^ `a` captured here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.