Remove impl_polarity query
This commit is contained in:
parent
b43fbe63e7
commit
74c9dffac3
@ -79,7 +79,6 @@ pub fn provide(providers: &mut Providers) {
|
||||
adt_def,
|
||||
fn_sig,
|
||||
impl_trait_header,
|
||||
impl_polarity,
|
||||
coroutine_kind,
|
||||
coroutine_for_closure,
|
||||
collect_mod_item_types,
|
||||
@ -1394,11 +1393,6 @@ fn check_impl_constness(
|
||||
}))
|
||||
}
|
||||
|
||||
fn impl_polarity(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::ImplPolarity {
|
||||
let item = tcx.hir().expect_item(def_id);
|
||||
polarity_of_impl(tcx, def_id, item.expect_impl(), item.span)
|
||||
}
|
||||
|
||||
fn polarity_of_impl(
|
||||
tcx: TyCtxt<'_>,
|
||||
def_id: LocalDefId,
|
||||
|
@ -234,7 +234,6 @@ fn into_args(self) -> (DefId, SimplifiedType) {
|
||||
unused_generic_params => { cdata.root.tables.unused_generic_params.get(cdata, def_id.index) }
|
||||
def_kind => { cdata.def_kind(def_id.index) }
|
||||
impl_parent => { table }
|
||||
impl_polarity => { table_direct }
|
||||
defaultness => { table_direct }
|
||||
constness => { table_direct }
|
||||
coerce_unsized_info => {
|
||||
|
@ -1969,7 +1969,6 @@ fn encode_impls(&mut self) -> LazyArray<TraitImpls> {
|
||||
let def_id = id.owner_id.to_def_id();
|
||||
|
||||
self.tables.defaultness.set_some(def_id.index, tcx.defaultness(def_id));
|
||||
self.tables.impl_polarity.set_some(def_id.index, tcx.impl_polarity(def_id));
|
||||
|
||||
if of_trait && let Some(header) = tcx.impl_trait_header(def_id) {
|
||||
record!(self.tables.impl_trait_header[def_id] <- header);
|
||||
|
@ -433,7 +433,6 @@ fn encode(&self, buf: &mut FileEncoder) -> LazyTables {
|
||||
promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,
|
||||
thir_abstract_const: Table<DefIndex, LazyValue<ty::EarlyBinder<ty::Const<'static>>>>,
|
||||
impl_parent: Table<DefIndex, RawDefId>,
|
||||
impl_polarity: Table<DefIndex, ty::ImplPolarity>,
|
||||
constness: Table<DefIndex, hir::Constness>,
|
||||
defaultness: Table<DefIndex, hir::Defaultness>,
|
||||
// FIXME(eddyb) perhaps compute this on the fly if cheap enough?
|
||||
|
@ -853,10 +853,6 @@
|
||||
cache_on_disk_if { impl_id.is_local() }
|
||||
separate_provide_extern
|
||||
}
|
||||
query impl_polarity(impl_id: DefId) -> ty::ImplPolarity {
|
||||
desc { |tcx| "computing implementation polarity of `{}`", tcx.def_path_str(impl_id) }
|
||||
separate_provide_extern
|
||||
}
|
||||
|
||||
query issue33140_self_ty(key: DefId) -> Option<ty::EarlyBinder<ty::Ty<'tcx>>> {
|
||||
desc { |tcx| "computing Self type wrt issue #33140 `{}`", tcx.def_path_str(key) }
|
||||
|
@ -2317,6 +2317,11 @@ pub fn impl_trait_ref(
|
||||
) -> Option<ty::EarlyBinder<ty::TraitRef<'tcx>>> {
|
||||
Some(self.impl_trait_header(def_id)?.map_bound(|h| h.trait_ref))
|
||||
}
|
||||
|
||||
pub fn impl_polarity(self, def_id: impl IntoQueryParam<DefId>) -> ty::ImplPolarity {
|
||||
self.impl_trait_header(def_id)
|
||||
.map_or(ty::ImplPolarity::Positive, |h| h.skip_binder().polarity)
|
||||
}
|
||||
}
|
||||
|
||||
/// Parameter attributes that can only be determined by examining the body of a function instead
|
||||
|
Loading…
Reference in New Issue
Block a user