From b3c0059ef4495f6a07fe37208a8183be680bcd9d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 31 Mar 2026 11:22:26 +0200 Subject: [PATCH] ./x run miri: default to edition 2021 --- src/bootstrap/src/core/build_steps/run.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs index 2079f3a190198..897e03ce71813 100644 --- a/src/bootstrap/src/core/build_steps/run.rs +++ b/src/bootstrap/src/core/build_steps/run.rs @@ -180,6 +180,10 @@ impl Step for Miri { // Forward arguments. This may contain further arguments to the program // after another --, so this must be at the end. miri.args(builder.config.args()); + // Add default edition for Miri tests (2021); defaulting to 2015 is often confusing. + if !builder.config.args().iter().any(|arg| arg.starts_with("--edition")) { + miri.arg("--edition=2021"); + } miri.into_cmd().run(builder); }