1
Fork 0

Make folding traits generic over the Interner

This commit is contained in:
Alan Egerton 2023-02-11 09:13:27 +00:00
parent dea342d861
commit 9783fcc13b
No known key found for this signature in database
GPG key ID: 7D4C2F6C22122532
39 changed files with 160 additions and 130 deletions

View file

@ -464,7 +464,7 @@ struct RemapLateBound<'a, 'tcx> {
mapping: &'a FxHashMap<ty::BoundRegionKind, ty::BoundRegionKind>,
}
impl<'tcx> TypeFolder<'tcx> for RemapLateBound<'_, 'tcx> {
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for RemapLateBound<'_, 'tcx> {
fn tcx(&self) -> TyCtxt<'tcx> {
self.tcx
}
@ -829,7 +829,7 @@ impl<'a, 'tcx> ImplTraitInTraitCollector<'a, 'tcx> {
}
}
impl<'tcx> TypeFolder<'tcx> for ImplTraitInTraitCollector<'_, 'tcx> {
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ImplTraitInTraitCollector<'_, 'tcx> {
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
self.ocx.infcx.tcx
}

View file

@ -850,7 +850,7 @@ fn infer_placeholder_type<'a>(
tcx: TyCtxt<'tcx>,
}
impl<'tcx> TypeFolder<'tcx> for MakeNameable<'tcx> {
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for MakeNameable<'tcx> {
fn tcx(&self) -> TyCtxt<'tcx> {
self.tcx
}

View file

@ -189,7 +189,7 @@ struct EraseAllBoundRegions<'tcx> {
// us an inaccurate span for an error message, but cannot
// lead to unsoundness (we call `delay_span_bug` at the start
// of `diagnostic_hir_wf_check`).
impl<'tcx> TypeFolder<'tcx> for EraseAllBoundRegions<'tcx> {
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for EraseAllBoundRegions<'tcx> {
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
self.tcx
}