Skip to content

Commit 1163601

Browse files
Rollup merge of #153553 - Zalathar:assert-matches, r=lqd
Remove the `rustc_data_structures::assert_matches!` re-exports - #151359 - #153462 --- Now that the bootstrap stage0 compiler has been bumped to 1.95, we can remove these temporary re-exports from `rustc_data_structures`, and once again import the `assert_matches!` macros directly from std.
2 parents 38108e1 + 985b41d commit 1163601

File tree

58 files changed

+80
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+80
-88
lines changed

compiler/rustc_abi/src/extern_abi/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
use std::assert_matches;
12
use std::str::FromStr;
23

3-
use rustc_data_structures::assert_matches;
4-
54
use super::*;
65

76
#[allow(non_snake_case)]

compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Print diagnostics to explain why values are borrowed.
22
3-
use rustc_data_structures::assert_matches;
3+
use std::assert_matches;
4+
45
use rustc_errors::{Applicability, Diag, EmissionGuarantee};
56
use rustc_hir as hir;
67
use rustc_hir::intravisit::Visitor;

compiler/rustc_borrowck/src/type_check/input_output.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
//! `RETURN_PLACE` the MIR arguments) are always fully normalized (and
88
//! contain revealed `impl Trait` values).
99
10+
use std::assert_matches;
11+
1012
use itertools::Itertools;
11-
use rustc_data_structures::assert_matches;
1213
use rustc_hir as hir;
1314
use rustc_infer::infer::{BoundRegionConversionTime, RegionVariableOrigin};
1415
use rustc_middle::mir::*;

compiler/rustc_builtin_macros/src/test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
//! The expansion from a test function to the appropriate test struct for libtest
22
//! Ideally, this code would be in libtest but for efficiency and error messages it lives here.
33
4-
use std::iter;
4+
use std::{assert_matches, iter};
55

66
use rustc_ast::{self as ast, GenericParamKind, HasNodeId, attr, join_path_idents};
77
use rustc_ast_pretty::pprust;
88
use rustc_attr_parsing::AttributeParser;
9-
use rustc_data_structures::assert_matches;
109
use rustc_errors::{Applicability, Diag, Level};
1110
use rustc_expand::base::*;
1211
use rustc_hir::Attribute;

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
use std::assert_matches;
2+
13
use rustc_abi::{BackendRepr, Float, Integer, Primitive, Scalar};
24
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
35
use rustc_codegen_ssa::mir::operand::OperandValue;
46
use rustc_codegen_ssa::traits::*;
5-
use rustc_data_structures::assert_matches;
67
use rustc_data_structures::fx::FxHashMap;
78
use rustc_middle::ty::Instance;
89
use rustc_middle::ty::layout::TyAndLayout;

compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
use std::assert_matches;
12
use std::sync::Arc;
23

34
use itertools::Itertools;
45
use rustc_abi::Align;
56
use rustc_codegen_ssa::traits::{BaseTypeCodegenMethods, ConstCodegenMethods};
6-
use rustc_data_structures::assert_matches;
77
use rustc_data_structures::fx::FxIndexMap;
88
use rustc_index::IndexVec;
99
use rustc_middle::ty::TyCtxt;

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::cmp::Ordering;
22
use std::ffi::c_uint;
3-
use std::ptr;
3+
use std::{assert_matches, ptr};
44

55
use rustc_abi::{
66
Align, BackendRepr, ExternAbi, Float, HasDataLayout, Primitive, Size, WrappingRange,
@@ -11,7 +11,6 @@ use rustc_codegen_ssa::errors::{ExpectedPointerMutability, InvalidMonomorphizati
1111
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
1212
use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue};
1313
use rustc_codegen_ssa::traits::*;
14-
use rustc_data_structures::assert_matches;
1514
use rustc_hir as hir;
1615
use rustc_hir::def_id::LOCAL_CRATE;
1716
use rustc_hir::find_attr;

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ use std::panic::AssertUnwindSafe;
33
use std::path::{Path, PathBuf};
44
use std::sync::Arc;
55
use std::sync::mpsc::{Receiver, Sender, channel};
6-
use std::{fs, io, mem, str, thread};
6+
use std::{assert_matches, fs, io, mem, str, thread};
77

88
use rustc_abi::Size;
9-
use rustc_data_structures::assert_matches;
109
use rustc_data_structures::fx::FxIndexMap;
1110
use rustc_data_structures::jobserver::{self, Acquired};
1211
use rustc_data_structures::memmap::Mmap;

compiler/rustc_codegen_ssa/src/traits/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use std::assert_matches;
12
use std::ops::Deref;
23

34
use rustc_abi::{Align, Scalar, Size, WrappingRange};
4-
use rustc_data_structures::assert_matches;
55
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
66
use rustc_middle::mir;
77
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};

compiler/rustc_const_eval/src/check_consts/check.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
//! The `Visitor` responsible for actually checking a `mir::Body` for invalid operations.
22
33
use std::borrow::Cow;
4-
use std::mem;
54
use std::num::NonZero;
65
use std::ops::Deref;
6+
use std::{assert_matches, mem};
77

8-
use rustc_data_structures::assert_matches;
98
use rustc_errors::{Diag, ErrorGuaranteed};
109
use rustc_hir::def::DefKind;
1110
use rustc_hir::def_id::DefId;

0 commit comments

Comments
 (0)