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:
commit
82f04468e9
16 changed files with 33 additions and 30 deletions
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "test-float-parse"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
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);
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue