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:
parent
c1db4dc242
commit
f6fea83342
23 changed files with 40 additions and 97 deletions
|
@ -86,11 +86,9 @@ impl<'tcx> MonoItem<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn is_generic_fn(&self, tcx: TyCtxt<'tcx>) -> bool {
|
||||
pub fn is_generic_fn(&self) -> bool {
|
||||
match self {
|
||||
MonoItem::Fn(instance) => {
|
||||
instance.args.non_erasable_generics(tcx, instance.def_id()).next().is_some()
|
||||
}
|
||||
MonoItem::Fn(instance) => instance.args.non_erasable_generics().next().is_some(),
|
||||
MonoItem::Static(..) | MonoItem::GlobalAsm(..) => false,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ impl<'tcx> Ty<'tcx> {
|
|||
/// ADTs with no type arguments.
|
||||
pub fn is_simple_text(self, tcx: TyCtxt<'tcx>) -> bool {
|
||||
match self.kind() {
|
||||
Adt(def, args) => args.non_erasable_generics(tcx, def.did()).next().is_none(),
|
||||
Adt(_, args) => args.non_erasable_generics().next().is_none(),
|
||||
Ref(_, ty, _) => ty.is_simple_text(tcx),
|
||||
_ => self.is_simple_ty(),
|
||||
}
|
||||
|
|
|
@ -501,9 +501,6 @@ impl<'tcx> GenericArgs<'tcx> {
|
|||
#[inline]
|
||||
pub fn non_erasable_generics(
|
||||
&'tcx self,
|
||||
// FIXME(effects): Remove these
|
||||
_tcx: TyCtxt<'tcx>,
|
||||
_def_id: DefId,
|
||||
) -> impl DoubleEndedIterator<Item = GenericArgKind<'tcx>> + 'tcx {
|
||||
self.iter().filter_map(|k| match k.unpack() {
|
||||
ty::GenericArgKind::Lifetime(_) => None,
|
||||
|
|
|
@ -360,7 +360,6 @@ impl<'tcx> Generics {
|
|||
pub struct GenericPredicates<'tcx> {
|
||||
pub parent: Option<DefId>,
|
||||
pub predicates: &'tcx [(Clause<'tcx>, Span)],
|
||||
pub effects_min_tys: &'tcx ty::List<Ty<'tcx>>,
|
||||
}
|
||||
|
||||
impl<'tcx> GenericPredicates<'tcx> {
|
||||
|
|
|
@ -204,7 +204,7 @@ impl<'tcx> Instance<'tcx> {
|
|||
}
|
||||
|
||||
// If this a non-generic instance, it cannot be a shared monomorphization.
|
||||
self.args.non_erasable_generics(tcx, self.def_id()).next()?;
|
||||
self.args.non_erasable_generics().next()?;
|
||||
|
||||
// compiler_builtins cannot use upstream monomorphizations.
|
||||
if tcx.is_compiler_builtins(LOCAL_CRATE) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue