Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compiler warning on array.into_iter() #479

Merged
merged 1 commit into from
Sep 22, 2020

Conversation

dmitris
Copy link
Contributor

@dmitris dmitris commented Sep 20, 2020

Fix the compile warnings listed below by changing into_iter() invocation to iter()
in the impl_zip_iter macro as recommended in rust-lang/rust#66145.
For additional background, see also rust-lang/rust#65819 and rust-lang/rust#66017 (the latter is the linter change producing the warning).

$ cargo build
   Compiling itertools v0.9.0 (/Users/dsavints/dev/hack/github.com/rust-itertools/itertools)
warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
   --> src/ziptuple.rs:111:47
    |
111 |                 let size = *[$( $B.len(), )*].into_iter().min().unwrap();
    |                                               ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
...
128 | impl_zip_iter!(A);
    | ------------------ in this macro invocation
    |
    = note: `#[warn(array_into_iter)]` on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
   --> src/ziptuple.rs:111:47
    |
111 |                 let size = *[$( $B.len(), )*].into_iter().min().unwrap();
    |                                               ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
...
129 | impl_zip_iter!(A, B);
    | --------------------- in this macro invocation
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

@phimuemue
Copy link
Member

Looks good to me.

Thanks for keeping the formatting as is. Could you even sqash the commits into one?

@jswrenn I'd risk merging this even with CI failing, as CI nightly problems seem unrelated.

Change into_iter() to iter() in impl_zip_iter macro
to avoid the compliation warning related to
s://github.com/rust-lang/rust/issues/66145.
@dmitris
Copy link
Contributor Author

dmitris commented Sep 20, 2020

Could you even squash the commits into one?

done

@jswrenn
Copy link
Member

jswrenn commented Sep 22, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 22, 2020

Build succeeded:

@bors bors bot merged commit af54286 into rust-itertools:master Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants