overflow errors: change source to a concrete enum

This commit is contained in:
lcnr
2024-01-15 15:06:25 +01:00
parent f392a870e9
commit f7cdff825c
15 changed files with 126 additions and 91 deletions

View File

@@ -5,6 +5,7 @@
use crate::infer::at::At;
use crate::infer::canonical::OriginalQueryValues;
use crate::infer::{InferCtxt, InferOk};
use crate::traits::error_reporting::OverflowCause;
use crate::traits::error_reporting::TypeErrCtxtExt;
use crate::traits::normalize::needs_normalization;
use crate::traits::{BoundVarReplacer, PlaceholderReplacer};
@@ -228,7 +229,11 @@ impl<'cx, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'cx, 'tcx>
let guar = self
.infcx
.err_ctxt()
.build_overflow_error(&ty, self.cause.span, true)
.build_overflow_error(
OverflowCause::DeeplyNormalize(data),
self.cause.span,
true,
)
.delay_as_bug();
return Ok(Ty::new_error(self.interner(), guar));
}