|
| 1 | + WARN rustc_errors::emitter Invalid span $SRC_DIR/std/src/macros.rs:LL:COL (#11), error=SourceNotAvailable { filename: Real(Remapped { local_path: None, virtual_name: "$SRC_DIR/std/src/macros.rs" }) } |
| 2 | +warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 |
| 3 | + --> $DIR/macro-expansion-empty-span-147408.rs:18:27 |
| 4 | + | |
| 5 | +LL | for _ in dbg!([1, 2]).into_iter() {} |
| 6 | + | ^^^^^^^^^ |
| 7 | + | |
| 8 | + = warning: this changes meaning in Rust 2021 |
| 9 | + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> |
| 10 | + = note: `#[warn(array_into_iter)]` (part of `#[warn(rust_2021_compatibility)]`) on by default |
| 11 | +help: use `.iter()` instead of `.into_iter()` to avoid ambiguity |
| 12 | + | |
| 13 | +LL - for _ in dbg!([1, 2]).into_iter() {} |
| 14 | +LL + for _ in dbg!([1, 2]).iter() {} |
| 15 | + | |
| 16 | + |
| 17 | +warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<[T; N] as IntoIterator>::into_iter` in Rust 2021 |
| 18 | + --> $DIR/macro-expansion-empty-span-147408.rs:9:16 |
| 19 | + | |
| 20 | +LL | $e.into_iter() |
| 21 | + | ^^^^^^^^^ |
| 22 | +... |
| 23 | +LL | for _ in mac!(into_iter [1, 2]) {} |
| 24 | + | ---------------------- in this macro invocation |
| 25 | + | |
| 26 | + = warning: this changes meaning in Rust 2021 |
| 27 | + = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html> |
| 28 | + = note: this warning originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 29 | +help: use `.iter()` instead of `.into_iter()` to avoid ambiguity |
| 30 | + | |
| 31 | +LL - $e.into_iter() |
| 32 | +LL + $e.iter() |
| 33 | + | |
| 34 | +help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value |
| 35 | + | |
| 36 | +LL | IntoIterator::into_iter($e.into_iter()) |
| 37 | + | ++++++++++++++++++++++++ + |
| 38 | + |
| 39 | +warning: for loop over an `Option`. This is more readably written as an `if let` statement |
| 40 | + --> $DIR/macro-expansion-empty-span-147408.rs:22:14 |
| 41 | + | |
| 42 | +LL | for _ in mac!(next [1, 2]) {} |
| 43 | + | ^^^^^^^^^^^^^^^^^ |
| 44 | + | |
| 45 | + = note: `#[warn(for_loops_over_fallibles)]` on by default |
| 46 | +help: to iterate over `$e.iter()` remove the call to `next` |
| 47 | + | |
| 48 | +LL - $e.iter().next() |
| 49 | +LL + .by_ref().next() |
| 50 | + | |
| 51 | +help: consider using `if let` to clear intent |
| 52 | + | |
| 53 | +LL - for _ in mac!(next [1, 2]) {} |
| 54 | +LL + if let Some(_) = mac!(next [1, 2]) {} |
| 55 | + | |
| 56 | + |
| 57 | +warning: 3 warnings emitted |
| 58 | + |
0 commit comments