1
Fork 0

Rollup merge of #139214 - bjorn3:edition_2024_rustfmt, r=compiler-errors

Tell rustfmt to use the 2024 edition in ./x.py fmt

Most crates in this repo have been moved to the 2024 edition already. This also allows removing a rustfmt exclusion for a cg_clif test.
This commit is contained in:
Stuart Cook 2025-04-02 13:10:42 +11:00 committed by GitHub
commit 82f04468e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 33 additions and 30 deletions

View file

@ -6,16 +6,25 @@
#![feature(gen_blocks)]
fn foo() -> impl Iterator<Item = u32> {
gen { yield 42; for x in 3..6 { yield x } }
gen {
yield 42;
for x in 3..6 {
yield x
}
}
}
fn moved() -> impl Iterator<Item = u32> {
let mut x = "foo".to_string();
gen move {
yield 42;
if x == "foo" { return }
if x == "foo" {
return;
}
x.clear();
for x in 3..6 { yield x }
for x in 3..6 {
yield x
}
}
}
@ -32,5 +41,4 @@ fn main() {
let mut iter = moved();
assert_eq!(iter.next(), Some(42));
assert_eq!(iter.next(), None);
}

View file

@ -1,7 +1,3 @@
ignore = [
"example/gen_block_iterate.rs", # uses edition 2024
]
# Matches rustfmt.toml of rustc
style_edition = "2024"
use_small_heuristics = "Max"