Remove type-traversal trait aliases
This commit is contained in:
@@ -3,8 +3,7 @@ use std::ops::ControlFlow;
|
||||
use rustc_data_structures::intern::Interned;
|
||||
|
||||
use crate::ty::{
|
||||
ir::{self, TypeFoldable, TypeVisitable},
|
||||
FallibleTypeFolder, Ty, TyCtxt, TypeFolder, TypeVisitor,
|
||||
FallibleTypeFolder, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeVisitable, TypeVisitor,
|
||||
};
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
|
||||
@@ -27,8 +26,11 @@ pub struct ExternalConstraintsData<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExternalConstraints<'tcx> {
|
||||
fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
|
||||
Ok(ir::FallibleTypeFolder::interner(folder).intern_external_constraints(
|
||||
fn try_fold_with<F: FallibleTypeFolder<TyCtxt<'tcx>>>(
|
||||
self,
|
||||
folder: &mut F,
|
||||
) -> Result<Self, F::Error> {
|
||||
Ok(FallibleTypeFolder::interner(folder).intern_external_constraints(
|
||||
ExternalConstraintsData {
|
||||
regions: (),
|
||||
opaque_types: self
|
||||
@@ -40,8 +42,8 @@ impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExternalConstraints<'tcx> {
|
||||
))
|
||||
}
|
||||
|
||||
fn fold_with<F: TypeFolder<'tcx>>(self, folder: &mut F) -> Self {
|
||||
ir::TypeFolder::interner(folder).intern_external_constraints(ExternalConstraintsData {
|
||||
fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(self, folder: &mut F) -> Self {
|
||||
TypeFolder::interner(folder).intern_external_constraints(ExternalConstraintsData {
|
||||
regions: (),
|
||||
opaque_types: self.opaque_types.iter().map(|opaque| opaque.fold_with(folder)).collect(),
|
||||
})
|
||||
@@ -49,7 +51,7 @@ impl<'tcx> TypeFoldable<TyCtxt<'tcx>> for ExternalConstraints<'tcx> {
|
||||
}
|
||||
|
||||
impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for ExternalConstraints<'tcx> {
|
||||
fn visit_with<V: TypeVisitor<'tcx>>(
|
||||
fn visit_with<V: TypeVisitor<TyCtxt<'tcx>>>(
|
||||
&self,
|
||||
visitor: &mut V,
|
||||
) -> std::ops::ControlFlow<V::BreakTy> {
|
||||
|
||||
Reference in New Issue
Block a user