Auto merge of #95656 - cjgillot:no-id-hashing-mode, r=Aaron1011
Remove NodeIdHashingMode. r? `@ghost`
This commit is contained in:
commit
f38c5c8e5d
20 changed files with 84 additions and 388 deletions
|
@ -3,7 +3,7 @@ use std::cell::RefCell;
|
||||||
use rustc_data_structures::{
|
use rustc_data_structures::{
|
||||||
fingerprint::Fingerprint,
|
fingerprint::Fingerprint,
|
||||||
fx::FxHashMap,
|
fx::FxHashMap,
|
||||||
stable_hasher::{HashStable, NodeIdHashingMode, StableHasher},
|
stable_hasher::{HashStable, StableHasher},
|
||||||
};
|
};
|
||||||
use rustc_middle::{
|
use rustc_middle::{
|
||||||
bug,
|
bug,
|
||||||
|
@ -94,11 +94,7 @@ impl<'tcx> UniqueTypeId<'tcx> {
|
||||||
pub fn generate_unique_id_string(self, tcx: TyCtxt<'tcx>) -> String {
|
pub fn generate_unique_id_string(self, tcx: TyCtxt<'tcx>) -> String {
|
||||||
let mut hasher = StableHasher::new();
|
let mut hasher = StableHasher::new();
|
||||||
let mut hcx = tcx.create_stable_hashing_context();
|
let mut hcx = tcx.create_stable_hashing_context();
|
||||||
hcx.while_hashing_spans(false, |hcx| {
|
hcx.while_hashing_spans(false, |hcx| self.hash_stable(hcx, &mut hasher));
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
self.hash_stable(hcx, &mut hasher);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
hasher.finish::<Fingerprint>().to_hex()
|
hasher.finish::<Fingerprint>().to_hex()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ use rustc_hir::{AsyncGeneratorKind, GeneratorKind, Mutability};
|
||||||
use rustc_middle::ty::layout::{IntegerExt, TyAndLayout};
|
use rustc_middle::ty::layout::{IntegerExt, TyAndLayout};
|
||||||
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
|
use rustc_middle::ty::subst::{GenericArgKind, SubstsRef};
|
||||||
use rustc_middle::ty::{self, ExistentialProjection, GeneratorSubsts, ParamEnv, Ty, TyCtxt};
|
use rustc_middle::ty::{self, ExistentialProjection, GeneratorSubsts, ParamEnv, Ty, TyCtxt};
|
||||||
use rustc_query_system::ich::NodeIdHashingMode;
|
|
||||||
use rustc_target::abi::{Integer, TagEncoding, Variants};
|
use rustc_target::abi::{Integer, TagEncoding, Variants};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
|
|
||||||
|
@ -704,11 +703,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: ty::Const<'tcx>, output: &mut S
|
||||||
// but we get a deterministic, virtually unique value for the constant.
|
// but we get a deterministic, virtually unique value for the constant.
|
||||||
let hcx = &mut tcx.create_stable_hashing_context();
|
let hcx = &mut tcx.create_stable_hashing_context();
|
||||||
let mut hasher = StableHasher::new();
|
let mut hasher = StableHasher::new();
|
||||||
hcx.while_hashing_spans(false, |hcx| {
|
hcx.while_hashing_spans(false, |hcx| ct.val().hash_stable(hcx, &mut hasher));
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
ct.val().hash_stable(hcx, &mut hasher);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// Let's only emit 64 bits of the hash value. That should be plenty for
|
// Let's only emit 64 bits of the hash value. That should be plenty for
|
||||||
// avoiding collisions and will make the emitted type names shorter.
|
// avoiding collisions and will make the emitted type names shorter.
|
||||||
let hash: u64 = hasher.finish();
|
let hash: u64 = hasher.finish();
|
||||||
|
|
|
@ -612,12 +612,6 @@ fn stable_hash_reduce<HCX, I, C, F>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone, Copy, Hash, Debug)]
|
|
||||||
pub enum NodeIdHashingMode {
|
|
||||||
Ignore,
|
|
||||||
HashDefPath,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Controls what data we do or not not hash.
|
/// Controls what data we do or not not hash.
|
||||||
/// Whenever a `HashStable` implementation caches its
|
/// Whenever a `HashStable` implementation caches its
|
||||||
/// result, it needs to include `HashingControls` as part
|
/// result, it needs to include `HashingControls` as part
|
||||||
|
@ -628,5 +622,4 @@ pub enum NodeIdHashingMode {
|
||||||
#[derive(Clone, Hash, Eq, PartialEq, Debug)]
|
#[derive(Clone, Hash, Eq, PartialEq, Debug)]
|
||||||
pub struct HashingControls {
|
pub struct HashingControls {
|
||||||
pub hash_spans: bool,
|
pub hash_spans: bool,
|
||||||
pub node_id_hashing_mode: NodeIdHashingMode,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1299,7 +1299,7 @@ pub struct BodyId {
|
||||||
///
|
///
|
||||||
/// All bodies have an **owner**, which can be accessed via the HIR
|
/// All bodies have an **owner**, which can be accessed via the HIR
|
||||||
/// map using `body_owner_def_id()`.
|
/// map using `body_owner_def_id()`.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, HashStable_Generic)]
|
||||||
pub struct Body<'hir> {
|
pub struct Body<'hir> {
|
||||||
pub params: &'hir [Param<'hir>],
|
pub params: &'hir [Param<'hir>],
|
||||||
pub value: Expr<'hir>,
|
pub value: Expr<'hir>,
|
||||||
|
@ -2059,7 +2059,7 @@ pub struct FnSig<'hir> {
|
||||||
// The bodies for items are stored "out of line", in a separate
|
// The bodies for items are stored "out of line", in a separate
|
||||||
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
||||||
// so it can fetched later.
|
// so it can fetched later.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug, HashStable_Generic)]
|
||||||
pub struct TraitItemId {
|
pub struct TraitItemId {
|
||||||
pub def_id: LocalDefId,
|
pub def_id: LocalDefId,
|
||||||
}
|
}
|
||||||
|
@ -2076,7 +2076,7 @@ impl TraitItemId {
|
||||||
/// possibly including a default implementation. A trait item is
|
/// possibly including a default implementation. A trait item is
|
||||||
/// either required (meaning it doesn't have an implementation, just a
|
/// either required (meaning it doesn't have an implementation, just a
|
||||||
/// signature) or provided (meaning it has a default implementation).
|
/// signature) or provided (meaning it has a default implementation).
|
||||||
#[derive(Debug)]
|
#[derive(Debug, HashStable_Generic)]
|
||||||
pub struct TraitItem<'hir> {
|
pub struct TraitItem<'hir> {
|
||||||
pub ident: Ident,
|
pub ident: Ident,
|
||||||
pub def_id: LocalDefId,
|
pub def_id: LocalDefId,
|
||||||
|
@ -2122,7 +2122,7 @@ pub enum TraitItemKind<'hir> {
|
||||||
// The bodies for items are stored "out of line", in a separate
|
// The bodies for items are stored "out of line", in a separate
|
||||||
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
||||||
// so it can fetched later.
|
// so it can fetched later.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug, HashStable_Generic)]
|
||||||
pub struct ImplItemId {
|
pub struct ImplItemId {
|
||||||
pub def_id: LocalDefId,
|
pub def_id: LocalDefId,
|
||||||
}
|
}
|
||||||
|
@ -2136,7 +2136,7 @@ impl ImplItemId {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents anything within an `impl` block.
|
/// Represents anything within an `impl` block.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, HashStable_Generic)]
|
||||||
pub struct ImplItem<'hir> {
|
pub struct ImplItem<'hir> {
|
||||||
pub ident: Ident,
|
pub ident: Ident,
|
||||||
pub def_id: LocalDefId,
|
pub def_id: LocalDefId,
|
||||||
|
@ -2637,7 +2637,7 @@ pub struct PolyTraitRef<'hir> {
|
||||||
|
|
||||||
pub type Visibility<'hir> = Spanned<VisibilityKind<'hir>>;
|
pub type Visibility<'hir> = Spanned<VisibilityKind<'hir>>;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug, HashStable_Generic)]
|
||||||
pub enum VisibilityKind<'hir> {
|
pub enum VisibilityKind<'hir> {
|
||||||
Public,
|
Public,
|
||||||
Crate(CrateSugar),
|
Crate(CrateSugar),
|
||||||
|
@ -2713,7 +2713,7 @@ impl<'hir> VariantData<'hir> {
|
||||||
// The bodies for items are stored "out of line", in a separate
|
// The bodies for items are stored "out of line", in a separate
|
||||||
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
||||||
// so it can fetched later.
|
// so it can fetched later.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug, Hash, HashStable_Generic)]
|
||||||
pub struct ItemId {
|
pub struct ItemId {
|
||||||
pub def_id: LocalDefId,
|
pub def_id: LocalDefId,
|
||||||
}
|
}
|
||||||
|
@ -2729,7 +2729,7 @@ impl ItemId {
|
||||||
/// An item
|
/// An item
|
||||||
///
|
///
|
||||||
/// The name might be a dummy name in case of anonymous items
|
/// The name might be a dummy name in case of anonymous items
|
||||||
#[derive(Debug)]
|
#[derive(Debug, HashStable_Generic)]
|
||||||
pub struct Item<'hir> {
|
pub struct Item<'hir> {
|
||||||
pub ident: Ident,
|
pub ident: Ident,
|
||||||
pub def_id: LocalDefId,
|
pub def_id: LocalDefId,
|
||||||
|
@ -2960,7 +2960,7 @@ pub enum AssocItemKind {
|
||||||
// The bodies for items are stored "out of line", in a separate
|
// The bodies for items are stored "out of line", in a separate
|
||||||
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
// hashmap in the `Crate`. Here we just record the hir-id of the item
|
||||||
// so it can fetched later.
|
// so it can fetched later.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Debug, HashStable_Generic)]
|
||||||
pub struct ForeignItemId {
|
pub struct ForeignItemId {
|
||||||
pub def_id: LocalDefId,
|
pub def_id: LocalDefId,
|
||||||
}
|
}
|
||||||
|
@ -2986,7 +2986,7 @@ pub struct ForeignItemRef {
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug, HashStable_Generic)]
|
||||||
pub struct ForeignItem<'hir> {
|
pub struct ForeignItem<'hir> {
|
||||||
pub ident: Ident,
|
pub ident: Ident,
|
||||||
pub kind: ForeignItemKind<'hir>,
|
pub kind: ForeignItemKind<'hir>,
|
||||||
|
@ -3028,7 +3028,7 @@ pub struct Upvar {
|
||||||
// The TraitCandidate's import_ids is empty if the trait is defined in the same module, and
|
// The TraitCandidate's import_ids is empty if the trait is defined in the same module, and
|
||||||
// has length > 0 if the trait is found through an chain of imports, starting with the
|
// has length > 0 if the trait is found through an chain of imports, starting with the
|
||||||
// import/use statement in the scope where the trait is used.
|
// import/use statement in the scope where the trait is used.
|
||||||
#[derive(Encodable, Decodable, Clone, Debug)]
|
#[derive(Encodable, Decodable, Clone, Debug, HashStable_Generic)]
|
||||||
pub struct TraitCandidate {
|
pub struct TraitCandidate {
|
||||||
pub def_id: DefId,
|
pub def_id: DefId,
|
||||||
pub import_ids: SmallVec<[LocalDefId; 1]>,
|
pub import_ids: SmallVec<[LocalDefId; 1]>,
|
||||||
|
|
|
@ -12,7 +12,7 @@ use std::fmt;
|
||||||
/// incremental compilation where we have to persist things through changes to
|
/// incremental compilation where we have to persist things through changes to
|
||||||
/// the code base.
|
/// the code base.
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
||||||
#[derive(Encodable, Decodable)]
|
#[derive(Encodable, Decodable, HashStable_Generic)]
|
||||||
#[rustc_pass_by_value]
|
#[rustc_pass_by_value]
|
||||||
pub struct HirId {
|
pub struct HirId {
|
||||||
pub owner: LocalDefId,
|
pub owner: LocalDefId,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
|
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey};
|
||||||
|
|
||||||
use crate::hir::{
|
use crate::hir::{
|
||||||
AttributeMap, BodyId, Crate, Expr, ForeignItem, ForeignItemId, ImplItem, ImplItemId, Item,
|
AttributeMap, BodyId, Crate, Expr, ForeignItemId, ImplItemId, ItemId, OwnerNodes, TraitItemId,
|
||||||
ItemId, OwnerNodes, TraitCandidate, TraitItem, TraitItemId, Ty, VisibilityKind,
|
Ty,
|
||||||
};
|
};
|
||||||
use crate::hir_id::{HirId, ItemLocalId};
|
use crate::hir_id::{HirId, ItemLocalId};
|
||||||
use rustc_span::def_id::DefPathHash;
|
use rustc_span::def_id::DefPathHash;
|
||||||
|
@ -13,14 +13,9 @@ use rustc_span::def_id::DefPathHash;
|
||||||
pub trait HashStableContext:
|
pub trait HashStableContext:
|
||||||
rustc_ast::HashStableContext + rustc_target::HashStableContext
|
rustc_ast::HashStableContext + rustc_target::HashStableContext
|
||||||
{
|
{
|
||||||
fn hash_hir_id(&mut self, _: HirId, hasher: &mut StableHasher);
|
|
||||||
fn hash_body_id(&mut self, _: BodyId, hasher: &mut StableHasher);
|
fn hash_body_id(&mut self, _: BodyId, hasher: &mut StableHasher);
|
||||||
fn hash_reference_to_item(&mut self, _: HirId, hasher: &mut StableHasher);
|
|
||||||
fn hash_hir_expr(&mut self, _: &Expr<'_>, hasher: &mut StableHasher);
|
fn hash_hir_expr(&mut self, _: &Expr<'_>, hasher: &mut StableHasher);
|
||||||
fn hash_hir_ty(&mut self, _: &Ty<'_>, hasher: &mut StableHasher);
|
fn hash_hir_ty(&mut self, _: &Ty<'_>, hasher: &mut StableHasher);
|
||||||
fn hash_hir_visibility_kind(&mut self, _: &VisibilityKind<'_>, hasher: &mut StableHasher);
|
|
||||||
fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, f: F);
|
|
||||||
fn hash_hir_trait_candidate(&mut self, _: &TraitCandidate, hasher: &mut StableHasher);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for HirId {
|
impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for HirId {
|
||||||
|
@ -88,12 +83,6 @@ impl<HirCtx: crate::HashStableContext> ToStableHashKey<HirCtx> for ForeignItemId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for HirId {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
hcx.hash_hir_id(*self, hasher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for BodyId {
|
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for BodyId {
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
||||||
hcx.hash_body_id(*self, hasher)
|
hcx.hash_body_id(*self, hasher)
|
||||||
|
@ -107,30 +96,6 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for BodyId {
|
||||||
// want to pick up on a reference changing its target, so we hash the NodeIds
|
// want to pick up on a reference changing its target, so we hash the NodeIds
|
||||||
// in "DefPath Mode".
|
// in "DefPath Mode".
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ItemId {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
hcx.hash_reference_to_item(self.hir_id(), hasher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ForeignItemId {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
hcx.hash_reference_to_item(self.hir_id(), hasher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ImplItemId {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
hcx.hash_reference_to_item(self.hir_id(), hasher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitItemId {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
hcx.hash_reference_to_item(self.hir_id(), hasher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for Expr<'_> {
|
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for Expr<'_> {
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
||||||
hcx.hash_hir_expr(self, hasher)
|
hcx.hash_hir_expr(self, hasher)
|
||||||
|
@ -143,65 +108,6 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for Ty<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for VisibilityKind<'_> {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
hcx.hash_hir_visibility_kind(self, hasher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitItem<'_> {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
let TraitItem { def_id: _, ident, ref generics, ref kind, span } = *self;
|
|
||||||
|
|
||||||
hcx.hash_hir_item_like(|hcx| {
|
|
||||||
ident.name.hash_stable(hcx, hasher);
|
|
||||||
generics.hash_stable(hcx, hasher);
|
|
||||||
kind.hash_stable(hcx, hasher);
|
|
||||||
span.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ImplItem<'_> {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
let ImplItem { def_id: _, ident, ref vis, ref generics, ref kind, span } = *self;
|
|
||||||
|
|
||||||
hcx.hash_hir_item_like(|hcx| {
|
|
||||||
ident.name.hash_stable(hcx, hasher);
|
|
||||||
vis.hash_stable(hcx, hasher);
|
|
||||||
generics.hash_stable(hcx, hasher);
|
|
||||||
kind.hash_stable(hcx, hasher);
|
|
||||||
span.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for ForeignItem<'_> {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
let ForeignItem { def_id: _, ident, ref kind, span, ref vis } = *self;
|
|
||||||
|
|
||||||
hcx.hash_hir_item_like(|hcx| {
|
|
||||||
ident.name.hash_stable(hcx, hasher);
|
|
||||||
kind.hash_stable(hcx, hasher);
|
|
||||||
span.hash_stable(hcx, hasher);
|
|
||||||
vis.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for Item<'_> {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
let Item { ident, def_id: _, ref kind, ref vis, span } = *self;
|
|
||||||
|
|
||||||
hcx.hash_hir_item_like(|hcx| {
|
|
||||||
ident.name.hash_stable(hcx, hasher);
|
|
||||||
kind.hash_stable(hcx, hasher);
|
|
||||||
vis.hash_stable(hcx, hasher);
|
|
||||||
span.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for OwnerNodes<'tcx> {
|
impl<'tcx, HirCtx: crate::HashStableContext> HashStable<HirCtx> for OwnerNodes<'tcx> {
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
||||||
// We ignore the `nodes` and `bodies` fields since these refer to information included in
|
// We ignore the `nodes` and `bodies` fields since these refer to information included in
|
||||||
|
@ -235,9 +141,3 @@ impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for Crate<'_> {
|
||||||
hir_hash.hash_stable(hcx, hasher)
|
hir_hash.hash_stable(hcx, hasher)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<HirCtx: crate::HashStableContext> HashStable<HirCtx> for TraitCandidate {
|
|
||||||
fn hash_stable(&self, hcx: &mut HirCtx, hasher: &mut StableHasher) {
|
|
||||||
hcx.hash_hir_trait_candidate(self, hasher)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxHashMap;
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
use rustc_macros::HashStable;
|
use rustc_macros::HashStable;
|
||||||
use rustc_query_system::ich::{NodeIdHashingMode, StableHashingContext};
|
use rustc_query_system::ich::StableHashingContext;
|
||||||
use rustc_span::def_id::LocalDefId;
|
use rustc_span::def_id::LocalDefId;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
|
||||||
|
@ -58,9 +58,7 @@ impl<Id> Default for AccessLevels<Id> {
|
||||||
|
|
||||||
impl<'a> HashStable<StableHashingContext<'a>> for AccessLevels {
|
impl<'a> HashStable<StableHashingContext<'a>> for AccessLevels {
|
||||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
let AccessLevels { ref map } = *self;
|
||||||
let AccessLevels { ref map } = *self;
|
map.hash_stable(hcx, hasher);
|
||||||
map.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::Node;
|
use rustc_hir::Node;
|
||||||
use rustc_macros::HashStable;
|
use rustc_macros::HashStable;
|
||||||
use rustc_query_system::ich::{NodeIdHashingMode, StableHashingContext};
|
use rustc_query_system::ich::StableHashingContext;
|
||||||
use rustc_span::{Span, DUMMY_SP};
|
use rustc_span::{Span, DUMMY_SP};
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -446,10 +446,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for ScopeTree {
|
||||||
ref yield_in_scope,
|
ref yield_in_scope,
|
||||||
} = *self;
|
} = *self;
|
||||||
|
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
root_body.hash_stable(hcx, hasher);
|
||||||
root_body.hash_stable(hcx, hasher)
|
|
||||||
});
|
|
||||||
|
|
||||||
body_expr_count.hash_stable(hcx, hasher);
|
body_expr_count.hash_stable(hcx, hasher);
|
||||||
parent_map.hash_stable(hcx, hasher);
|
parent_map.hash_stable(hcx, hasher);
|
||||||
var_map.hash_stable(hcx, hasher);
|
var_map.hash_stable(hcx, hasher);
|
||||||
|
|
|
@ -8,7 +8,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
|
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
|
||||||
use rustc_hir::ItemId;
|
use rustc_hir::ItemId;
|
||||||
use rustc_index::vec::Idx;
|
use rustc_index::vec::Idx;
|
||||||
use rustc_query_system::ich::{NodeIdHashingMode, StableHashingContext};
|
use rustc_query_system::ich::StableHashingContext;
|
||||||
use rustc_session::config::OptLevel;
|
use rustc_session::config::OptLevel;
|
||||||
use rustc_span::source_map::Span;
|
use rustc_span::source_map::Span;
|
||||||
use rustc_span::symbol::Symbol;
|
use rustc_span::symbol::Symbol;
|
||||||
|
@ -40,7 +40,7 @@ pub enum InstantiationMode {
|
||||||
LocalCopy,
|
LocalCopy,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Eq, Clone, Copy, Debug, Hash)]
|
#[derive(PartialEq, Eq, Clone, Copy, Debug, Hash, HashStable)]
|
||||||
pub enum MonoItem<'tcx> {
|
pub enum MonoItem<'tcx> {
|
||||||
Fn(Instance<'tcx>),
|
Fn(Instance<'tcx>),
|
||||||
Static(DefId),
|
Static(DefId),
|
||||||
|
@ -202,26 +202,6 @@ impl<'tcx> MonoItem<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for MonoItem<'tcx> {
|
|
||||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
|
||||||
::std::mem::discriminant(self).hash_stable(hcx, hasher);
|
|
||||||
|
|
||||||
match *self {
|
|
||||||
MonoItem::Fn(ref instance) => {
|
|
||||||
instance.hash_stable(hcx, hasher);
|
|
||||||
}
|
|
||||||
MonoItem::Static(def_id) => {
|
|
||||||
def_id.hash_stable(hcx, hasher);
|
|
||||||
}
|
|
||||||
MonoItem::GlobalAsm(item_id) => {
|
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
item_id.hash_stable(hcx, hasher);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'tcx> fmt::Display for MonoItem<'tcx> {
|
impl<'tcx> fmt::Display for MonoItem<'tcx> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
|
|
|
@ -47,7 +47,7 @@ use rustc_hir::{
|
||||||
use rustc_index::vec::{Idx, IndexVec};
|
use rustc_index::vec::{Idx, IndexVec};
|
||||||
use rustc_macros::HashStable;
|
use rustc_macros::HashStable;
|
||||||
use rustc_middle::mir::FakeReadCause;
|
use rustc_middle::mir::FakeReadCause;
|
||||||
use rustc_query_system::ich::{NodeIdHashingMode, StableHashingContext};
|
use rustc_query_system::ich::StableHashingContext;
|
||||||
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
|
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
|
||||||
use rustc_session::config::{BorrowckMode, CrateType, OutputFilenames};
|
use rustc_session::config::{BorrowckMode, CrateType, OutputFilenames};
|
||||||
use rustc_session::lint::{Level, Lint};
|
use rustc_session::lint::{Level, Lint};
|
||||||
|
@ -367,7 +367,7 @@ pub struct GeneratorInteriorTypeCause<'tcx> {
|
||||||
pub expr: Option<hir::HirId>,
|
pub expr: Option<hir::HirId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(TyEncodable, TyDecodable, Debug)]
|
#[derive(TyEncodable, TyDecodable, Debug, HashStable)]
|
||||||
pub struct TypeckResults<'tcx> {
|
pub struct TypeckResults<'tcx> {
|
||||||
/// The `HirId::owner` all `ItemLocalId`s in this table are relative to.
|
/// The `HirId::owner` all `ItemLocalId`s in this table are relative to.
|
||||||
pub hir_owner: LocalDefId,
|
pub hir_owner: LocalDefId,
|
||||||
|
@ -783,62 +783,6 @@ impl<'tcx> TypeckResults<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for TypeckResults<'tcx> {
|
|
||||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
|
||||||
let ty::TypeckResults {
|
|
||||||
hir_owner,
|
|
||||||
ref type_dependent_defs,
|
|
||||||
ref field_indices,
|
|
||||||
ref user_provided_types,
|
|
||||||
ref user_provided_sigs,
|
|
||||||
ref node_types,
|
|
||||||
ref node_substs,
|
|
||||||
ref adjustments,
|
|
||||||
ref pat_binding_modes,
|
|
||||||
ref pat_adjustments,
|
|
||||||
ref closure_kind_origins,
|
|
||||||
ref liberated_fn_sigs,
|
|
||||||
ref fru_field_types,
|
|
||||||
ref coercion_casts,
|
|
||||||
ref used_trait_imports,
|
|
||||||
tainted_by_errors,
|
|
||||||
ref concrete_opaque_types,
|
|
||||||
ref closure_min_captures,
|
|
||||||
ref closure_fake_reads,
|
|
||||||
ref generator_interior_types,
|
|
||||||
ref treat_byte_string_as_slice,
|
|
||||||
ref closure_size_eval,
|
|
||||||
} = *self;
|
|
||||||
|
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
hcx.local_def_path_hash(hir_owner);
|
|
||||||
|
|
||||||
type_dependent_defs.hash_stable(hcx, hasher);
|
|
||||||
field_indices.hash_stable(hcx, hasher);
|
|
||||||
user_provided_types.hash_stable(hcx, hasher);
|
|
||||||
user_provided_sigs.hash_stable(hcx, hasher);
|
|
||||||
node_types.hash_stable(hcx, hasher);
|
|
||||||
node_substs.hash_stable(hcx, hasher);
|
|
||||||
adjustments.hash_stable(hcx, hasher);
|
|
||||||
pat_binding_modes.hash_stable(hcx, hasher);
|
|
||||||
pat_adjustments.hash_stable(hcx, hasher);
|
|
||||||
|
|
||||||
closure_kind_origins.hash_stable(hcx, hasher);
|
|
||||||
liberated_fn_sigs.hash_stable(hcx, hasher);
|
|
||||||
fru_field_types.hash_stable(hcx, hasher);
|
|
||||||
coercion_casts.hash_stable(hcx, hasher);
|
|
||||||
used_trait_imports.hash_stable(hcx, hasher);
|
|
||||||
tainted_by_errors.hash_stable(hcx, hasher);
|
|
||||||
concrete_opaque_types.hash_stable(hcx, hasher);
|
|
||||||
closure_min_captures.hash_stable(hcx, hasher);
|
|
||||||
closure_fake_reads.hash_stable(hcx, hasher);
|
|
||||||
generator_interior_types.hash_stable(hcx, hasher);
|
|
||||||
treat_byte_string_as_slice.hash_stable(hcx, hasher);
|
|
||||||
closure_size_eval.hash_stable(hcx, hasher);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rustc_index::newtype_index! {
|
rustc_index::newtype_index! {
|
||||||
pub struct UserTypeAnnotationIndex {
|
pub struct UserTypeAnnotationIndex {
|
||||||
derive [HashStable]
|
derive [HashStable]
|
||||||
|
|
|
@ -18,7 +18,6 @@ use rustc_hir as hir;
|
||||||
use rustc_hir::def::{CtorOf, DefKind, Res};
|
use rustc_hir::def::{CtorOf, DefKind, Res};
|
||||||
use rustc_hir::def_id::DefId;
|
use rustc_hir::def_id::DefId;
|
||||||
use rustc_macros::HashStable;
|
use rustc_macros::HashStable;
|
||||||
use rustc_query_system::ich::NodeIdHashingMode;
|
|
||||||
use rustc_span::{sym, DUMMY_SP};
|
use rustc_span::{sym, DUMMY_SP};
|
||||||
use rustc_target::abi::{Integer, Size, TargetDataLayout};
|
use rustc_target::abi::{Integer, Size, TargetDataLayout};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
|
@ -136,11 +135,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
// regions, which is desirable too.
|
// regions, which is desirable too.
|
||||||
let ty = self.erase_regions(ty);
|
let ty = self.erase_regions(ty);
|
||||||
|
|
||||||
hcx.while_hashing_spans(false, |hcx| {
|
hcx.while_hashing_spans(false, |hcx| ty.hash_stable(hcx, &mut hasher));
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
ty.hash_stable(hcx, &mut hasher);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
hasher.finish()
|
hasher.finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,7 @@ use crate::ich;
|
||||||
use rustc_ast as ast;
|
use rustc_ast as ast;
|
||||||
use rustc_data_structures::fx::FxHashSet;
|
use rustc_data_structures::fx::FxHashSet;
|
||||||
use rustc_data_structures::sorted_map::SortedMap;
|
use rustc_data_structures::sorted_map::SortedMap;
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
use rustc_data_structures::stable_hasher::{HashStable, HashingControls, StableHasher};
|
||||||
use rustc_data_structures::stable_hasher::{HashingControls, NodeIdHashingMode};
|
|
||||||
use rustc_data_structures::sync::Lrc;
|
use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||||
|
@ -69,10 +68,7 @@ impl<'a> StableHashingContext<'a> {
|
||||||
incremental_ignore_spans: sess.opts.debugging_opts.incremental_ignore_spans,
|
incremental_ignore_spans: sess.opts.debugging_opts.incremental_ignore_spans,
|
||||||
caching_source_map: None,
|
caching_source_map: None,
|
||||||
raw_source_map: sess.source_map(),
|
raw_source_map: sess.source_map(),
|
||||||
hashing_controls: HashingControls {
|
hashing_controls: HashingControls { hash_spans: hash_spans_initial },
|
||||||
hash_spans: hash_spans_initial,
|
|
||||||
node_id_hashing_mode: NodeIdHashingMode::HashDefPath,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,18 +134,6 @@ impl<'a> StableHashingContext<'a> {
|
||||||
self.hashing_controls.hash_spans = prev_hash_spans;
|
self.hashing_controls.hash_spans = prev_hash_spans;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn with_node_id_hashing_mode<F: FnOnce(&mut Self)>(
|
|
||||||
&mut self,
|
|
||||||
mode: NodeIdHashingMode,
|
|
||||||
f: F,
|
|
||||||
) {
|
|
||||||
let prev = self.hashing_controls.node_id_hashing_mode;
|
|
||||||
self.hashing_controls.node_id_hashing_mode = mode;
|
|
||||||
f(self);
|
|
||||||
self.hashing_controls.node_id_hashing_mode = prev;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn def_path_hash(&self, def_id: DefId) -> DefPathHash {
|
pub fn def_path_hash(&self, def_id: DefId) -> DefPathHash {
|
||||||
if let Some(def_id) = def_id.as_local() {
|
if let Some(def_id) = def_id.as_local() {
|
||||||
|
@ -233,9 +217,7 @@ impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> {
|
||||||
|
|
||||||
impl<'a> rustc_data_structures::intern::InternedHashingContext for StableHashingContext<'a> {
|
impl<'a> rustc_data_structures::intern::InternedHashingContext for StableHashingContext<'a> {
|
||||||
fn with_def_path_and_no_spans(&mut self, f: impl FnOnce(&mut Self)) {
|
fn with_def_path_and_no_spans(&mut self, f: impl FnOnce(&mut Self)) {
|
||||||
self.while_hashing_spans(false, |hcx| {
|
self.while_hashing_spans(false, f);
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| f(hcx))
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,28 +2,11 @@
|
||||||
//! types in no particular order.
|
//! types in no particular order.
|
||||||
|
|
||||||
use crate::ich::hcx::BodyResolver;
|
use crate::ich::hcx::BodyResolver;
|
||||||
use crate::ich::{NodeIdHashingMode, StableHashingContext};
|
use crate::ich::StableHashingContext;
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use std::mem;
|
|
||||||
|
|
||||||
impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
|
impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
|
||||||
#[inline]
|
|
||||||
fn hash_hir_id(&mut self, hir_id: hir::HirId, hasher: &mut StableHasher) {
|
|
||||||
let hcx = self;
|
|
||||||
match hcx.hashing_controls.node_id_hashing_mode {
|
|
||||||
NodeIdHashingMode::Ignore => {
|
|
||||||
// Don't do anything.
|
|
||||||
}
|
|
||||||
NodeIdHashingMode::HashDefPath => {
|
|
||||||
let hir::HirId { owner, local_id } = hir_id;
|
|
||||||
|
|
||||||
hcx.local_def_path_hash(owner).hash_stable(hcx, hasher);
|
|
||||||
local_id.hash_stable(hcx, hasher);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn hash_body_id(&mut self, id: hir::BodyId, hasher: &mut StableHasher) {
|
fn hash_body_id(&mut self, id: hir::BodyId, hasher: &mut StableHasher) {
|
||||||
let hcx = self;
|
let hcx = self;
|
||||||
|
@ -37,19 +20,11 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn hash_reference_to_item(&mut self, id: hir::HirId, hasher: &mut StableHasher) {
|
|
||||||
let hcx = self;
|
|
||||||
|
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
id.hash_stable(hcx, hasher);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fn hash_hir_expr(&mut self, expr: &hir::Expr<'_>, hasher: &mut StableHasher) {
|
fn hash_hir_expr(&mut self, expr: &hir::Expr<'_>, hasher: &mut StableHasher) {
|
||||||
self.while_hashing_hir_bodies(true, |hcx| {
|
self.while_hashing_hir_bodies(true, |hcx| {
|
||||||
let hir::Expr { hir_id: _, ref span, ref kind } = *expr;
|
let hir::Expr { hir_id, ref span, ref kind } = *expr;
|
||||||
|
|
||||||
|
hir_id.hash_stable(hcx, hasher);
|
||||||
span.hash_stable(hcx, hasher);
|
span.hash_stable(hcx, hasher);
|
||||||
kind.hash_stable(hcx, hasher);
|
kind.hash_stable(hcx, hasher);
|
||||||
})
|
})
|
||||||
|
@ -57,66 +32,11 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
|
||||||
|
|
||||||
fn hash_hir_ty(&mut self, ty: &hir::Ty<'_>, hasher: &mut StableHasher) {
|
fn hash_hir_ty(&mut self, ty: &hir::Ty<'_>, hasher: &mut StableHasher) {
|
||||||
self.while_hashing_hir_bodies(true, |hcx| {
|
self.while_hashing_hir_bodies(true, |hcx| {
|
||||||
let hir::Ty { hir_id: _, ref kind, ref span } = *ty;
|
let hir::Ty { hir_id, ref kind, ref span } = *ty;
|
||||||
|
|
||||||
|
hir_id.hash_stable(hcx, hasher);
|
||||||
kind.hash_stable(hcx, hasher);
|
kind.hash_stable(hcx, hasher);
|
||||||
span.hash_stable(hcx, hasher);
|
span.hash_stable(hcx, hasher);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn hash_hir_visibility_kind(
|
|
||||||
&mut self,
|
|
||||||
vis: &hir::VisibilityKind<'_>,
|
|
||||||
hasher: &mut StableHasher,
|
|
||||||
) {
|
|
||||||
let hcx = self;
|
|
||||||
mem::discriminant(vis).hash_stable(hcx, hasher);
|
|
||||||
match *vis {
|
|
||||||
hir::VisibilityKind::Public | hir::VisibilityKind::Inherited => {
|
|
||||||
// No fields to hash.
|
|
||||||
}
|
|
||||||
hir::VisibilityKind::Crate(sugar) => {
|
|
||||||
sugar.hash_stable(hcx, hasher);
|
|
||||||
}
|
|
||||||
hir::VisibilityKind::Restricted { ref path, hir_id } => {
|
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
hir_id.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
path.hash_stable(hcx, hasher);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, f: F) {
|
|
||||||
let prev_hash_node_ids = self.hashing_controls.node_id_hashing_mode;
|
|
||||||
self.hashing_controls.node_id_hashing_mode = NodeIdHashingMode::Ignore;
|
|
||||||
|
|
||||||
f(self);
|
|
||||||
|
|
||||||
self.hashing_controls.node_id_hashing_mode = prev_hash_node_ids;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn hash_hir_trait_candidate(&mut self, tc: &hir::TraitCandidate, hasher: &mut StableHasher) {
|
|
||||||
self.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
|
||||||
let hir::TraitCandidate { def_id, import_ids } = tc;
|
|
||||||
|
|
||||||
def_id.hash_stable(hcx, hasher);
|
|
||||||
import_ids.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> HashStable<StableHashingContext<'a>> for hir::Body<'_> {
|
|
||||||
#[inline]
|
|
||||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
|
||||||
let hir::Body { params, value, generator_kind } = self;
|
|
||||||
|
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::Ignore, |hcx| {
|
|
||||||
params.hash_stable(hcx, hasher);
|
|
||||||
value.hash_stable(hcx, hasher);
|
|
||||||
generator_kind.hash_stable(hcx, hasher);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
//! ICH - Incremental Compilation Hash
|
//! ICH - Incremental Compilation Hash
|
||||||
|
|
||||||
pub use self::hcx::StableHashingContext;
|
pub use self::hcx::StableHashingContext;
|
||||||
pub use rustc_data_structures::stable_hasher::NodeIdHashingMode;
|
|
||||||
use rustc_span::symbol::{sym, Symbol};
|
use rustc_span::symbol::{sym, Symbol};
|
||||||
|
|
||||||
mod hcx;
|
mod hcx;
|
||||||
|
|
|
@ -117,7 +117,7 @@ fn assert_default_hashing_controls<CTX: HashStableContext>(ctx: &CTX, msg: &str)
|
||||||
// `-Z incremental-ignore-spans` option. Normally, this option is disabled,
|
// `-Z incremental-ignore-spans` option. Normally, this option is disabled,
|
||||||
// which will cause us to require that this method always be called with `Span` hashing
|
// which will cause us to require that this method always be called with `Span` hashing
|
||||||
// enabled.
|
// enabled.
|
||||||
HashingControls { hash_spans, node_id_hashing_mode: _ }
|
HashingControls { hash_spans }
|
||||||
if hash_spans == !ctx.debug_opts_incremental_ignore_spans() => {}
|
if hash_spans == !ctx.debug_opts_incremental_ignore_spans() => {}
|
||||||
other => panic!("Attempted hashing of {msg} with non-default HashingControls: {:?}", other),
|
other => panic!("Attempted hashing of {msg} with non-default HashingControls: {:?}", other),
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ use rustc_middle::ty::print::{PrettyPrinter, Print, Printer};
|
||||||
use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
|
use rustc_middle::ty::subst::{GenericArg, GenericArgKind};
|
||||||
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable};
|
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable};
|
||||||
use rustc_middle::util::common::record_time;
|
use rustc_middle::util::common::record_time;
|
||||||
use rustc_query_system::ich::NodeIdHashingMode;
|
|
||||||
|
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
|
@ -111,30 +110,28 @@ fn get_symbol_hash<'tcx>(
|
||||||
// ought to be the same for every reference anyway.
|
// ought to be the same for every reference anyway.
|
||||||
assert!(!item_type.has_erasable_regions());
|
assert!(!item_type.has_erasable_regions());
|
||||||
hcx.while_hashing_spans(false, |hcx| {
|
hcx.while_hashing_spans(false, |hcx| {
|
||||||
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
|
item_type.hash_stable(hcx, &mut hasher);
|
||||||
item_type.hash_stable(hcx, &mut hasher);
|
|
||||||
|
|
||||||
// If this is a function, we hash the signature as well.
|
// If this is a function, we hash the signature as well.
|
||||||
// This is not *strictly* needed, but it may help in some
|
// This is not *strictly* needed, but it may help in some
|
||||||
// situations, see the `run-make/a-b-a-linker-guard` test.
|
// situations, see the `run-make/a-b-a-linker-guard` test.
|
||||||
if let ty::FnDef(..) = item_type.kind() {
|
if let ty::FnDef(..) = item_type.kind() {
|
||||||
item_type.fn_sig(tcx).hash_stable(hcx, &mut hasher);
|
item_type.fn_sig(tcx).hash_stable(hcx, &mut hasher);
|
||||||
}
|
}
|
||||||
|
|
||||||
// also include any type parameters (for generic items)
|
// also include any type parameters (for generic items)
|
||||||
substs.hash_stable(hcx, &mut hasher);
|
substs.hash_stable(hcx, &mut hasher);
|
||||||
|
|
||||||
if let Some(instantiating_crate) = instantiating_crate {
|
if let Some(instantiating_crate) = instantiating_crate {
|
||||||
tcx.def_path_hash(instantiating_crate.as_def_id())
|
tcx.def_path_hash(instantiating_crate.as_def_id())
|
||||||
.stable_crate_id()
|
.stable_crate_id()
|
||||||
.hash_stable(hcx, &mut hasher);
|
.hash_stable(hcx, &mut hasher);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want to avoid accidental collision between different types of instances.
|
// We want to avoid accidental collision between different types of instances.
|
||||||
// Especially, `VtableShim`s and `ReifyShim`s may overlap with their original
|
// Especially, `VtableShim`s and `ReifyShim`s may overlap with their original
|
||||||
// instances without this.
|
// instances without this.
|
||||||
discriminant(&instance.def).hash_stable(hcx, &mut hasher);
|
discriminant(&instance.def).hash_stable(hcx, &mut hasher);
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,9 @@ pub fn change_condition(x: bool) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn change_condition(x: bool) -> u32 {
|
pub fn change_condition(x: bool) -> u32 {
|
||||||
if !x {
|
if !x {
|
||||||
|
@ -106,9 +106,9 @@ pub fn add_else_branch(x: bool) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_else_branch(x: bool) -> u32 {
|
pub fn add_else_branch(x: bool) -> u32 {
|
||||||
let mut ret = 1;
|
let mut ret = 1;
|
||||||
|
@ -159,9 +159,9 @@ pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
|
pub fn change_then_branch_if_let(x: Option<u32>) -> u32 {
|
||||||
if let Some(x) = x {
|
if let Some(x) = x {
|
||||||
|
@ -212,9 +212,9 @@ pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,typeck,optimized_mir")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,typeck,optimized_mir")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {
|
pub fn add_else_branch_if_let(x: Option<u32>) -> u32 {
|
||||||
let mut ret = 1;
|
let mut ret = 1;
|
||||||
|
|
|
@ -77,9 +77,9 @@ fn add_lower_bound(slice: &[u32]) -> &[u32] {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail2")]
|
#[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail2")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail5")]
|
#[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail5")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
fn add_lower_bound(slice: &[u32]) -> &[u32] {
|
fn add_lower_bound(slice: &[u32]) -> &[u32] {
|
||||||
&slice[3..4]
|
&slice[3..4]
|
||||||
|
@ -94,9 +94,9 @@ fn add_upper_bound(slice: &[u32]) -> &[u32] {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail2")]
|
#[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail2")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail5")]
|
#[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail5")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
fn add_upper_bound(slice: &[u32]) -> &[u32] {
|
fn add_upper_bound(slice: &[u32]) -> &[u32] {
|
||||||
&slice[3..7]
|
&slice[3..7]
|
||||||
|
@ -128,9 +128,9 @@ fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail2")]
|
#[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail2")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(except="hir_owner_nodes,typeck", cfg="cfail5")]
|
#[rustc_clean(except="hir_owner,hir_owner_nodes,typeck", cfg="cfail5")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] {
|
fn exclusive_to_inclusive_range(slice: &[u32]) -> &[u32] {
|
||||||
&slice[3..=7]
|
&slice[3..=7]
|
||||||
|
|
|
@ -31,9 +31,9 @@ pub fn add_arm(x: u32) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_arm(x: u32) -> u32 {
|
pub fn add_arm(x: u32) -> u32 {
|
||||||
match x {
|
match x {
|
||||||
|
@ -82,9 +82,9 @@ pub fn add_guard_clause(x: u32, y: bool) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_guard_clause(x: u32, y: bool) -> u32 {
|
pub fn add_guard_clause(x: u32, y: bool) -> u32 {
|
||||||
match x {
|
match x {
|
||||||
|
@ -107,9 +107,9 @@ pub fn change_guard_clause(x: u32, y: bool) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn change_guard_clause(x: u32, y: bool) -> u32 {
|
pub fn change_guard_clause(x: u32, y: bool) -> u32 {
|
||||||
match x {
|
match x {
|
||||||
|
@ -132,9 +132,9 @@ pub fn add_at_binding(x: u32) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_at_binding(x: u32) -> u32 {
|
pub fn add_at_binding(x: u32) -> u32 {
|
||||||
match x {
|
match x {
|
||||||
|
@ -181,9 +181,9 @@ pub fn change_simple_name_to_pattern(x: u32) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn change_simple_name_to_pattern(x: u32) -> u32 {
|
pub fn change_simple_name_to_pattern(x: u32) -> u32 {
|
||||||
match (x, x & 1) {
|
match (x, x & 1) {
|
||||||
|
@ -275,9 +275,9 @@ pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
|
pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
|
||||||
match (&x, x & 1) {
|
match (&x, x & 1) {
|
||||||
|
@ -324,9 +324,9 @@ pub fn add_alternative_to_arm(x: u32) -> u32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_alternative_to_arm(x: u32) -> u32 {
|
pub fn add_alternative_to_arm(x: u32) -> u32 {
|
||||||
match x {
|
match x {
|
||||||
|
|
|
@ -93,9 +93,9 @@ pub fn add_field_regular_struct() -> RegularStruct {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(cfail1,cfail4)))]
|
#[cfg(not(any(cfail1,cfail4)))]
|
||||||
#[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail3")]
|
#[rustc_clean(cfg="cfail3")]
|
||||||
#[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
|
#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,optimized_mir,typeck")]
|
||||||
#[rustc_clean(cfg="cfail6")]
|
#[rustc_clean(cfg="cfail6")]
|
||||||
pub fn add_field_regular_struct() -> RegularStruct {
|
pub fn add_field_regular_struct() -> RegularStruct {
|
||||||
let struct1 = RegularStruct {
|
let struct1 = RegularStruct {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue