diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-26 00:46:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-26 00:46:25 +0100 |
| commit | fa10a21bd26cf5031c0ca878587839b9296629eb (patch) | |
| tree | c26170f0b46427d20f17498138be36d27f179ff9 /library/core/src | |
| parent | f840799385961b3e047a43af3f44b299f16277df (diff) | |
| parent | 99344a8b3231925bc52190b7e9c18a597c54ca90 (diff) | |
| download | rust-fa10a21bd26cf5031c0ca878587839b9296629eb.tar.gz rust-fa10a21bd26cf5031c0ca878587839b9296629eb.zip | |
Rollup merge of #107890 - obeis:mapping-to-unit, r=cjgillot
Lint against `Iterator::map` receiving a callable that returns `()` Close #106991
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/iter/mod.rs | 1 | ||||
| -rw-r--r-- | library/core/src/iter/traits/iterator.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/iter/mod.rs b/library/core/src/iter/mod.rs index 156b925de77..ae00232c12c 100644 --- a/library/core/src/iter/mod.rs +++ b/library/core/src/iter/mod.rs @@ -278,6 +278,7 @@ //! //! ``` //! # #![allow(unused_must_use)] +//! # #![cfg_attr(not(bootstrap), allow(map_unit_fn))] //! let v = vec![1, 2, 3, 4, 5]; //! v.iter().map(|x| println!("{x}")); //! ``` diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index b3a630d9559..b8e7d0a68da 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -789,6 +789,7 @@ pub trait Iterator { /// println!("{x}"); /// } /// ``` + #[rustc_diagnostic_item = "IteratorMap"] #[inline] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_do_not_const_check] |
