-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
DeeplyNormalize and normalize_with_depth_to take Unnormalized<T> as input
#158668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1394,24 +1394,17 @@ impl<'tcx> InferCtxt<'tcx> { | |
| } | ||
| } | ||
|
|
||
| // Instantiates the bound variables in a given binder with fresh inference | ||
| // variables in the current universe. | ||
| // | ||
| // Use this method if you'd like to find some generic parameters of the binder's | ||
| // variables (e.g. during a method call). If there isn't a [`BoundRegionConversionTime`] | ||
| // that corresponds to your use case, consider whether or not you should | ||
| // use [`InferCtxt::enter_forall`] instead. | ||
| pub fn instantiate_binder_with_fresh_vars<T>( | ||
| pub fn instantiate_binder_with_fresh_vars_unnormalized<T>( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this one is interesting 🤔 cc #156453 https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/Eager.20normalization.2C.20ahoy.21/near/593190304 and https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/we.20didn.27t.20have.20enough.20normalization.20threads.20yet/with/599149011 see the zulip discussion for more details. Whether this requires a renormalization is unclear and in most places it does not. Can you remove this change from this PR and instead maybe do this in a followup, if at all. |
||
| &self, | ||
| span: Span, | ||
| lbrct: BoundRegionConversionTime, | ||
| value: ty::Binder<'tcx, T>, | ||
| ) -> T | ||
| ) -> ty::Unnormalized<'tcx, T> | ||
| where | ||
| T: TypeFoldable<TyCtxt<'tcx>> + Copy, | ||
| { | ||
| if let Some(inner) = value.no_bound_vars() { | ||
| return inner; | ||
| return ty::Unnormalized::new(inner); | ||
| } | ||
|
|
||
| let bound_vars = value.bound_vars(); | ||
|
|
@@ -1444,7 +1437,26 @@ impl<'tcx> InferCtxt<'tcx> { | |
| } | ||
| } | ||
| let delegate = ToFreshVars { args }; | ||
| self.tcx.replace_bound_vars_uncached(value, delegate) | ||
| ty::Unnormalized::new(self.tcx.replace_bound_vars_uncached(value, delegate)) | ||
| } | ||
|
|
||
| // Instantiates the bound variables in a given binder with fresh inference | ||
| // variables in the current universe. | ||
| // | ||
| // Use this method if you'd like to find some generic parameters of the binder's | ||
| // variables (e.g. during a method call). If there isn't a [`BoundRegionConversionTime`] | ||
| // that corresponds to your use case, consider whether or not you should | ||
| // use [`InferCtxt::enter_forall`] instead. | ||
| pub fn instantiate_binder_with_fresh_vars<T>( | ||
| &self, | ||
| span: Span, | ||
| lbrct: BoundRegionConversionTime, | ||
| value: ty::Binder<'tcx, T>, | ||
| ) -> T | ||
| where | ||
| T: TypeFoldable<TyCtxt<'tcx>> + Copy, | ||
| { | ||
| self.instantiate_binder_with_fresh_vars_unnormalized(span, lbrct, value).skip_norm_wip() | ||
| } | ||
|
|
||
| /// See the [`region_constraints::RegionConstraintCollector::verify_generic_bound`] method. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.