about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJanusz Marcinkiewicz <virrages@gmail.com>2019-12-03 08:20:17 +0100
committerJanusz Marcinkiewicz <virrages@gmail.com>2019-12-07 08:55:09 +0100
commite305bf8bc8cecaf93080f07962a4f763cd66f5ce (patch)
treede5c674acb13e4eb1cb538837fd53df66c2c3729 /src/test
parentd419a5fdaebb36dbf3c600f624c964d9ea651661 (diff)
downloadrust-e305bf8bc8cecaf93080f07962a4f763cd66f5ce.tar.gz
rust-e305bf8bc8cecaf93080f07962a4f763cd66f5ce.zip
Rename tests and add short test description
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs1
-rw-r--r--src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr19
-rw-r--r--src/test/ui/issues/issue-66923-show-error-for-correct-call.rs (renamed from src/test/ui/issues/issue-66923.rs)6
-rw-r--r--src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr19
-rw-r--r--src/test/ui/issues/issue-66923.stderr19
5 files changed, 38 insertions, 26 deletions
diff --git a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs
index 8397d204f35..7fa059583f5 100644
--- a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs
+++ b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs
@@ -6,6 +6,7 @@ pub fn no_debug() {
 pub fn no_hash() {
     use std::collections::HashSet;
     let mut set = HashSet::new();
+    //~^ ERROR arrays only have std trait implementations for lengths 0..=32
     set.insert([0_usize; 33]);
     //~^ ERROR arrays only have std trait implementations for lengths 0..=32
 }
diff --git a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr
index 594a0d4b5d8..d885c98dcb2 100644
--- a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr
+++ b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr
@@ -8,15 +8,24 @@ LL |     println!("{:?}", [0_usize; 33]);
    = note: required by `std::fmt::Debug::fmt`
 
 error[E0277]: arrays only have std trait implementations for lengths 0..=32
-  --> $DIR/core-traits-no-impls-length-33.rs:9:16
+  --> $DIR/core-traits-no-impls-length-33.rs:10:16
    |
 LL |     set.insert([0_usize; 33]);
    |                ^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
    |
    = note: required because of the requirements on the impl of `std::cmp::Eq` for `[usize; 33]`
 
+error[E0277]: arrays only have std trait implementations for lengths 0..=32
+  --> $DIR/core-traits-no-impls-length-33.rs:8:19
+   |
+LL |     let mut set = HashSet::new();
+   |                   ^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
+   |
+   = note: required because of the requirements on the impl of `std::cmp::Eq` for `[usize; 33]`
+   = note: required by `std::collections::HashSet::<T>::new`
+
 error[E0369]: binary operation `==` cannot be applied to type `[usize; 33]`
-  --> $DIR/core-traits-no-impls-length-33.rs:14:19
+  --> $DIR/core-traits-no-impls-length-33.rs:15:19
    |
 LL |     [0_usize; 33] == [1_usize; 33]
    |     ------------- ^^ ------------- [usize; 33]
@@ -26,7 +35,7 @@ LL |     [0_usize; 33] == [1_usize; 33]
    = note: an implementation of `std::cmp::PartialEq` might be missing for `[usize; 33]`
 
 error[E0369]: binary operation `<` cannot be applied to type `[usize; 33]`
-  --> $DIR/core-traits-no-impls-length-33.rs:19:19
+  --> $DIR/core-traits-no-impls-length-33.rs:20:19
    |
 LL |     [0_usize; 33] < [1_usize; 33]
    |     ------------- ^ ------------- [usize; 33]
@@ -36,7 +45,7 @@ LL |     [0_usize; 33] < [1_usize; 33]
    = note: an implementation of `std::cmp::PartialOrd` might be missing for `[usize; 33]`
 
 error[E0277]: the trait bound `&[usize; 33]: std::iter::IntoIterator` is not satisfied
-  --> $DIR/core-traits-no-impls-length-33.rs:24:14
+  --> $DIR/core-traits-no-impls-length-33.rs:25:14
    |
 LL |     for _ in &[0_usize; 33] {
    |              ^^^^^^^^^^^^^^ the trait `std::iter::IntoIterator` is not implemented for `&[usize; 33]`
@@ -48,7 +57,7 @@ LL |     for _ in &[0_usize; 33] {
              <&'a mut [T] as std::iter::IntoIterator>
    = note: required by `std::iter::IntoIterator::into_iter`
 
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
 
 Some errors have detailed explanations: E0277, E0369.
 For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/issues/issue-66923.rs b/src/test/ui/issues/issue-66923-show-error-for-correct-call.rs
index a452e6384a3..83328073972 100644
--- a/src/test/ui/issues/issue-66923.rs
+++ b/src/test/ui/issues/issue-66923-show-error-for-correct-call.rs
@@ -1,13 +1,15 @@
+// This test checks that errors are showed for lines with `collect` rather than `push` method.
+
 fn main() {
     let v = vec![1_f64, 2.2_f64];
     let mut fft: Vec<Vec<f64>> = vec![];
 
     let x1: &[f64] = &v;
     let x2: Vec<f64> = x1.into_iter().collect();
-    //~^ ERROR a collection of type
+    //~^ ERROR a value of type
     fft.push(x2);
 
     let x3 = x1.into_iter().collect::<Vec<f64>>();
-    //~^ ERROR a collection of type
+    //~^ ERROR a value of type
     fft.push(x3);
 }
diff --git a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr
new file mode 100644
index 00000000000..8e7ee97e0b9
--- /dev/null
+++ b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr
@@ -0,0 +1,19 @@
+error[E0277]: a value of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64`
+  --> $DIR/issue-66923-show-error-for-correct-call.rs:8:39
+   |
+LL |     let x2: Vec<f64> = x1.into_iter().collect();
+   |                                       ^^^^^^^ value of type `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
+   |
+   = help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>`
+
+error[E0277]: a value of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64`
+  --> $DIR/issue-66923-show-error-for-correct-call.rs:12:29
+   |
+LL |     let x3 = x1.into_iter().collect::<Vec<f64>>();
+   |                             ^^^^^^^ value of type `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
+   |
+   = help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/issues/issue-66923.stderr b/src/test/ui/issues/issue-66923.stderr
deleted file mode 100644
index a2eec7caee5..00000000000
--- a/src/test/ui/issues/issue-66923.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: a collection of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64`
-  --> $DIR/issue-66923.rs:6:39
-   |
-LL |     let x2: Vec<f64> = x1.into_iter().collect();
-   |                                       ^^^^^^^ a collection of type `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
-   |
-   = help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>`
-
-error[E0277]: a collection of type `std::vec::Vec<f64>` cannot be built from an iterator over elements of type `&f64`
-  --> $DIR/issue-66923.rs:10:29
-   |
-LL |     let x3 = x1.into_iter().collect::<Vec<f64>>();
-   |                             ^^^^^^^ a collection of type `std::vec::Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
-   |
-   = help: the trait `std::iter::FromIterator<&f64>` is not implemented for `std::vec::Vec<f64>`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.