Query-ify global limit attribute handling

This commit is contained in:
Aaron Hill 2021-06-25 18:48:26 -05:00
parent 90442458ac
commit ff15b5e2c7
No known key found for this signature in database
GPG key ID: B4087E510E98B164
30 changed files with 153 additions and 91 deletions

View file

@ -344,7 +344,7 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
Reveal::UserFacing => ty,
Reveal::All => {
let recursion_limit = self.tcx().sess.recursion_limit();
let recursion_limit = self.tcx().recursion_limit(());
if !recursion_limit.value_within_limit(self.depth) {
let obligation = Obligation::with_depth(
self.cause.clone(),
@ -726,7 +726,7 @@ fn project_type<'cx, 'tcx>(
) -> Result<ProjectedTy<'tcx>, ProjectionTyError<'tcx>> {
debug!(?obligation, "project_type");
if !selcx.tcx().sess.recursion_limit().value_within_limit(obligation.recursion_depth) {
if !selcx.tcx().recursion_limit(()).value_within_limit(obligation.recursion_depth) {
debug!("project: overflow!");
// This should really be an immediate error, but some existing code
// relies on being able to recover from this.