Skip to content

Commit 2425580

Browse files
committed
Allow formatting example/gen_block_iterate.rs
1 parent a2f2943 commit 2425580

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,25 @@
66
#![feature(gen_blocks)]
77

88
fn foo() -> impl Iterator<Item = u32> {
9-
gen { yield 42; for x in 3..6 { yield x } }
9+
gen {
10+
yield 42;
11+
for x in 3..6 {
12+
yield x
13+
}
14+
}
1015
}
1116

1217
fn moved() -> impl Iterator<Item = u32> {
1318
let mut x = "foo".to_string();
1419
gen move {
1520
yield 42;
16-
if x == "foo" { return }
21+
if x == "foo" {
22+
return;
23+
}
1724
x.clear();
18-
for x in 3..6 { yield x }
25+
for x in 3..6 {
26+
yield x
27+
}
1928
}
2029
}
2130

@@ -32,5 +41,4 @@ fn main() {
3241
let mut iter = moved();
3342
assert_eq!(iter.next(), Some(42));
3443
assert_eq!(iter.next(), None);
35-
3644
}

compiler/rustc_codegen_cranelift/rustfmt.toml

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
ignore = [
2-
"example/gen_block_iterate.rs", # uses edition 2024
3-
]
4-
51
# Matches rustfmt.toml of rustc
62
style_edition = "2024"
73
use_small_heuristics = "Max"

rustfmt.toml

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ ignore = [
4949

5050
# These are ignored by a standard cargo fmt run.
5151
"compiler/rustc_codegen_cranelift/scripts",
52-
"compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs", # uses edition 2024
5352
"compiler/rustc_codegen_gcc/tests",
5453
# Code automatically generated and included.
5554
"compiler/rustc_codegen_gcc/src/intrinsic/archs.rs",

0 commit comments

Comments
 (0)