Fix too-short variance slice in variances_of cycle recovery#158163
Open
xmakro wants to merge 1 commit into
Open
Fix too-short variance slice in variances_of cycle recovery#158163xmakro wants to merge 1 commit into
variances_of cycle recovery#158163xmakro wants to merge 1 commit into
Conversation
Contributor
|
(Please un-draft the PR and mark it as waiting on review when you think it's ready.) |
Contributor
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 27, 2026
…y-count, r=petrochenkov Fix too-short variance slice in `variances_of` cycle recovery This changes the cycle-error fallback in `variances_of` to size the slice the same way the provider does in [`variance/solve.rs:117`](https://github.com/rust-lang/rust/blob/32ea3615cc027bcb8fd720c7511ffb484f6223a3/compiler/rustc_hir_analysis/src/variance/solve.rs#L117). This can otherwise ICE under the parallel frontend in `relate_args_with_variances` for items that inherit their generics from a parent (like a tuple struct constructor). See rust-lang#154560 (comment)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #137858 (Add new `unused_footnote_definition` rustdoc lint) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #137858 (Add new `unused_footnote_definition` rustdoc lint) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #137858 (Add new `unused_footnote_definition` rustdoc lint) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 6 pull requests Successful merges: - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #137858 (Add new `unused_footnote_definition` rustdoc lint) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 27, 2026
…y-count, r=petrochenkov Fix too-short variance slice in `variances_of` cycle recovery This changes the cycle-error fallback in `variances_of` to size the slice the same way the provider does in [`variance/solve.rs:117`](https://github.com/rust-lang/rust/blob/32ea3615cc027bcb8fd720c7511ffb484f6223a3/compiler/rustc_hir_analysis/src/variance/solve.rs#L117). This can otherwise ICE under the parallel frontend in `relate_args_with_variances` for items that inherit their generics from a parent (like a tuple struct constructor). See rust-lang#154560 (comment)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 10 pull requests Successful merges: - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume") - #152225 (Add supertrait item shadowing for type-level path resolution) - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs) - #158501 (miri subtree update) - #153097 (Expand `OptionFlatten`'s iterator methods) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 10 pull requests Successful merges: - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume") - #152225 (Add supertrait item shadowing for type-level path resolution) - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs) - #158501 (miri subtree update) - #153097 (Expand `OptionFlatten`'s iterator methods) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 10 pull requests Successful merges: - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume") - #152225 (Add supertrait item shadowing for type-level path resolution) - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs) - #158501 (miri subtree update) - #153097 (Expand `OptionFlatten`'s iterator methods) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 27, 2026
…uwer Rollup of 10 pull requests Successful merges: - #158502 (Revert "LLVM 23: Adapt codegen test to moved assume") - #152225 (Add supertrait item shadowing for type-level path resolution) - #158194 (Adds RmetaLinkCache a per-link cache that uses path as the key of dec…) - #158466 (rustdoc: show impl Trait<Box<Local>> for Foreign, etc on Local's docs) - #158501 (miri subtree update) - #153097 (Expand `OptionFlatten`'s iterator methods) - #158163 (Fix too-short variance slice in `variances_of` cycle recovery) - #158233 (Allow the unstable attribute on foreign type) - #158470 (Upgrade `jsonsocck` and `jsondoclint` to edition 2024.) - #158488 (Upgrade `rustdoc-json-types` to 2024 edition.)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 28, 2026
…y-count, r=petrochenkov Fix too-short variance slice in `variances_of` cycle recovery This changes the cycle-error fallback in `variances_of` to size the slice the same way the provider does in [`variance/solve.rs:117`](https://github.com/rust-lang/rust/blob/32ea3615cc027bcb8fd720c7511ffb484f6223a3/compiler/rustc_hir_analysis/src/variance/solve.rs#L117). This can otherwise ICE under the parallel frontend in `relate_args_with_variances` for items that inherit their generics from a parent (like a tuple struct constructor). See rust-lang#154560 (comment)
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 28, 2026
…y-count, r=petrochenkov Fix too-short variance slice in `variances_of` cycle recovery This changes the cycle-error fallback in `variances_of` to size the slice the same way the provider does in [`variance/solve.rs:117`](https://github.com/rust-lang/rust/blob/32ea3615cc027bcb8fd720c7511ffb484f6223a3/compiler/rustc_hir_analysis/src/variance/solve.rs#L117). This can otherwise ICE under the parallel frontend in `relate_args_with_variances` for items that inherit their generics from a parent (like a tuple struct constructor). See rust-lang#154560 (comment)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes the cycle-error fallback in
variances_ofto size the slice the same way the provider does invariance/solve.rs:117.This can otherwise ICE under the parallel frontend in
relate_args_with_variancesfor items that inherit their generics from a parent (like a tuple struct constructor). See #154560 (comment)