Normalize region obligations before regionck#159649
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
| /// This function assumes that all infer variables are already constrained. | ||
| /// | ||
| /// FIXME: this can probably be moved back to `rustc_infer` now that normalization is | ||
| /// on longer required. These two extention traits won't be needed then. |
There was a problem hiding this comment.
I didn't do this in this PR because a lot of stuff would be moved and I'm uncertain about some of them.
There was a problem hiding this comment.
want to put FIXME(#155345) here so that we do it as part of that refactor
| // `TypeOutlives` is structural, so we should try to opportunistically resolve all | ||
| // region vids before processing regions, so we have a better chance to match clauses | ||
| // in our param-env. | ||
| let sup_type = self.shallow_resolve(sup_type); |
There was a problem hiding this comment.
is that necessary/could we just use eager_resolve_vars here?
Hmm, also, shallow_resolve feels wrong? because we could have ?x which resolves to Vec<?y> where ?y can be resolved to u32 later on. I feel like this should have otherwise been resolve_vars_if_possible to recur into the type
There was a problem hiding this comment.
Without it we'll have unresolved infer var error later.
Yeah, it should be resolve_vars_if_possible. We had a resolve_vars_if_possible somewhere before.
There was a problem hiding this comment.
ye, my thoughts are that we could use
let (sup_type, sub_region) = eager_resolve_vars(self, (sup_type, sub_region));instead of
let sup_type = self.shallow_resolve(sup_type);
let (sup_type, sub_region) =
(sup_type, sub_region).fold_with(&mut OpportunisticRegionResolver::new(self));| } | ||
|
|
||
| self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes) | ||
| if ty.has_non_region_infer() || ty.has_non_rigid_aliases() { |
There was a problem hiding this comment.
comment please :>
| } | ||
| } | ||
| } | ||
| if let Some(type_outlives) = bound.as_type_outlives_clause() { |
There was a problem hiding this comment.
debug_assert: if next-solver && non-igid aliases => ICE
|
there's also |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| /// This function assumes that all infer variables are already constrained. | ||
| /// | ||
| /// FIXME: this can probably be moved back to `rustc_infer` now that normalization is | ||
| /// on longer required. These two extention traits won't be needed then. |
There was a problem hiding this comment.
| /// on longer required. These two extention traits won't be needed then. | |
| /// no longer required. These two extension traits won't be needed then. |
ce9170d to
f5b6af2
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Normalize region obligations before regionck
This comment has been minimized.
This comment has been minimized.
|
@bors try cancel |
|
Try build cancelled. Cancelled workflows: |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Normalize region obligations before regionck
This comment has been minimized.
This comment has been minimized.
d4e81d8 to
7c1c571
Compare
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (d85ff7e): comparison URL. Overall result: ❌✅ regressions and improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 6.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 486.724s -> 486.349s (-0.08%) |
View all comments
We now normalize
TypeOutlivespredicates when evaluating them in the next solver.So we don't need to normalize in regionck anymore.
r? @ShoyuVanilla
cc @lcnr