From 9dd6eda778b5320be1a9fbfb21eae3c1b733e744 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 7 Feb 2024 16:21:24 +0100 Subject: [PATCH] Prefer `min_exhaustive_patterns` in compiler --- compiler/rustc_middle/src/lib.rs | 3 ++- compiler/rustc_target/src/lib.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index 2aaece1060a1f..c9059ddc4bf25 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -24,6 +24,8 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(rust_logo)] +#![cfg_attr(bootstrap, feature(exhaustive_patterns))] +#![cfg_attr(not(bootstrap), feature(min_exhaustive_patterns))] #![feature(rustdoc_internals)] #![feature(allocator_api)] #![feature(array_windows)] @@ -32,7 +34,6 @@ #![feature(core_intrinsics)] #![feature(const_type_name)] #![feature(discriminant_kind)] -#![feature(exhaustive_patterns)] #![feature(coroutines)] #![feature(if_let_guard)] #![feature(inline_const)] diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index 04c5e60aa6ba1..8019d2b80cde0 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -9,9 +9,10 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![doc(rust_logo)] +#![cfg_attr(bootstrap, feature(exhaustive_patterns))] +#![cfg_attr(not(bootstrap), feature(min_exhaustive_patterns))] #![feature(rustdoc_internals)] #![feature(assert_matches)] -#![feature(exhaustive_patterns)] #![feature(iter_intersperse)] #![feature(let_chains)] #![cfg_attr(bootstrap, feature(min_specialization))]