1
Fork 0

Remove extern crate rustc_data_structures from numerous crates.

This commit is contained in:
Nicholas Nethercote 2024-04-29 14:59:24 +10:00
parent f3e05d1609
commit 7418aa1a07
22 changed files with 18 additions and 27 deletions

View file

@ -68,8 +68,6 @@
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
extern crate tracing;
#[macro_use]
extern crate smallvec;

View file

@ -153,7 +153,7 @@ rustc_index::newtype_index! {
}
// compilation error if size of `ScopeData` is not the same as a `u32`
static_assert_size!(ScopeData, 4);
rustc_data_structures::static_assert_size!(ScopeData, 4);
impl Scope {
/// Returns an item-local ID associated with this scope.

View file

@ -72,7 +72,7 @@ pub enum ConstValue<'tcx> {
}
#[cfg(target_pointer_width = "64")]
static_assert_size!(ConstValue<'_>, 24);
rustc_data_structures::static_assert_size!(ConstValue<'_>, 24);
impl<'tcx> ConstValue<'tcx> {
#[inline]

View file

@ -89,7 +89,7 @@ pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>;
pub type EvalToValTreeResult<'tcx> = Result<Option<ValTree<'tcx>>, ErrorHandled>;
#[cfg(target_pointer_width = "64")]
static_assert_size!(InterpErrorInfo<'_>, 8);
rustc_data_structures::static_assert_size!(InterpErrorInfo<'_>, 8);
/// Packages the kind of error we got from the const code interpreter
/// up with a Rust-level backtrace of where the error occurred.

View file

@ -1,5 +1,6 @@
use super::{AllocId, InterpResult};
use rustc_data_structures::static_assert_size;
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_target::abi::{HasDataLayout, Size};

View file

@ -38,7 +38,7 @@ pub enum Scalar<Prov = CtfeProvenance> {
}
#[cfg(target_pointer_width = "64")]
static_assert_size!(Scalar, 24);
rustc_data_structures::static_assert_size!(Scalar, 24);
// We want the `Debug` output to be readable as it is used by `derive(Debug)` for
// all the Miri types.

View file

@ -1523,6 +1523,7 @@ pub enum BinOp {
#[cfg(target_pointer_width = "64")]
mod size_asserts {
use super::*;
use rustc_data_structures::static_assert_size;
// tidy-alphabetical-start
static_assert_size!(AggregateKind<'_>, 32);
static_assert_size!(Operand<'_>, 24);

View file

@ -15,7 +15,7 @@ pub struct PlaceTy<'tcx> {
// At least on 64 bit systems, `PlaceTy` should not be larger than two or three pointers.
#[cfg(target_pointer_width = "64")]
static_assert_size!(PlaceTy<'_>, 16);
rustc_data_structures::static_assert_size!(PlaceTy<'_>, 16);
impl<'tcx> PlaceTy<'tcx> {
#[inline]

View file

@ -1,5 +1,3 @@
use super::*;
// FIXME(#27438): right now the unit tests of rustc_middle don't refer to any actual
// functions generated in rustc_data_structures (all
// references are through generic functions), but statics are

View file

@ -1210,6 +1210,7 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
#[cfg(target_pointer_width = "64")]
mod size_asserts {
use super::*;
use rustc_data_structures::static_assert_size;
// tidy-alphabetical-start
static_assert_size!(Block, 48);
static_assert_size!(Expr<'_>, 64);

View file

@ -560,7 +560,7 @@ impl<'tcx> ObligationCauseCode<'tcx> {
// `ObligationCauseCode` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_pointer_width = "64")]
static_assert_size!(ObligationCauseCode<'_>, 48);
rustc_data_structures::static_assert_size!(ObligationCauseCode<'_>, 48);
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub enum StatementAsExpression {

View file

@ -23,7 +23,7 @@ pub use valtree::*;
pub type ConstKind<'tcx> = IrConstKind<TyCtxt<'tcx>>;
#[cfg(target_pointer_width = "64")]
static_assert_size!(ConstKind<'_>, 32);
rustc_data_structures::static_assert_size!(ConstKind<'_>, 32);
/// Use this rather than `ConstData`, whenever possible.
#[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable)]
@ -63,7 +63,7 @@ pub struct ConstData<'tcx> {
}
#[cfg(target_pointer_width = "64")]
static_assert_size!(ConstData<'_>, 40);
rustc_data_structures::static_assert_size!(ConstData<'_>, 40);
impl<'tcx> Const<'tcx> {
#[inline]

View file

@ -72,4 +72,4 @@ pub enum Expr<'tcx> {
}
#[cfg(target_pointer_width = "64")]
static_assert_size!(Expr<'_>, 24);
rustc_data_structures::static_assert_size!(Expr<'_>, 24);

View file

@ -1085,7 +1085,7 @@ struct ParamTag {
reveal: traits::Reveal,
}
impl_tag! {
rustc_data_structures::impl_tag! {
impl Tag for ParamTag;
ParamTag { reveal: traits::Reveal::UserFacing },
ParamTag { reveal: traits::Reveal::All },