From c9a70be9c3bd9367fbf5265039acb323082283b8 Mon Sep 17 00:00:00 2001 From: Khyber Sen Date: Sat, 11 Oct 2025 15:22:30 -0700 Subject: [PATCH] transpile: tests: specify `--edition 2021` for `rustfmt`, too --- c2rust-transpile/tests/snapshots.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/c2rust-transpile/tests/snapshots.rs b/c2rust-transpile/tests/snapshots.rs index 9f744f8173..45c58d7f7d 100644 --- a/c2rust-transpile/tests/snapshots.rs +++ b/c2rust-transpile/tests/snapshots.rs @@ -88,7 +88,12 @@ fn transpile(platform: Option<&str>, c_path: &Path) { } }; - let status = Command::new("rustfmt").arg(&rs_path).status(); + let edition = "2021"; + + let status = Command::new("rustfmt") + .args(["--edition", edition]) + .arg(&rs_path) + .status(); assert!(status.unwrap().success()); let rs = fs::read_to_string(&rs_path).unwrap(); @@ -119,7 +124,7 @@ fn transpile(platform: Option<&str>, c_path: &Path) { "--crate-type", "lib", "--edition", - "2021", + edition, "--crate-name", crate_name, "-o",