diff options
| -rw-r--r-- | compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs | 16 | ||||
| -rw-r--r-- | compiler/rustc_codegen_cranelift/rustfmt.toml | 4 | ||||
| -rw-r--r-- | rustfmt.toml | 1 | ||||
| -rw-r--r-- | src/bootstrap/src/core/build_steps/format.rs | 2 | ||||
| -rw-r--r-- | src/etc/test-float-parse/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/exhaustive.rs (renamed from src/etc/test-float-parse/src/gen/exhaustive.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/exponents.rs (renamed from src/etc/test-float-parse/src/gen/exponents.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/fuzz.rs (renamed from src/etc/test-float-parse/src/gen/fuzz.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/integers.rs (renamed from src/etc/test-float-parse/src/gen/integers.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/long_fractions.rs (renamed from src/etc/test-float-parse/src/gen/long_fractions.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/many_digits.rs (renamed from src/etc/test-float-parse/src/gen/many_digits.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/sparse.rs (renamed from src/etc/test-float-parse/src/gen/sparse.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/spot_checks.rs (renamed from src/etc/test-float-parse/src/gen/spot_checks.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/gen_/subnorm.rs (renamed from src/etc/test-float-parse/src/gen/subnorm.rs) | 0 | ||||
| -rw-r--r-- | src/etc/test-float-parse/src/lib.rs | 38 | ||||
| -rw-r--r-- | tests/mir-opt/coroutine_drop_cleanup.rs | 2 |
16 files changed, 34 insertions, 31 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs b/compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs index 25bfe542d22..de9a3d550ec 100644 --- a/compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs +++ b/compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs @@ -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); - } diff --git a/compiler/rustc_codegen_cranelift/rustfmt.toml b/compiler/rustc_codegen_cranelift/rustfmt.toml index f31fa9c76ab..35c92663eb9 100644 --- a/compiler/rustc_codegen_cranelift/rustfmt.toml +++ b/compiler/rustc_codegen_cranelift/rustfmt.toml @@ -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" diff --git a/rustfmt.toml b/rustfmt.toml index 8feeb60ca12..c884a33729c 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -49,7 +49,6 @@ ignore = [ # These are ignored by a standard cargo fmt run. "compiler/rustc_codegen_cranelift/scripts", - "compiler/rustc_codegen_cranelift/example/gen_block_iterate.rs", # uses edition 2024 "compiler/rustc_codegen_gcc/tests", # Code automatically generated and included. "compiler/rustc_codegen_gcc/src/intrinsic/archs.rs", diff --git a/src/bootstrap/src/core/build_steps/format.rs b/src/bootstrap/src/core/build_steps/format.rs index 7aa5cb2b6e5..b1a97bde97b 100644 --- a/src/bootstrap/src/core/build_steps/format.rs +++ b/src/bootstrap/src/core/build_steps/format.rs @@ -31,7 +31,7 @@ fn rustfmt( // Avoid the submodule config paths from coming into play. We only allow a single global config // for the workspace for now. cmd.arg("--config-path").arg(src.canonicalize().unwrap()); - cmd.arg("--edition").arg("2021"); + cmd.arg("--edition").arg("2024"); cmd.arg("--unstable-features"); cmd.arg("--skip-children"); if check { diff --git a/src/etc/test-float-parse/Cargo.toml b/src/etc/test-float-parse/Cargo.toml index bacb9e09f3f..8a9c5322ef7 100644 --- a/src/etc/test-float-parse/Cargo.toml +++ b/src/etc/test-float-parse/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test-float-parse" version = "0.1.0" -edition = "2021" +edition = "2024" publish = false [dependencies] diff --git a/src/etc/test-float-parse/src/gen/exhaustive.rs b/src/etc/test-float-parse/src/gen_/exhaustive.rs index 01458fb0b60..01458fb0b60 100644 --- a/src/etc/test-float-parse/src/gen/exhaustive.rs +++ b/src/etc/test-float-parse/src/gen_/exhaustive.rs diff --git a/src/etc/test-float-parse/src/gen/exponents.rs b/src/etc/test-float-parse/src/gen_/exponents.rs index 3748e9d380c..3748e9d380c 100644 --- a/src/etc/test-float-parse/src/gen/exponents.rs +++ b/src/etc/test-float-parse/src/gen_/exponents.rs diff --git a/src/etc/test-float-parse/src/gen/fuzz.rs b/src/etc/test-float-parse/src/gen_/fuzz.rs index 1d6c5562a14..1d6c5562a14 100644 --- a/src/etc/test-float-parse/src/gen/fuzz.rs +++ b/src/etc/test-float-parse/src/gen_/fuzz.rs diff --git a/src/etc/test-float-parse/src/gen/integers.rs b/src/etc/test-float-parse/src/gen_/integers.rs index 070d188e88c..070d188e88c 100644 --- a/src/etc/test-float-parse/src/gen/integers.rs +++ b/src/etc/test-float-parse/src/gen_/integers.rs diff --git a/src/etc/test-float-parse/src/gen/long_fractions.rs b/src/etc/test-float-parse/src/gen_/long_fractions.rs index b75148b779c..b75148b779c 100644 --- a/src/etc/test-float-parse/src/gen/long_fractions.rs +++ b/src/etc/test-float-parse/src/gen_/long_fractions.rs diff --git a/src/etc/test-float-parse/src/gen/many_digits.rs b/src/etc/test-float-parse/src/gen_/many_digits.rs index 741e11437fe..741e11437fe 100644 --- a/src/etc/test-float-parse/src/gen/many_digits.rs +++ b/src/etc/test-float-parse/src/gen_/many_digits.rs diff --git a/src/etc/test-float-parse/src/gen/sparse.rs b/src/etc/test-float-parse/src/gen_/sparse.rs index 72b65d4ce7f..72b65d4ce7f 100644 --- a/src/etc/test-float-parse/src/gen/sparse.rs +++ b/src/etc/test-float-parse/src/gen_/sparse.rs diff --git a/src/etc/test-float-parse/src/gen/spot_checks.rs b/src/etc/test-float-parse/src/gen_/spot_checks.rs index 18691f9d6cf..18691f9d6cf 100644 --- a/src/etc/test-float-parse/src/gen/spot_checks.rs +++ b/src/etc/test-float-parse/src/gen_/spot_checks.rs diff --git a/src/etc/test-float-parse/src/gen/subnorm.rs b/src/etc/test-float-parse/src/gen_/subnorm.rs index 4fe3b90a3dd..4fe3b90a3dd 100644 --- a/src/etc/test-float-parse/src/gen/subnorm.rs +++ b/src/etc/test-float-parse/src/gen_/subnorm.rs diff --git a/src/etc/test-float-parse/src/lib.rs b/src/etc/test-float-parse/src/lib.rs index e2f84b085c6..3c3ef5802b6 100644 --- a/src/etc/test-float-parse/src/lib.rs +++ b/src/etc/test-float-parse/src/lib.rs @@ -17,7 +17,7 @@ use traits::{Float, Generator, Int}; use validate::CheckError; /// Test generators. -mod gen { +mod gen_ { pub mod exhaustive; pub mod exponents; pub mod fuzz; @@ -136,24 +136,24 @@ where { if F::BITS <= MAX_BITS_FOR_EXHAUUSTIVE { // Only run exhaustive tests if there is a chance of completion. - TestInfo::register::<F, gen::exhaustive::Exhaustive<F>>(tests); + TestInfo::register::<F, gen_::exhaustive::Exhaustive<F>>(tests); } - gen::fuzz::Fuzz::<F>::set_iterations(cfg.fuzz_count); - - TestInfo::register::<F, gen::exponents::LargeExponents<F>>(tests); - TestInfo::register::<F, gen::exponents::SmallExponents<F>>(tests); - TestInfo::register::<F, gen::fuzz::Fuzz<F>>(tests); - TestInfo::register::<F, gen::integers::LargeInt<F>>(tests); - TestInfo::register::<F, gen::integers::SmallInt>(tests); - TestInfo::register::<F, gen::long_fractions::RepeatingDecimal>(tests); - TestInfo::register::<F, gen::many_digits::RandDigits<F>>(tests); - TestInfo::register::<F, gen::sparse::FewOnesFloat<F>>(tests); - TestInfo::register::<F, gen::sparse::FewOnesInt<F>>(tests); - TestInfo::register::<F, gen::spot_checks::RegressionCheck>(tests); - TestInfo::register::<F, gen::spot_checks::Special>(tests); - TestInfo::register::<F, gen::subnorm::SubnormComplete<F>>(tests); - TestInfo::register::<F, gen::subnorm::SubnormEdgeCases<F>>(tests); + gen_::fuzz::Fuzz::<F>::set_iterations(cfg.fuzz_count); + + TestInfo::register::<F, gen_::exponents::LargeExponents<F>>(tests); + TestInfo::register::<F, gen_::exponents::SmallExponents<F>>(tests); + TestInfo::register::<F, gen_::fuzz::Fuzz<F>>(tests); + TestInfo::register::<F, gen_::integers::LargeInt<F>>(tests); + TestInfo::register::<F, gen_::integers::SmallInt>(tests); + TestInfo::register::<F, gen_::long_fractions::RepeatingDecimal>(tests); + TestInfo::register::<F, gen_::many_digits::RandDigits<F>>(tests); + TestInfo::register::<F, gen_::sparse::FewOnesFloat<F>>(tests); + TestInfo::register::<F, gen_::sparse::FewOnesInt<F>>(tests); + TestInfo::register::<F, gen_::spot_checks::RegressionCheck>(tests); + TestInfo::register::<F, gen_::spot_checks::Special>(tests); + TestInfo::register::<F, gen_::subnorm::SubnormComplete<F>>(tests); + TestInfo::register::<F, gen_::subnorm::SubnormEdgeCases<F>>(tests); } /// Configuration for a single test. @@ -343,7 +343,7 @@ fn launch_tests(tests: &mut [TestInfo], cfg: &Config) -> Duration { /// /// This calls the generator's iterator multiple times (in parallel) and validates each output. fn test_runner<F: Float, G: Generator<F>>(test: &TestInfo, cfg: &Config) { - let gen = G::new(); + let gen_ = G::new(); let executed = AtomicU64::new(0); let failures = AtomicU64::new(0); @@ -387,7 +387,7 @@ fn test_runner<F: Float, G: Generator<F>>(test: &TestInfo, cfg: &Config) { // Run the test iterations in parallel. Each thread gets a string buffer to write // its check values to. - let res = gen.par_bridge().try_for_each_init(String::new, check_one); + let res = gen_.par_bridge().try_for_each_init(String::new, check_one); let elapsed = started.elapsed(); let executed = executed.into_inner(); diff --git a/tests/mir-opt/coroutine_drop_cleanup.rs b/tests/mir-opt/coroutine_drop_cleanup.rs index 33fdd2dd0d9..4ae97273cd9 100644 --- a/tests/mir-opt/coroutine_drop_cleanup.rs +++ b/tests/mir-opt/coroutine_drop_cleanup.rs @@ -8,7 +8,7 @@ // EMIT_MIR coroutine_drop_cleanup.main-{closure#0}.coroutine_drop.0.mir fn main() { - let gen = #[coroutine] + let gen_ = #[coroutine] || { let _s = String::new(); yield; |
