Avoid noting cause code (which is usually misc, b/c codegen) for opaque type reveal overflow

This commit is contained in:
Michael Goulet 2022-12-06 00:19:42 +00:00
parent e940f845be
commit d2a80c1571
6 changed files with 82 additions and 51 deletions

View file

@ -504,14 +504,12 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
Reveal::All => {
let recursion_limit = self.tcx().recursion_limit();
if !recursion_limit.value_within_limit(self.depth) {
let obligation = Obligation::with_depth(
self.tcx(),
self.cause.clone(),
recursion_limit.0,
self.param_env,
ty,
self.selcx.infcx.err_ctxt().report_overflow_error(
&ty,
self.cause.span,
true,
|_| {},
);
self.selcx.infcx.err_ctxt().report_overflow_error(&obligation, true);
}
let substs = substs.fold_with(self);