From b4dfd51bac242deca51442355784274beb16bd43 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Sat, 12 Jul 2025 15:59:16 +0800 Subject: [PATCH] Do not allow defaults for `Mode` and `Config` They do not have sensible defaults, and it is crucial that we get them right. --- src/tools/compiletest/src/common.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index bbc002a9b876..943e800e72cf 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -34,12 +34,6 @@ string_enum! { } } -impl Default for Mode { - fn default() -> Self { - Mode::Ui - } -} - impl Mode { pub fn aux_dir_disambiguator(self) -> &'static str { // Pretty-printing tests could run concurrently, and if they do, @@ -151,7 +145,7 @@ pub enum Sanitizer { /// /// FIXME: audit these options to make sure we are not hashing less than necessary for build stamp /// (for changed test detection). -#[derive(Debug, Default, Clone)] +#[derive(Debug, Clone)] pub struct Config { /// Some test [`Mode`]s support [snapshot testing], where a *reference snapshot* of outputs (of /// `stdout`, `stderr`, or other form of artifacts) can be compared to the *actual output*.