Skip to content

Commit 0cd12d6

Browse files
committed
Auto merge of #87195 - yaahc:move-assert_matches-again, r=oli-obk
rename assert_matches module Fixes nightly breakage introduced in #86947
2 parents 32c447e + d0e8de6 commit 0cd12d6

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

compiler/rustc_middle/src/ich/impls_syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::ich::StableHashingContext;
66
use rustc_ast as ast;
77
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
88
use rustc_span::{BytePos, NormalizedPos, SourceFile};
9-
use std::assert::assert_matches;
9+
use std::assert_matches::assert_matches;
1010

1111
use smallvec::SmallVec;
1212

compiler/rustc_mir/src/interpret/memory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! integer. It is crucial that these operations call `check_align` *before*
77
//! short-circuiting the empty case!
88
9-
use std::assert::assert_matches;
9+
use std::assert_matches::assert_matches;
1010
use std::borrow::Cow;
1111
use std::collections::VecDeque;
1212
use std::convert::{TryFrom, TryInto};

library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ mod macros;
184184
#[cfg(not(test))]
185185
#[unstable(feature = "assert_matches", issue = "82775")]
186186
/// Unstable module containing the unstable `assert_matches` macro.
187-
pub mod assert {
187+
pub mod assert_matches {
188188
#[unstable(feature = "assert_matches", issue = "82775")]
189189
pub use crate::macros::{assert_matches, debug_assert_matches};
190190
}

library/core/src/macros/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ macro_rules! assert_ne {
127127
/// ```
128128
/// #![feature(assert_matches)]
129129
///
130-
/// use std::assert::assert_matches;
130+
/// use std::assert_matches::assert_matches;
131131
///
132132
/// let a = 1u32.checked_add(2);
133133
/// let b = 1u32.checked_sub(2);
@@ -286,7 +286,7 @@ macro_rules! debug_assert_ne {
286286
/// ```
287287
/// #![feature(assert_matches)]
288288
///
289-
/// use std::assert::debug_assert_matches;
289+
/// use std::assert_matches::debug_assert_matches;
290290
///
291291
/// let a = 1u32.checked_add(2);
292292
/// let b = 1u32.checked_sub(2);
@@ -301,7 +301,7 @@ macro_rules! debug_assert_ne {
301301
#[allow_internal_unstable(assert_matches)]
302302
#[rustc_macro_transparency = "semitransparent"]
303303
pub macro debug_assert_matches($($arg:tt)*) {
304-
if $crate::cfg!(debug_assertions) { $crate::assert::assert_matches!($($arg)*); }
304+
if $crate::cfg!(debug_assertions) { $crate::assert_matches::assert_matches!($($arg)*); }
305305
}
306306

307307
/// Returns whether the given expression matches any of the given patterns.

library/std/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,9 @@ pub use core::{
556556
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
557557
#[allow(deprecated)]
558558
pub use core::{
559-
asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
560-
format_args_nl, global_asm, include, include_bytes, include_str, line, llvm_asm, log_syntax,
561-
module_path, option_env, stringify, trace_macros,
559+
asm, assert, assert_matches, cfg, column, compile_error, concat, concat_idents, env, file,
560+
format_args, format_args_nl, global_asm, include, include_bytes, include_str, line, llvm_asm,
561+
log_syntax, module_path, option_env, stringify, trace_macros,
562562
};
563563

564564
#[stable(feature = "core_primitive", since = "1.43.0")]

src/test/ui/macros/assert-matches-macro-msg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#![feature(assert_matches)]
88

9-
use std::assert::assert_matches;
9+
use std::assert_matches::assert_matches;
1010

1111
fn main() {
1212
assert_matches!(1 + 1, 3, "1 + 1 definitely should be 3");

src/test/ui/matches2021.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#![feature(assert_matches)]
88

9-
use std::assert::assert_matches;
9+
use std::assert_matches::assert_matches;
1010

1111
fn main() {
1212
assert!(matches!((), ()));

0 commit comments

Comments
 (0)