Remove extern crate rustc_data_structures
from rustc_query_system
.
This commit is contained in:
parent
99e036bd21
commit
f3e05d1609
@ -76,8 +76,6 @@ pub const fn as_usize(&self) -> usize {
|
||||
}
|
||||
}
|
||||
|
||||
static_assert_size!(DepKind, 2);
|
||||
|
||||
pub fn default_dep_kind_debug(kind: DepKind, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("DepKind").field("variant", &kind.variant).finish()
|
||||
}
|
||||
@ -97,15 +95,6 @@ pub struct DepNode {
|
||||
pub hash: PackedFingerprint,
|
||||
}
|
||||
|
||||
// We keep a lot of `DepNode`s in memory during compilation. It's not
|
||||
// required that their size stay the same, but we don't want to change
|
||||
// it inadvertently. This assert just ensures we're aware of any change.
|
||||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||
static_assert_size!(DepNode, 18);
|
||||
|
||||
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
|
||||
static_assert_size!(DepNode, 24);
|
||||
|
||||
impl DepNode {
|
||||
/// Creates a new, parameterless DepNode. This method will assert
|
||||
/// that the DepNode corresponding to the given DepKind actually
|
||||
@ -316,3 +305,17 @@ unsafe impl StableOrd for WorkProductId {
|
||||
// Fingerprint can use unstable (just a tuple of `u64`s), so WorkProductId can as well
|
||||
const CAN_USE_UNSTABLE_SORT: bool = true;
|
||||
}
|
||||
|
||||
// Some types are used a lot. Make sure they don't unintentionally get bigger.
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
mod size_asserts {
|
||||
use super::*;
|
||||
use rustc_data_structures::static_assert_size;
|
||||
// tidy-alphabetical-start
|
||||
static_assert_size!(DepKind, 2);
|
||||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
||||
static_assert_size!(DepNode, 18);
|
||||
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
|
||||
static_assert_size!(DepNode, 24);
|
||||
// tidy-alphabetical-end
|
||||
}
|
||||
|
@ -41,6 +41,11 @@ pub struct DepGraph<D: Deps> {
|
||||
pub struct DepNodeIndex {}
|
||||
}
|
||||
|
||||
// We store a large collection of these in `prev_index_to_index` during
|
||||
// non-full incremental builds, and want to ensure that the element size
|
||||
// doesn't inadvertently increase.
|
||||
rustc_data_structures::static_assert_size!(Option<DepNodeIndex>, 4);
|
||||
|
||||
impl DepNodeIndex {
|
||||
const SINGLETON_DEPENDENCYLESS_ANON_NODE: DepNodeIndex = DepNodeIndex::ZERO;
|
||||
pub const FOREVER_RED_NODE: DepNodeIndex = DepNodeIndex::from_u32(1);
|
||||
@ -1107,11 +1112,6 @@ fn new(
|
||||
Err(_) => None,
|
||||
};
|
||||
|
||||
// We store a large collection of these in `prev_index_to_index` during
|
||||
// non-full incremental builds, and want to ensure that the element size
|
||||
// doesn't inadvertently increase.
|
||||
static_assert_size!(Option<DepNodeIndex>, 4);
|
||||
|
||||
let new_node_count_estimate = 102 * prev_graph_node_count / 100 + 200;
|
||||
|
||||
CurrentDepGraph {
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
#[macro_use]
|
||||
extern crate rustc_data_structures;
|
||||
|
||||
pub mod cache;
|
||||
pub mod dep_graph;
|
||||
|
Loading…
Reference in New Issue
Block a user