This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
compiler/rustc_codegen_cranelift Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 66#![ feature( gen_blocks) ]
77
88fn 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
1217fn 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}
Original file line number Diff line number Diff line change 1- ignore = [
2- " example/gen_block_iterate.rs" , # uses edition 2024
3- ]
4-
51# Matches rustfmt.toml of rustc
62style_edition = " 2024"
73use_small_heuristics = " Max"
Original file line number Diff line number Diff 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" ,
You can’t perform that action at this time.
0 commit comments