diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2021-10-25 23:33:12 -0500 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2021-11-21 08:15:21 -0600 |
| commit | 9c83f8c4d1e562cd73a29a00828d68e2b520a086 (patch) | |
| tree | a7b824c188a775e1de44c0e9c44dffe2d039c78f /src/test/ui/issues | |
| parent | 3bfde2f1f4fc9409ecb63dfe1370df66171cf861 (diff) | |
| download | rust-9c83f8c4d1e562cd73a29a00828d68e2b520a086.tar.gz rust-9c83f8c4d1e562cd73a29a00828d68e2b520a086.zip | |
Simplify for loop desugar
Diffstat (limited to 'src/test/ui/issues')
| -rw-r--r-- | src/test/ui/issues/issue-20261.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-33941.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-33941.stderr | 12 |
3 files changed, 3 insertions, 14 deletions
diff --git a/src/test/ui/issues/issue-20261.stderr b/src/test/ui/issues/issue-20261.stderr index c6c3f32dfe7..6330364c92b 100644 --- a/src/test/ui/issues/issue-20261.stderr +++ b/src/test/ui/issues/issue-20261.stderr @@ -1,8 +1,8 @@ -error[E0282]: type annotations needed for `&(_,)` +error[E0282]: type annotations needed for `(_,)` --> $DIR/issue-20261.rs:4:11 | LL | for (ref i,) in [].iter() { - | --------- the element type for this iterator is not specified + | --------- this method call resolves to `std::slice::Iter<'_, T>` LL | i.clone(); | ^^^^^ cannot infer type | diff --git a/src/test/ui/issues/issue-33941.rs b/src/test/ui/issues/issue-33941.rs index 4fb805b37e0..ccaa6334856 100644 --- a/src/test/ui/issues/issue-33941.rs +++ b/src/test/ui/issues/issue-33941.rs @@ -3,5 +3,4 @@ use std::collections::HashMap; fn main() { for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch //~^ ERROR type mismatch - //~| ERROR type mismatch } diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr index e7263148205..eb98a3a29a6 100644 --- a/src/test/ui/issues/issue-33941.stderr +++ b/src/test/ui/issues/issue-33941.stderr @@ -23,16 +23,6 @@ LL | for _ in HashMap::new().iter().cloned() {} = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` -error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_` - --> $DIR/issue-33941.rs:4:14 - | -LL | for _ in HashMap::new().iter().cloned() {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found tuple - | - = note: expected reference `&_` - found tuple `(&_, &_)` - = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0271`. |
