Skip to content

Commit 0f724de

Browse files
committed
tests/unit: hoise edition = 2021 and gate #![feature(stdsimd)] behind edition < 2021
1 parent cf80dc7 commit 0f724de

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

scripts/test_translator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ def _generate_cc_db(self, c_file_path: str) -> None:
364364
fh.write(compile_commands)
365365

366366
def run(self) -> List[TestOutcome]:
367+
edition = 2021
368+
367369
if self.target and not rustc_has_target(self.target):
368370
self.print_status(Colors.OKBLUE, "SKIPPED",
369371
"building test {} because the {} target is not installed"
@@ -417,10 +419,13 @@ def run(self) -> List[TestOutcome]:
417419
rust_file_builder.add_features([
418420
"extern_types",
419421
"simd_ffi",
420-
"stdsimd",
421422
"linkage",
422423
"register_tool",
423424
])
425+
if edition < 2024:
426+
rust_file_builder.add_features([
427+
"stdsimd",
428+
])
424429
rust_file_builder.add_pragma("register_tool", ["c2rust"])
425430

426431
# Ensure that path to rustc's lib dir is in`LD_LIBRARY_PATH`
@@ -508,7 +513,6 @@ def run(self) -> List[TestOutcome]:
508513
# (if it's generated, it's in the wrong directory and may be different for each transpiled file).
509514
# We could also change things to transpile all `*.c` files at once, but that's more involved.
510515
# This logic needs to stay in sync with `fn emit_rust_toolchain`.
511-
edition = 2021
512516
match edition:
513517
case 2021:
514518
toolchain = "nightly-2023-04-15"

0 commit comments

Comments
 (0)