summaryrefslogtreecommitdiffstats
path: root/src/test/ui/for
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/for')
-rw-r--r--src/test/ui/for/for-c-in-str.rs14
-rw-r--r--src/test/ui/for/for-c-in-str.stderr12
-rw-r--r--src/test/ui/for/for-expn.rs9
-rw-r--r--src/test/ui/for/for-expn.stderr9
-rw-r--r--src/test/ui/for/for-loop-bogosity.rs21
-rw-r--r--src/test/ui/for/for-loop-bogosity.stderr12
-rw-r--r--src/test/ui/for/for-loop-refutable-pattern-error-message.rs3
-rw-r--r--src/test/ui/for/for-loop-refutable-pattern-error-message.stderr11
-rw-r--r--src/test/ui/for/for-loop-type-error.rs6
-rw-r--r--src/test/ui/for/for-loop-type-error.stderr11
-rw-r--r--src/test/ui/for/for-loop-unconstrained-element-type.rs9
-rw-r--r--src/test/ui/for/for-loop-unconstrained-element-type.stderr14
12 files changed, 0 insertions, 131 deletions
diff --git a/src/test/ui/for/for-c-in-str.rs b/src/test/ui/for/for-c-in-str.rs
deleted file mode 100644
index b086128d2..000000000
--- a/src/test/ui/for/for-c-in-str.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// E0277 should point exclusively at line 6, not the entire for loop span
-
-fn main() {
- for c in "asdf" {
- //~^ ERROR `&str` is not an iterator
- //~| NOTE `&str` is not an iterator
- //~| HELP the trait `Iterator` is not implemented for `&str`
- //~| NOTE required for `&str` to implement `IntoIterator`
- //~| NOTE in this expansion of desugaring of `for` loop
- //~| NOTE in this expansion of desugaring of `for` loop
- //~| NOTE in this expansion of desugaring of `for` loop
- println!();
- }
-}
diff --git a/src/test/ui/for/for-c-in-str.stderr b/src/test/ui/for/for-c-in-str.stderr
deleted file mode 100644
index 959a7c43f..000000000
--- a/src/test/ui/for/for-c-in-str.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0277]: `&str` is not an iterator
- --> $DIR/for-c-in-str.rs:4:14
- |
-LL | for c in "asdf" {
- | ^^^^^^ `&str` is not an iterator; try calling `.chars()` or `.bytes()`
- |
- = help: the trait `Iterator` is not implemented for `&str`
- = note: required for `&str` to implement `IntoIterator`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/for/for-expn.rs b/src/test/ui/for/for-expn.rs
deleted file mode 100644
index b9c4bbeda..000000000
--- a/src/test/ui/for/for-expn.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// Test that an error on a sub-expresson in a for loop has the correct span.
-
-fn main() {
- // Odd formatting to make sure we get the right span.
- for t in &
- foo //~ ERROR cannot find value `foo` in this scope
- {
- }
-}
diff --git a/src/test/ui/for/for-expn.stderr b/src/test/ui/for/for-expn.stderr
deleted file mode 100644
index cdb211555..000000000
--- a/src/test/ui/for/for-expn.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0425]: cannot find value `foo` in this scope
- --> $DIR/for-expn.rs:6:7
- |
-LL | foo
- | ^^^ not found in this scope
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/for/for-loop-bogosity.rs b/src/test/ui/for/for-loop-bogosity.rs
deleted file mode 100644
index 9341dea09..000000000
--- a/src/test/ui/for/for-loop-bogosity.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-struct MyStruct {
- x: isize,
- y: isize,
-}
-
-impl MyStruct {
- fn next(&mut self) -> Option<isize> {
- Some(self.x)
- }
-}
-
-pub fn main() {
- let mut bogus = MyStruct {
- x: 1,
- y: 2,
- };
- for x in bogus {
- //~^ ERROR `MyStruct` is not an iterator
- drop(x);
- }
-}
diff --git a/src/test/ui/for/for-loop-bogosity.stderr b/src/test/ui/for/for-loop-bogosity.stderr
deleted file mode 100644
index 9bf8056e8..000000000
--- a/src/test/ui/for/for-loop-bogosity.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0277]: `MyStruct` is not an iterator
- --> $DIR/for-loop-bogosity.rs:17:14
- |
-LL | for x in bogus {
- | ^^^^^ `MyStruct` is not an iterator
- |
- = help: the trait `Iterator` is not implemented for `MyStruct`
- = note: required for `MyStruct` to implement `IntoIterator`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/for/for-loop-refutable-pattern-error-message.rs b/src/test/ui/for/for-loop-refutable-pattern-error-message.rs
deleted file mode 100644
index 221951c87..000000000
--- a/src/test/ui/for/for-loop-refutable-pattern-error-message.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
- for &1 in [1].iter() {} //~ ERROR refutable pattern in `for` loop binding
-}
diff --git a/src/test/ui/for/for-loop-refutable-pattern-error-message.stderr b/src/test/ui/for/for-loop-refutable-pattern-error-message.stderr
deleted file mode 100644
index 20b689aa5..000000000
--- a/src/test/ui/for/for-loop-refutable-pattern-error-message.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0005]: refutable pattern in `for` loop binding: `&i32::MIN..=0_i32` and `&2_i32..=i32::MAX` not covered
- --> $DIR/for-loop-refutable-pattern-error-message.rs:2:9
- |
-LL | for &1 in [1].iter() {}
- | ^^ patterns `&i32::MIN..=0_i32` and `&2_i32..=i32::MAX` not covered
- |
- = note: the matched value is of type `&i32`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0005`.
diff --git a/src/test/ui/for/for-loop-type-error.rs b/src/test/ui/for/for-loop-type-error.rs
deleted file mode 100644
index 8d9fc20f0..000000000
--- a/src/test/ui/for/for-loop-type-error.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-pub fn main() {
- let x = () + (); //~ ERROR cannot add `()` to `()`
-
- // this shouldn't have a flow-on error:
- for _ in x {}
-}
diff --git a/src/test/ui/for/for-loop-type-error.stderr b/src/test/ui/for/for-loop-type-error.stderr
deleted file mode 100644
index c93a3b9b2..000000000
--- a/src/test/ui/for/for-loop-type-error.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0369]: cannot add `()` to `()`
- --> $DIR/for-loop-type-error.rs:2:16
- |
-LL | let x = () + ();
- | -- ^ -- ()
- | |
- | ()
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0369`.
diff --git a/src/test/ui/for/for-loop-unconstrained-element-type.rs b/src/test/ui/for/for-loop-unconstrained-element-type.rs
deleted file mode 100644
index 0c7a3516a..000000000
--- a/src/test/ui/for/for-loop-unconstrained-element-type.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// Test that `for` loops don't introduce artificial
-// constraints on the type of the binding (`i`).
-// Subtle changes in the desugaring can cause the
-// type of elements in the vector to (incorrectly)
-// fallback to `!` or `()`.
-
-fn main() {
- for i in Vec::new() { } //~ ERROR type annotations needed
-}
diff --git a/src/test/ui/for/for-loop-unconstrained-element-type.stderr b/src/test/ui/for/for-loop-unconstrained-element-type.stderr
deleted file mode 100644
index b1b38f6b9..000000000
--- a/src/test/ui/for/for-loop-unconstrained-element-type.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/for-loop-unconstrained-element-type.rs:8:14
- |
-LL | for i in Vec::new() { }
- | ^^^^^^^^ cannot infer type of the type parameter `T` declared on the struct `Vec`
- |
-help: consider specifying the generic argument
- |
-LL | for i in Vec::<T>::new() { }
- | +++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.