Skip to content

Commit

Permalink
Remove all uses of #[stable_hasher(project(...))] in order to mitigate
Browse files Browse the repository at this point in the history
incremental compilation related ICEs as reported in rust-lang#94124 for Rust 1.59.
  • Loading branch information
michaelwoerister committed Feb 21, 2022
1 parent 62afddb commit c479d2f
Show file tree
Hide file tree
Showing 10 changed files with 1,753 additions and 1,952 deletions.
8 changes: 0 additions & 8 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ impl Path<'_> {
#[derive(Debug, HashStable_Generic)]
pub struct PathSegment<'hir> {
/// The identifier portion of this path segment.
#[stable_hasher(project(name))]
pub ident: Ident,
// `id` and `res` are optional. We currently only use these in save-analysis,
// any path segments without these will not have save-analysis info and
Expand Down Expand Up @@ -850,7 +849,6 @@ pub struct PatField<'hir> {
#[stable_hasher(ignore)]
pub hir_id: HirId,
/// The identifier for the field.
#[stable_hasher(project(name))]
pub ident: Ident,
/// The pattern the field is destructured to.
pub pat: &'hir Pat<'hir>,
Expand Down Expand Up @@ -2127,7 +2125,6 @@ pub const FN_OUTPUT_NAME: Symbol = sym::Output;
#[derive(Debug, HashStable_Generic)]
pub struct TypeBinding<'hir> {
pub hir_id: HirId,
#[stable_hasher(project(name))]
pub ident: Ident,
pub gen_args: &'hir GenericArgs<'hir>,
pub kind: TypeBindingKind<'hir>,
Expand Down Expand Up @@ -2515,7 +2512,6 @@ pub struct EnumDef<'hir> {
#[derive(Debug, HashStable_Generic)]
pub struct Variant<'hir> {
/// Name of the variant.
#[stable_hasher(project(name))]
pub ident: Ident,
/// Id of the variant (not the constructor, see `VariantData::ctor_hir_id()`).
pub id: HirId,
Expand Down Expand Up @@ -2605,7 +2601,6 @@ impl VisibilityKind<'_> {
#[derive(Debug, HashStable_Generic)]
pub struct FieldDef<'hir> {
pub span: Span,
#[stable_hasher(project(name))]
pub ident: Ident,
pub vis: Visibility<'hir>,
pub hir_id: HirId,
Expand Down Expand Up @@ -2864,7 +2859,6 @@ impl ItemKind<'_> {
#[derive(Encodable, Debug, HashStable_Generic)]
pub struct TraitItemRef {
pub id: TraitItemId,
#[stable_hasher(project(name))]
pub ident: Ident,
pub kind: AssocItemKind,
pub span: Span,
Expand All @@ -2880,7 +2874,6 @@ pub struct TraitItemRef {
#[derive(Debug, HashStable_Generic)]
pub struct ImplItemRef {
pub id: ImplItemId,
#[stable_hasher(project(name))]
pub ident: Ident,
pub kind: AssocItemKind,
pub span: Span,
Expand Down Expand Up @@ -2919,7 +2912,6 @@ impl ForeignItemId {
#[derive(Debug, HashStable_Generic)]
pub struct ForeignItemRef {
pub id: ForeignItemId,
#[stable_hasher(project(name))]
pub ident: Ident,
pub span: Span,
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/assoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ impl AssocItemContainer {
#[derive(Copy, Clone, Debug, PartialEq, HashStable, Eq, Hash)]
pub struct AssocItem {
pub def_id: DefId,
#[stable_hasher(project(name))]
pub ident: Ident,
pub kind: AssocKind,
pub vis: Visibility,
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,6 @@ pub struct VariantDef {
/// If this variant is a struct variant, then this is `None`.
pub ctor_def_id: Option<DefId>,
/// Variant or struct name.
#[stable_hasher(project(name))]
pub ident: Ident,
/// Discriminant of this variant.
pub discr: VariantDiscr,
Expand Down Expand Up @@ -1598,7 +1597,6 @@ pub enum VariantDiscr {
#[derive(Debug, HashStable, TyEncodable, TyDecodable)]
pub struct FieldDef {
pub did: DefId,
#[stable_hasher(project(name))]
pub ident: Ident,
pub vis: Visibility,
}
Expand Down
Loading

0 comments on commit c479d2f

Please sign in to comment.