Stabilize assert_matches

This commit is contained in:
Lukas Bergdoll 2026-01-23 15:48:09 +01:00
parent d34f1f9314
commit 2f3b952349
56 changed files with 28 additions and 64 deletions

View file

@ -1,6 +1,6 @@
// tidy-alphabetical-start
#![cfg_attr(all(feature = "nightly", bootstrap), feature(assert_matches))]
#![cfg_attr(feature = "nightly", allow(internal_features))]
#![cfg_attr(feature = "nightly", feature(assert_matches))]
#![cfg_attr(feature = "nightly", feature(rustc_attrs))]
#![cfg_attr(feature = "nightly", feature(step_trait))]
// tidy-alphabetical-end

View file

@ -2,7 +2,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(default_field_values)]
#![feature(file_buffered)]

View file

@ -3,7 +3,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(decl_macro)]
#![feature(if_let_guard)]

View file

@ -5,7 +5,7 @@
//! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(extern_types)]
#![feature(file_buffered)]
#![feature(if_let_guard)]

View file

@ -1,5 +1,5 @@
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(file_buffered)]
#![feature(if_let_guard)]

View file

@ -1,6 +1,6 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(array_try_map)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(decl_macro)]
#![feature(if_let_guard)]

View file

@ -10,12 +10,12 @@
#![allow(internal_features)]
#![allow(rustc::default_hash_types)]
#![allow(rustc::potential_query_instability)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![cfg_attr(bootstrap, feature(cold_path))]
#![deny(unsafe_op_in_unsafe_fn)]
#![feature(allocator_api)]
#![feature(ascii_char)]
#![feature(ascii_char_variants)]
#![feature(assert_matches)]
#![feature(auto_traits)]
#![feature(cfg_select)]
#![feature(const_default)]

View file

@ -5,7 +5,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(default_field_values)]

View file

@ -56,7 +56,7 @@ This API is completely unstable and subject to change.
*/
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(default_field_values)]
#![feature(gen_blocks)]
#![feature(if_let_guard)]

View file

@ -1,5 +1,5 @@
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(iter_intersperse)]

View file

@ -14,7 +14,7 @@
// tidy-alphabetical-start
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(extend_one)]
#![recursion_limit = "512"] // For rustdoc
// tidy-alphabetical-end

View file

@ -21,7 +21,7 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(iter_order_by)]

View file

@ -27,8 +27,8 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(allocator_api)]
#![feature(assert_matches)]
#![feature(associated_type_defaults)]
#![feature(box_as_ptr)]
#![feature(box_patterns)]

View file

@ -1,7 +1,7 @@
//! Construction of MIR from HIR.
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(if_let_guard)]
#![feature(try_blocks)]

View file

@ -1,5 +1,5 @@
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(exact_size_is_empty)]

View file

@ -1,5 +1,5 @@
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(const_type_name)]
#![feature(cow_is_borrowed)]

View file

@ -1,7 +1,7 @@
//! The main parser interface.
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(box_patterns)]
#![feature(debug_closure_helpers)]
#![feature(default_field_values)]

View file

@ -1,6 +1,6 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(min_specialization)]
#![feature(trait_alias)]
// tidy-alphabetical-end

View file

@ -8,9 +8,9 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![cfg_attr(bootstrap, feature(ptr_as_ref_unchecked))]
#![feature(arbitrary_self_types)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(const_default)]
#![feature(const_trait_impl)]

View file

@ -88,7 +88,7 @@
//! DefPaths which are much more robust in the face of changes to the code base.
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
// tidy-alphabetical-end
use rustc_hir::def::DefKind;

View file

@ -11,7 +11,7 @@
//! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(default_field_values)]

View file

@ -5,7 +5,7 @@
//! This API is completely unstable and subject to change.
// tidy-alphabetical-start
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(associated_type_defaults)]
#![feature(box_patterns)]
#![feature(if_let_guard)]

View file

@ -89,7 +89,6 @@
#![feature(allocator_api)]
#![feature(array_into_iter_constructors)]
#![feature(ascii_char)]
#![feature(assert_matches)]
#![feature(async_fn_traits)]
#![feature(async_iterator)]
#![feature(box_vec_non_null)]

View file

@ -16,7 +16,6 @@
// tidy-alphabetical-start
#![feature(allocator_api)]
#![feature(array_into_iter_constructors)]
#![feature(assert_matches)]
#![feature(box_vec_non_null)]
#![feature(char_internals)]
#![feature(const_alloc_error)]

View file

@ -3,7 +3,6 @@
#![feature(const_heap)]
#![feature(deque_extend_front)]
#![feature(iter_array_chunks)]
#![feature(assert_matches)]
#![feature(wtf8_internals)]
#![feature(cow_is_borrowed)]
#![feature(core_intrinsics)]

View file

@ -225,7 +225,7 @@ use prelude::rust_2024::*;
#[macro_use]
mod macros;
#[unstable(feature = "assert_matches", issue = "82775")]
#[stable(feature = "assert_matches", since = "CURRENT_RUSTC_VERSION")]
pub use crate::macros::{assert_matches, debug_assert_matches};
#[unstable(feature = "derive_from", issue = "144889")]

View file

@ -147,8 +147,6 @@ macro_rules! assert_ne {
/// # Examples
///
/// ```
/// #![feature(assert_matches)]
///
/// use std::assert_matches;
///
/// let a = Some(345);
@ -166,7 +164,7 @@ macro_rules! assert_ne {
/// assert_matches!(a, Some(x) if x > 100);
/// // assert_matches!(a, Some(x) if x < 100); // panics
/// ```
#[unstable(feature = "assert_matches", issue = "82775")]
#[stable(feature = "assert_matches", since = "CURRENT_RUSTC_VERSION")]
#[allow_internal_unstable(panic_internals)]
#[rustc_macro_transparency = "semiopaque"]
pub macro assert_matches {
@ -380,8 +378,6 @@ macro_rules! debug_assert_ne {
/// # Examples
///
/// ```
/// #![feature(assert_matches)]
///
/// use std::debug_assert_matches;
///
/// let a = Some(345);
@ -399,7 +395,7 @@ macro_rules! debug_assert_ne {
/// debug_assert_matches!(a, Some(x) if x > 100);
/// // debug_assert_matches!(a, Some(x) if x < 100); // panics
/// ```
#[unstable(feature = "assert_matches", issue = "82775")]
#[stable(feature = "assert_matches", since = "CURRENT_RUSTC_VERSION")]
#[allow_internal_unstable(assert_matches)]
#[rustc_macro_transparency = "semiopaque"]
pub macro debug_assert_matches($($arg:tt)*) {

View file

@ -394,7 +394,6 @@
//
// Only for re-exporting:
// tidy-alphabetical-start
#![feature(assert_matches)]
#![feature(async_iterator)]
#![feature(c_variadic)]
#![feature(cfg_accessible)]
@ -726,7 +725,7 @@ pub use core::{
assert_eq, assert_ne, debug_assert, debug_assert_eq, debug_assert_ne, r#try, unimplemented,
unreachable, write, writeln,
};
#[unstable(feature = "assert_matches", issue = "82775")]
#[stable(feature = "assert_matches", since = "CURRENT_RUSTC_VERSION")]
pub use core::{assert_matches, debug_assert_matches};
// Re-export unstable derive macro defined through core.

View file

@ -1,11 +1,11 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(assert_matches))]
#![doc(
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/"
)]
#![feature(ascii_char)]
#![feature(ascii_char_variants)]
#![feature(assert_matches)]
#![feature(box_into_inner)]
#![feature(box_patterns)]
#![feature(file_buffered)]

View file

@ -3,7 +3,7 @@
#![feature(macro_metavar_expr)]
#![feature(never_type)]
#![feature(rustc_private)]
#![feature(assert_matches)]
#![cfg_attr(bootstrap, feature(assert_matches))]
#![feature(unwrap_infallible)]
#![recursion_limit = "512"]
#![allow(clippy::missing_errors_doc, clippy::missing_panics_doc, clippy::must_use_candidate)]

View file

@ -6,7 +6,6 @@
//@ ignore-remote
#![feature(rustc_private)]
#![feature(assert_matches)]
#![feature(ascii_char, ascii_char_variants)]
extern crate rustc_driver;

View file

@ -8,7 +8,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
#![feature(ascii_char, ascii_char_variants)]
extern crate rustc_hir;

View file

@ -8,7 +8,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2024
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -6,7 +6,6 @@
//@ ignore-remote
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_hir;
extern crate rustc_middle;

View file

@ -8,7 +8,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -10,7 +10,6 @@
//@ ignore-remote
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;
extern crate rustc_hir;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -6,7 +6,6 @@
//@ ignore-remote
#![feature(rustc_private)]
#![feature(assert_matches)]
#![feature(ascii_char, ascii_char_variants)]
extern crate rustc_hir;

View file

@ -8,7 +8,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -8,7 +8,6 @@
//@ edition: 2024
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_hir;
extern crate rustc_middle;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_hir;
extern crate rustc_middle;

View file

@ -8,7 +8,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_driver;
extern crate rustc_interface;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_driver;

View file

@ -7,7 +7,6 @@
//@ edition: 2021
#![feature(rustc_private)]
#![feature(assert_matches)]
extern crate rustc_middle;

View file

@ -1,7 +1,6 @@
// Test that uninhabited saved local doesn't make the entire variant uninhabited.
//@ run-pass
#![allow(unused)]
#![feature(assert_matches)]
#![feature(coroutine_trait)]
#![feature(coroutines, stmt_expr_attributes)]
#![feature(never_type)]

View file

@ -4,8 +4,6 @@
//@ error-pattern: right: 3
//@ needs-subprocess
#![feature(assert_matches)]
use std::assert_matches;
fn main() {

View file

@ -3,8 +3,6 @@
// regression test for https://github.com/rust-lang/rust/pull/85678
#![feature(assert_matches)]
use std::assert_matches;
fn main() {