1
Fork 0

Use ty::OpaqueTy everywhere

This commit is contained in:
Michael Goulet 2022-11-26 21:09:39 +00:00
parent 918ede6474
commit 7f3af72606
55 changed files with 156 additions and 118 deletions

View file

@ -1440,7 +1440,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) -> E
impl<'tcx> ty::visit::TypeVisitor<'tcx> for OpaqueTypeCollector {
fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
match *t.kind() {
ty::Opaque(def, _) => {
ty::Opaque(ty::OpaqueTy { def_id: def, substs: _ }) => {
self.0.push(def);
ControlFlow::CONTINUE
}

View file

@ -666,7 +666,7 @@ fn find_opaque_ty_constraints_for_tait(tcx: TyCtxt<'_>, def_id: LocalDefId) -> T
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
let scope = tcx.hir().get_defining_scope(hir_id);
let mut locator = ConstraintLocator { def_id: def_id, tcx, found: None, typeck_types: vec![] };
let mut locator = ConstraintLocator { def_id, tcx, found: None, typeck_types: vec![] };
debug!(?scope);
@ -803,7 +803,7 @@ fn find_opaque_ty_constraints_for_rpit(
if let Some(concrete) = concrete {
let scope = tcx.hir().local_def_id_to_hir_id(owner_def_id);
debug!(?scope);
let mut locator = ConstraintChecker { def_id: def_id, tcx, found: concrete };
let mut locator = ConstraintChecker { def_id, tcx, found: concrete };
match tcx.hir().get(scope) {
Node::Item(it) => intravisit::walk_item(&mut locator, it),

View file

@ -253,7 +253,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
self.add_constraints_from_invariant_substs(current, data.substs, variance);
}
ty::Opaque(_, substs) => {
ty::Opaque(ty::OpaqueTy { def_id: _, substs }) => {
self.add_constraints_from_invariant_substs(current, substs, variance);
}