Skip to content

Commit c7640e0

Browse files
committed
Run UI tests with edition 2024 by default
The `ui_test` crate still uses 2021 as the default edition for running rustc-like tests. This creates an unwelcome discrepancy between `cargo dev lint` which uses Rust 2024 by default, and running UI tests through `compile-test`.
1 parent ecd2025 commit c7640e0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/compile-test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use pulldown_cmark::{Options, Parser, html};
1414
use serde::Deserialize;
1515
use test_utils::IS_RUSTC_TEST_SUITE;
1616
use ui_test::custom_flags::Flag;
17+
use ui_test::custom_flags::edition::Edition;
1718
use ui_test::custom_flags::rustfix::RustfixMode;
1819
use ui_test::spanned::Spanned;
1920
use ui_test::{Args, CommandBuilder, Config, Match, error_on_output_conflict, status_emitter};
@@ -156,6 +157,7 @@ impl TestContext {
156157
..Config::rustc(Path::new("tests").join(test_dir))
157158
};
158159
let defaults = config.comment_defaults.base();
160+
defaults.set_custom("edition", Edition("2024".into()));
159161
defaults.exit_status = None.into();
160162
if mandatory_annotations {
161163
defaults.require_annotations = Some(Spanned::dummy(true)).into();

tests/ui/checked_unwrap/simple_conditionals.stderr

+1-2
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ LL | if X.is_some() {
244244
|
245245
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
246246
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
247-
= note: `-D static-mut-refs` implied by `-D warnings`
248-
= help: to override `-D warnings` add `#[allow(static_mut_refs)]`
247+
= note: `#[deny(static_mut_refs)]` on by default
249248

250249
error: aborting due to 26 previous errors
251250

0 commit comments

Comments
 (0)