]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/for-loop-bad-item.stderr
Rollup merge of #105555 - krasimirgg:llvm-int-opt-2, r=cuviper
[rust.git] / src / test / ui / pattern / for-loop-bad-item.stderr
1 error[E0308]: mismatched types
2   --> $DIR/for-loop-bad-item.rs:7:19
3    |
4 LL |     for ((_, _), (&mut c, _)) in &mut map {
5    |                   ^^^^^^         -------- this is an iterator with items of type `(&(char, char), &mut (char, char))`
6    |                   |
7    |                   expected `char`, found `&mut _`
8    |
9    = note:           expected type `char`
10            found mutable reference `&mut _`
11 note: to declare a mutable binding use: `mut c`
12   --> $DIR/for-loop-bad-item.rs:7:19
13    |
14 LL |     for ((_, _), (&mut c, _)) in &mut map {
15    |                   ^^^^^^
16 help: consider removing `&mut` from the pattern
17    |
18 LL -     for ((_, _), (&mut c, _)) in &mut map {
19 LL +     for ((_, _), (c, _)) in &mut map {
20    |
21
22 error[E0308]: mismatched types
23   --> $DIR/for-loop-bad-item.rs:14:14
24    |
25 LL |     for Some(Qux(_)) | None in [Some(""), None] {
26    |              ^^^^^^            ---------------- this is an iterator with items of type `Option<&str>`
27    |              |
28    |              expected `str`, found struct `Qux`
29
30 error: aborting due to 2 previous errors
31
32 For more information about this error, try `rustc --explain E0308`.