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

@ -83,7 +83,7 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
ConstValue::from_machine_usize(adt.variants().len() as u64, &tcx)
}
ty::Projection(_)
| ty::Opaque(_, _)
| ty::Opaque(ty::OpaqueTy { def_id: _, substs: _ })
| ty::Param(_)
| ty::Placeholder(_)
| ty::Infer(_) => throw_inval!(TooGeneric),

View file

@ -241,7 +241,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
};
let kind = match parent_ty.ty.kind() {
&ty::Opaque(def_id, substs) => {
&ty::Opaque(ty::OpaqueTy { def_id, substs }) => {
self.tcx.bound_type_of(def_id).subst(self.tcx, substs).kind()
}
kind => kind,

View file

@ -58,7 +58,7 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
// Types with identity (print the module path).
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did: def_id, .. }, _)), substs)
| ty::FnDef(def_id, substs)
| ty::Opaque(def_id, substs)
| ty::Opaque(ty::OpaqueTy { def_id, substs })
| ty::Projection(ty::ProjectionTy { item_def_id: def_id, substs })
| ty::Closure(def_id, substs)
| ty::Generator(def_id, substs, _) => self.print_def_path(def_id, substs),