Auto merge of #122392 - BoxyUwU:misc_cleanup, r=lcnr
misc cleanups from debugging something
rename `instantiate_canonical_with_fresh_inference_vars` to `instantiate_canonical` the substs for the canonical are not solely infer vars as that would be wildly wrong and it is rather confusing to see this method called and think that the entire canonicalization setup is completely broken when it is not 👍
also update region debug printing to be more like the custom impls for Ty/Const, right now regions in debug output are horribly verbose and make it incredibly hard to read but with this atleast boundvars and placeholders when debugging the new solver do not take up excessive amounts of space.
r? `@lcnr`
This commit is contained in:
@@ -61,7 +61,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||
Ok(output)
|
||||
}
|
||||
|
||||
pub(super) fn instantiate_canonical_with_fresh_inference_vars<T>(
|
||||
pub(super) fn instantiate_canonical<T>(
|
||||
&mut self,
|
||||
span: Span,
|
||||
canonical: &Canonical<'tcx, T>,
|
||||
@@ -69,8 +69,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||
where
|
||||
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
let (instantiated, _) =
|
||||
self.infcx.instantiate_canonical_with_fresh_inference_vars(span, canonical);
|
||||
let (instantiated, _) = self.infcx.instantiate_canonical(span, canonical);
|
||||
instantiated
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||
// (e.g., the `_` in the code above) with fresh variables.
|
||||
// Then replace the bound items in the fn sig with fresh variables,
|
||||
// so that they represent the view from "inside" the closure.
|
||||
let user_provided_sig = self
|
||||
.instantiate_canonical_with_fresh_inference_vars(body.span, &user_provided_poly_sig);
|
||||
let user_provided_sig = self.instantiate_canonical(body.span, &user_provided_poly_sig);
|
||||
let mut user_provided_sig = self.infcx.instantiate_binder_with_fresh_vars(
|
||||
body.span,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
|
||||
@@ -1109,7 +1109,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
||||
let tcx = self.tcx();
|
||||
for user_annotation in self.user_type_annotations {
|
||||
let CanonicalUserTypeAnnotation { span, ref user_ty, inferred_ty } = *user_annotation;
|
||||
let annotation = self.instantiate_canonical_with_fresh_inference_vars(span, user_ty);
|
||||
let annotation = self.instantiate_canonical(span, user_ty);
|
||||
if let ty::UserType::TypeOf(def, args) = annotation
|
||||
&& let DefKind::InlineConst = tcx.def_kind(def)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user