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%) |
…=ShoyuVanilla Normalize region obligations before regionck We now normalize `TypeOutlives` predicates when evaluating them in the next solver. So we don't need to normalize in regionck anymore. r? @ShoyuVanilla cc @lcnr
…uwer Rollup of 14 pull requests Successful merges: - #158417 (Avoid ICE when cfg_eval recovers no item from derive input) - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`) - #159554 (feat: Update method signature of int_from_ascii) - #159637 (Some place analysis tweaks) - #159649 (Normalize region obligations before regionck) - #159961 (sanitize_standard_fds: Miri supports poll now) - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs) - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static) - #159804 (Expand docs for fs::metadata and fs::symlink_metadata) - #159821 (Update expect message using the recommended style in binary_heap module) - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver) - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`) - #159991 (std: make send_process_group_signal unsupported on VxWorks) - #159996 (Detect when a macro without exclamation mark uses square brackets)
Rollup merge of #159649 - adwinwhite:norm-before-regionck, r=ShoyuVanilla Normalize region obligations before regionck We now normalize `TypeOutlives` predicates when evaluating them in the next solver. So we don't need to normalize in regionck anymore. r? @ShoyuVanilla cc @lcnr
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#158417 (Avoid ICE when cfg_eval recovers no item from derive input) - rust-lang/rust#159085 (Fix decoding attributes of `SyntheticCoroutineBody`) - rust-lang/rust#159554 (feat: Update method signature of int_from_ascii) - rust-lang/rust#159637 (Some place analysis tweaks) - rust-lang/rust#159649 (Normalize region obligations before regionck) - rust-lang/rust#159961 (sanitize_standard_fds: Miri supports poll now) - rust-lang/rust#159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs) - rust-lang/rust#159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static) - rust-lang/rust#159804 (Expand docs for fs::metadata and fs::symlink_metadata) - rust-lang/rust#159821 (Update expect message using the recommended style in binary_heap module) - rust-lang/rust#159840 (Fix opaque type ICE in late lints under the next-generation trait solver) - rust-lang/rust#159956 (Fix observable intermediate state in `thread::add_spawn_hook`) - rust-lang/rust#159991 (std: make send_process_group_signal unsupported on VxWorks) - rust-lang/rust#159996 (Detect when a macro without exclamation mark uses square brackets)
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