Effects cleanup

- removed extra bits from predicates queries that are no longer needed in the new system
- removed the need for `non_erasable_generics` to take in tcx and DefId, removed unused arguments in callers
This commit is contained in:
Deadbeef
2024-10-26 10:18:42 +08:00
parent c1db4dc242
commit f6fea83342
23 changed files with 40 additions and 97 deletions

View File

@@ -1,7 +1,6 @@
//! Bounds are restrictions applied to some types after they've been lowered from the HIR to the
//! [`rustc_middle::ty`] form.
use rustc_data_structures::fx::FxIndexMap;
use rustc_hir::LangItem;
use rustc_middle::ty::{self, Ty, TyCtxt, Upcast};
use rustc_span::Span;
@@ -25,7 +24,6 @@ use rustc_span::Span;
#[derive(Default, PartialEq, Eq, Clone, Debug)]
pub(crate) struct Bounds<'tcx> {
clauses: Vec<(ty::Clause<'tcx>, Span)>,
effects_min_tys: FxIndexMap<Ty<'tcx>, Span>,
}
impl<'tcx> Bounds<'tcx> {
@@ -96,15 +94,7 @@ impl<'tcx> Bounds<'tcx> {
}
}
pub(crate) fn clauses(
&self,
// FIXME(effects): remove tcx
_tcx: TyCtxt<'tcx>,
) -> impl Iterator<Item = (ty::Clause<'tcx>, Span)> + '_ {
pub(crate) fn clauses(&self) -> impl Iterator<Item = (ty::Clause<'tcx>, Span)> + '_ {
self.clauses.iter().cloned()
}
pub(crate) fn effects_min_tys(&self) -> impl Iterator<Item = Ty<'tcx>> + '_ {
self.effects_min_tys.keys().copied()
}
}