Skip to content

Commit c9a70be

Browse files
committed
transpile: tests: specify --edition 2021 for rustfmt, too
1 parent bc490fc commit c9a70be

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

c2rust-transpile/tests/snapshots.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ fn transpile(platform: Option<&str>, c_path: &Path) {
8888
}
8989
};
9090

91-
let status = Command::new("rustfmt").arg(&rs_path).status();
91+
let edition = "2021";
92+
93+
let status = Command::new("rustfmt")
94+
.args(["--edition", edition])
95+
.arg(&rs_path)
96+
.status();
9297
assert!(status.unwrap().success());
9398

9499
let rs = fs::read_to_string(&rs_path).unwrap();
@@ -119,7 +124,7 @@ fn transpile(platform: Option<&str>, c_path: &Path) {
119124
"--crate-type",
120125
"lib",
121126
"--edition",
122-
"2021",
127+
edition,
123128
"--crate-name",
124129
crate_name,
125130
"-o",

0 commit comments

Comments
 (0)