Skip to content

Commit 7418aa1

Browse files
committed
Remove extern crate rustc_data_structures from numerous crates.
1 parent f3e05d1 commit 7418aa1

File tree

22 files changed

+18
-27
lines changed

22 files changed

+18
-27
lines changed

compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3863,6 +3863,7 @@ impl<'hir> Node<'hir> {
38633863
#[cfg(target_pointer_width = "64")]
38643864
mod size_asserts {
38653865
use super::*;
3866+
use rustc_data_structures::static_assert_size;
38663867
// tidy-alphabetical-start
38673868
static_assert_size!(Block<'_>, 48);
38683869
static_assert_size!(Body<'_>, 24);

compiler/rustc_hir/src/lang_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ macro_rules! language_item_table {
5656
$( $(#[$attr:meta])* $variant:ident, $module:ident :: $name:ident, $method:ident, $target:expr, $generics:expr; )*
5757
) => {
5858

59-
enum_from_u32! {
59+
rustc_data_structures::enum_from_u32! {
6060
/// A representation of all the valid lang items in Rust.
6161
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable)]
6262
pub enum LangItem {

compiler/rustc_hir/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#[macro_use]
1414
extern crate tracing;
1515

16-
#[macro_use]
17-
extern crate rustc_data_structures;
18-
1916
extern crate self as rustc_hir;
2017

2118
mod arena;

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ pub enum SubregionOrigin<'tcx> {
479479

480480
// `SubregionOrigin` is used a lot. Make sure it doesn't unintentionally get bigger.
481481
#[cfg(target_pointer_width = "64")]
482-
static_assert_size!(SubregionOrigin<'_>, 32);
482+
rustc_data_structures::static_assert_size!(SubregionOrigin<'_>, 32);
483483

484484
impl<'tcx> SubregionOrigin<'tcx> {
485485
pub fn to_constraint_category(&self) -> ConstraintCategory<'tcx> {

compiler/rustc_infer/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
#![feature(yeet_expr)]
3131
#![recursion_limit = "512"] // For rustdoc
3232

33-
#[cfg(target_pointer_width = "64")]
34-
#[macro_use]
35-
extern crate rustc_data_structures;
3633
#[macro_use]
3734
extern crate tracing;
3835
#[macro_use]

compiler/rustc_infer/src/traits/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'tcx> PolyTraitObligation<'tcx> {
113113

114114
// `PredicateObligation` is used a lot. Make sure it doesn't unintentionally get bigger.
115115
#[cfg(target_pointer_width = "64")]
116-
static_assert_size!(PredicateObligation<'_>, 48);
116+
rustc_data_structures::static_assert_size!(PredicateObligation<'_>, 48);
117117

118118
pub type PredicateObligations<'tcx> = Vec<PredicateObligation<'tcx>>;
119119

compiler/rustc_middle/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@
6868
#[macro_use]
6969
extern crate bitflags;
7070
#[macro_use]
71-
extern crate rustc_data_structures;
72-
#[macro_use]
7371
extern crate tracing;
7472
#[macro_use]
7573
extern crate smallvec;

compiler/rustc_middle/src/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ rustc_index::newtype_index! {
153153
}
154154

155155
// compilation error if size of `ScopeData` is not the same as a `u32`
156-
static_assert_size!(ScopeData, 4);
156+
rustc_data_structures::static_assert_size!(ScopeData, 4);
157157

158158
impl Scope {
159159
/// Returns an item-local ID associated with this scope.

compiler/rustc_middle/src/mir/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub enum ConstValue<'tcx> {
7272
}
7373

7474
#[cfg(target_pointer_width = "64")]
75-
static_assert_size!(ConstValue<'_>, 24);
75+
rustc_data_structures::static_assert_size!(ConstValue<'_>, 24);
7676

7777
impl<'tcx> ConstValue<'tcx> {
7878
#[inline]

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>;
8989
pub type EvalToValTreeResult<'tcx> = Result<Option<ValTree<'tcx>>, ErrorHandled>;
9090

9191
#[cfg(target_pointer_width = "64")]
92-
static_assert_size!(InterpErrorInfo<'_>, 8);
92+
rustc_data_structures::static_assert_size!(InterpErrorInfo<'_>, 8);
9393

9494
/// Packages the kind of error we got from the const code interpreter
9595
/// up with a Rust-level backtrace of where the error occurred.

0 commit comments

Comments
 (0)