Skip to content

Commit ee6efaf

Browse files
Fix libcore too
1 parent f08c43a commit ee6efaf

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

library/core/src/iter/sources/once_with.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ use crate::iter::{FusedIterator, TrustedLen};
5858
/// ```
5959
#[inline]
6060
#[stable(feature = "iter_once_with", since = "1.43.0")]
61-
pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> {
62-
OnceWith { gen: Some(gen) }
61+
pub fn once_with<A, F: FnOnce() -> A>(generate: F) -> OnceWith<F> {
62+
OnceWith { generate: Some(generate) }
6363
}
6464

6565
/// An iterator that yields a single element of type `A` by
@@ -70,13 +70,13 @@ pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> {
7070
#[derive(Clone)]
7171
#[stable(feature = "iter_once_with", since = "1.43.0")]
7272
pub struct OnceWith<F> {
73-
gen: Option<F>,
73+
generate: Option<F>,
7474
}
7575

7676
#[stable(feature = "iter_once_with_debug", since = "1.68.0")]
7777
impl<F> fmt::Debug for OnceWith<F> {
7878
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
79-
if self.gen.is_some() {
79+
if self.generate.is_some() {
8080
f.write_str("OnceWith(Some(_))")
8181
} else {
8282
f.write_str("OnceWith(None)")
@@ -90,13 +90,13 @@ impl<A, F: FnOnce() -> A> Iterator for OnceWith<F> {
9090

9191
#[inline]
9292
fn next(&mut self) -> Option<A> {
93-
let f = self.gen.take()?;
93+
let f = self.generate.take()?;
9494
Some(f())
9595
}
9696

9797
#[inline]
9898
fn size_hint(&self) -> (usize, Option<usize>) {
99-
self.gen.iter().size_hint()
99+
self.generate.iter().size_hint()
100100
}
101101
}
102102

@@ -110,7 +110,7 @@ impl<A, F: FnOnce() -> A> DoubleEndedIterator for OnceWith<F> {
110110
#[stable(feature = "iter_once_with", since = "1.43.0")]
111111
impl<A, F: FnOnce() -> A> ExactSizeIterator for OnceWith<F> {
112112
fn len(&self) -> usize {
113-
self.gen.iter().len()
113+
self.generate.iter().len()
114114
}
115115
}
116116

src/bootstrap/src/core/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,9 @@ impl<'a> Builder<'a> {
19761976
// some code doesn't go through this `rustc` wrapper.
19771977
lint_flags.push("-Wrust_2018_idioms");
19781978
lint_flags.push("-Wunused_lifetimes");
1979+
// FIXME(edition_2024): Change this to `-Wrust_2024_idioms` when all
1980+
// of the individual lints are satisfied.
1981+
lint_flags.push("-Wkeyword_idents_2024");
19791982

19801983
if self.config.deny_warnings {
19811984
lint_flags.push("-Dwarnings");
@@ -1998,9 +2001,6 @@ impl<'a> Builder<'a> {
19982001
if mode == Mode::Rustc {
19992002
rustflags.arg("-Zunstable-options");
20002003
rustflags.arg("-Wrustc::internal");
2001-
// FIXME(edition_2024): Change this to `-Wrust_2018_idioms` when all
2002-
// of the individual lints are satisfied.
2003-
rustflags.arg("-Wkeyword_idents_2024");
20042004
}
20052005

20062006
if self.config.rust_frame_pointers {

0 commit comments

Comments
 (0)