]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-33941.stderr
Auto merge of #104334 - compiler-errors:ufcs-sugg-wrong-def-id, r=estebank
[rust.git] / src / test / ui / issues / issue-33941.stderr
1 error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
2   --> $DIR/issue-33941.rs:6:36
3    |
4 LL |     for _ in HashMap::new().iter().cloned() {}
5    |                                    ^^^^^^ expected reference, found tuple
6    |
7    = note: expected reference `&_`
8                   found tuple `(&_, &_)`
9 note: the method call chain might not have had the expected associated types
10   --> $DIR/issue-33941.rs:6:29
11    |
12 LL |     for _ in HashMap::new().iter().cloned() {}
13    |              -------------- ^^^^^^ `Iterator::Item` is `(&_, &_)` here
14    |              |
15    |              this expression has type `HashMap<_, _>`
16 note: required by a bound in `cloned`
17   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
18
19 error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
20   --> $DIR/issue-33941.rs:6:14
21    |
22 LL |     for _ in HashMap::new().iter().cloned() {}
23    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference
24    |
25    = note:  expected tuple `(&_, &_)`
26            found reference `&_`
27    = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `Iterator`
28    = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `IntoIterator`
29
30 error[E0271]: expected `Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
31   --> $DIR/issue-33941.rs:6:14
32    |
33 LL |     for _ in HashMap::new().iter().cloned() {}
34    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found reference
35    |
36    = note:  expected tuple `(&_, &_)`
37            found reference `&_`
38    = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `Iterator`
39
40 error: aborting due to 3 previous errors
41
42 For more information about this error, try `rustc --explain E0271`.