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
30 changed files with 153 additions and 91 deletions

View File

@@ -206,8 +206,9 @@ impl<'tcx> TyCtxt<'tcx> {
mut ty: Ty<'tcx>,
normalize: impl Fn(Ty<'tcx>) -> Ty<'tcx>,
) -> Ty<'tcx> {
let recursion_limit = self.recursion_limit(());
for iteration in 0.. {
if !self.sess.recursion_limit().value_within_limit(iteration) {
if !recursion_limit.value_within_limit(iteration) {
return self.ty_error_with_message(
DUMMY_SP,
&format!("reached the recursion limit finding the struct tail for {}", ty),