Fix hypothetical ICE in variances_of#153709
Conversation
This comment has been minimized.
This comment has been minimized.
|
Seems plausible, but please add a short description that explains the current situation and how/why this PR improves things. Currently the only descriptive word is "cleanup" which tells the reader very little. cc @Zoxc |
Updated the top comment. Is it good? |
|
It's an improvement, but it still doesn't explain what was going wrong in #127971 and how that has been fixed. The new |
This comment has been minimized.
This comment has been minimized.
This PR basically eliminates panic that have caused #127971 and avoids
Previously there was: tcx.dcx().abort_if_errors();
unreachable!()Now compare it to let Some(guar) = tcx.sess.dcx().has_errors() else {
bug!(
"`from_cycle_error_default` on query `{query_name}` called without errors: {:#?}",
cycle_error.cycle,
);
};
guar.raise_fatal()These are essentially the same. I've only changed |
This comment has been minimized.
This comment has been minimized.
|
A better PR title would be something like "Fix ICE in A better commit message would be something like this:
This explains the current situation and the change in a way that is meaningful to a reader who isn't already familiar with #127971. |
|
Needs rebasing over #153694, and the title/description/commit messages updated as described above. |
variances_of
b597c04 to
567f8bd
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
|
@bors r+ rollup |
…up, r=nnethercote Fix hypothetical ICE in `variances_of` A cleanup based on rust-lang#153694. ~~This PR changes panic messages in `fn_sig`'s `value_from_cycle_error` to more fitting ones.~~ Also this PR makes `variances_of`'s `value_from_cycle_error` to utilize new query key argument instead of extracting it from `CycleError`. Closes rust-lang#127971 r? @nnethercote
This comment has been minimized.
This comment has been minimized.
variances_of currently used search_for_cycle_permutation, which can fail and abort when constructed error result value does not match query input. This commit changes variances_of to receive a def_id which means it can compute a value without using search_for_cycle_permutation, avoiding the possible abort. Fixes rust-lang#127971
567f8bd to
b5e53dc
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 r+ |
…up, r=nnethercote Fix hypothetical ICE in `variances_of` A cleanup based on rust-lang#153694. ~~This PR changes panic messages in `fn_sig`'s `value_from_cycle_error` to more fitting ones.~~ Also this PR makes `variances_of`'s `value_from_cycle_error` to utilize new query key argument instead of extracting it from `CycleError`. Closes rust-lang#127971 r? @nnethercote
Rollup of 7 pull requests Successful merges: - #153801 (Add the option to run UI tests with the parallel frontend) - #153967 (Tweak wording of failed predicate in inference error) - #152968 (Flip "region lattice" in RegionKind doc comment) - #153531 (Fix LegacyKeyValueFormat report from docker build: various) - #153709 (Fix hypothetical ICE in `variances_of`) - #153884 (test `classify-runtime-const` for `f16`) - #153946 (dissolve `tests/ui/cross`)
…uwer Rollup of 14 pull requests Successful merges: - #153972 (stdarch subtree update) - #153801 (Add the option to run UI tests with the parallel frontend) - #153959 (Fix non-module `parent_module` in stripped cfg diagnostics) - #153967 (Tweak wording of failed predicate in inference error) - #152968 (Flip "region lattice" in RegionKind doc comment) - #153531 (Fix LegacyKeyValueFormat report from docker build: various) - #153622 (remove concept of soft-unstable features) - #153709 (Fix hypothetical ICE in `variances_of`) - #153884 (test `classify-runtime-const` for `f16`) - #153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding) - #153920 (improve `#[track_caller]` invalid ABI error) - #153946 (dissolve `tests/ui/cross`) - #153965 (Fix minor kasan bugs) - #153991 (Small report_cycle refactor)
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#153972 (stdarch subtree update) - rust-lang/rust#153801 (Add the option to run UI tests with the parallel frontend) - rust-lang/rust#153959 (Fix non-module `parent_module` in stripped cfg diagnostics) - rust-lang/rust#153967 (Tweak wording of failed predicate in inference error) - rust-lang/rust#152968 (Flip "region lattice" in RegionKind doc comment) - rust-lang/rust#153531 (Fix LegacyKeyValueFormat report from docker build: various) - rust-lang/rust#153622 (remove concept of soft-unstable features) - rust-lang/rust#153709 (Fix hypothetical ICE in `variances_of`) - rust-lang/rust#153884 (test `classify-runtime-const` for `f16`) - rust-lang/rust#153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding) - rust-lang/rust#153920 (improve `#[track_caller]` invalid ABI error) - rust-lang/rust#153946 (dissolve `tests/ui/cross`) - rust-lang/rust#153965 (Fix minor kasan bugs) - rust-lang/rust#153991 (Small report_cycle refactor)
…uwer Rollup of 14 pull requests Successful merges: - rust-lang/rust#153972 (stdarch subtree update) - rust-lang/rust#153801 (Add the option to run UI tests with the parallel frontend) - rust-lang/rust#153959 (Fix non-module `parent_module` in stripped cfg diagnostics) - rust-lang/rust#153967 (Tweak wording of failed predicate in inference error) - rust-lang/rust#152968 (Flip "region lattice" in RegionKind doc comment) - rust-lang/rust#153531 (Fix LegacyKeyValueFormat report from docker build: various) - rust-lang/rust#153622 (remove concept of soft-unstable features) - rust-lang/rust#153709 (Fix hypothetical ICE in `variances_of`) - rust-lang/rust#153884 (test `classify-runtime-const` for `f16`) - rust-lang/rust#153894 (Point at unit structs on foreign crates in type errors when they are the pattern of a binding) - rust-lang/rust#153920 (improve `#[track_caller]` invalid ABI error) - rust-lang/rust#153946 (dissolve `tests/ui/cross`) - rust-lang/rust#153965 (Fix minor kasan bugs) - rust-lang/rust#153991 (Small report_cycle refactor)
A cleanup based on #153694.
This PR changes panic messages inAlso this PR makesfn_sig'svalue_from_cycle_errorto more fitting ones.variances_of'svalue_from_cycle_errorto utilize new query key argument instead of extracting it fromCycleError.Closes #127971
r? @nnethercote