1
Fork 0

Convert adt_sized_constraint to early-binder, use list

This commit is contained in:
Michael Goulet 2023-08-01 00:52:16 +00:00
parent abd3637e42
commit 8696fa71b3
5 changed files with 12 additions and 9 deletions

View file

@ -706,7 +706,7 @@ rustc_queries! {
separate_provide_extern
}
query adt_sized_constraint(key: DefId) -> &'tcx [Ty<'tcx>] {
query adt_sized_constraint(key: DefId) -> ty::EarlyBinder<&'tcx ty::List<Ty<'tcx>>> {
desc { |tcx| "computing `Sized` constraints for `{}`", tcx.def_path_str(key) }
}

View file

@ -572,8 +572,8 @@ impl<'tcx> AdtDef<'tcx> {
///
/// Due to normalization being eager, this applies even if
/// the associated type is behind a pointer (e.g., issue #31299).
pub fn sized_constraint(self, tcx: TyCtxt<'tcx>) -> ty::EarlyBinder<&'tcx [Ty<'tcx>]> {
ty::EarlyBinder::bind(tcx.adt_sized_constraint(self.did()))
pub fn sized_constraint(self, tcx: TyCtxt<'tcx>) -> ty::EarlyBinder<&'tcx ty::List<Ty<'tcx>>> {
tcx.adt_sized_constraint(self.did())
}
}