Closed
Description
Summary
iter_without_into_iter
fires on external macros.
Lint Name
iter_without_into_iter
Reproducer
I tried this code with bitflags version 2.3.2 (note that later versions may not reproduce the lint):
#![warn(clippy::pedantic)]
bitflags::bitflags! {
pub struct HttpComponents: u16 {
const REQUEST_RESPONSE = 1 << 0;
}
}
I saw this happen:
warning: `iter` method without an `IntoIterator` impl for `&$BitFlags`
--> src/main.rs:4:1
|
4 | / bitflags! {
5 | | /// Configuration for HTTP metadata fields.
6 | | #[derive(Copy, Clone)]
7 | | pub struct HttpComponents: u16 {
... |
18 | | }
19 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_without_into_iter
= note: this warning originates in the macro `__impl_public_bitflags_iter` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
I expected to see this happen: No warning, because this is not code I can change.
Version
clippy 0.1.75 (82e1608d 2023-12-21)
rustc 1.75.0 (82e1608df 2023-12-21)
Additional Labels
No response