Skip to content

Commit

Permalink
Auto merge of rust-lang#116330 - RalfJung:dont-key-on-allocid, r=oli-obk
Browse files Browse the repository at this point in the history
remove Key impls for types that involve an AllocId

I don't understand how but somehow that leads to issues like rust-lang#83085? Anyway removing unused impls doesn't seem like a bad idea. The concerning part is that of course nothing will stop us from having such impls again in the future, alongside re-introducing bugs like rust-lang#83085.

r? `@oli-obk`
  • Loading branch information
bors committed Oct 7, 2023
2 parents 91db3bd + 8dc92a3 commit 935a091
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions compiler/rustc_middle/src/query/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use rustc_hir::hir_id::{HirId, OwnerId};
use rustc_query_system::query::{DefaultCacheSelector, SingleCacheSelector, VecCacheSelector};
use rustc_span::symbol::{Ident, Symbol};
use rustc_span::{Span, DUMMY_SP};
use rustc_target::abi::FieldIdx;

/// Placeholder for `CrateNum`'s "local" counterpart
#[derive(Copy, Clone, Debug)]
Expand Down Expand Up @@ -360,30 +359,6 @@ impl<'tcx> Key for (ty::ParamEnv<'tcx>, ty::TraitRef<'tcx>) {
}
}

impl<'tcx> Key for (ty::Const<'tcx>, FieldIdx) {
type CacheSelector = DefaultCacheSelector<Self>;

fn default_span(&self, _: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}

impl<'tcx> Key for (mir::ConstValue<'tcx>, Ty<'tcx>) {
type CacheSelector = DefaultCacheSelector<Self>;

fn default_span(&self, _: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}

impl<'tcx> Key for mir::ConstAlloc<'tcx> {
type CacheSelector = DefaultCacheSelector<Self>;

fn default_span(&self, _: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}

impl<'tcx> Key for ty::PolyTraitRef<'tcx> {
type CacheSelector = DefaultCacheSelector<Self>;

Expand Down Expand Up @@ -416,14 +391,6 @@ impl<'tcx> Key for GenericArg<'tcx> {
}
}

impl<'tcx> Key for mir::Const<'tcx> {
type CacheSelector = DefaultCacheSelector<Self>;

fn default_span(&self, _: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}

impl<'tcx> Key for ty::Const<'tcx> {
type CacheSelector = DefaultCacheSelector<Self>;

Expand Down

0 comments on commit 935a091

Please sign in to comment.