-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs #135520
Merged
bors
merged 1 commit into
rust-lang:master
from
compiler-errors:mono-impossible-drop-with-lifetimes
Jan 15, 2025
Merged
Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs #135520
bors
merged 1 commit into
rust-lang:master
from
compiler-errors:mono-impossible-drop-with-lifetimes
Jan 15, 2025
Conversation
This file contains 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
…rly monomorphizing drop for structs
compiler-errors
changed the title
Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for structs
Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs
Jan 15, 2025
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jan 15, 2025
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jan 15, 2025
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 15, 2025
Rollup of 7 pull requests Successful merges: - rust-lang#132397 (Make missing_abi lint warn-by-default.) - rust-lang#133807 (ci: Enable opt-dist for dist-aarch64-linux builds) - rust-lang#134143 (Convert `struct FromBytesWithNulError` into enum) - rust-lang#134338 (Use a C-safe return type for `__rust_[ui]128_*` overflowing intrinsics) - rust-lang#134678 (Update `ReadDir::next` in `std::sys::pal::unix::fs` to use `&raw const (*p).field` instead of `p.byte_offset().cast()`) - rust-lang#135424 (Detect unstable lint docs that dont enable their feature) - rust-lang#135520 (Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 15, 2025
Rollup merge of rust-lang#135520 - compiler-errors:mono-impossible-drop-with-lifetimes, r=BoxyUwU Make sure we actually use the right trivial lifetime substs when eagerly monomorphizing drop for ADTs Absolutely clueless mistake of mine. Whoops. When eagerly collecting mono items, when we encounter an ADT, we try to monomorphize its drop glue. In rust-lang#135313, I made it so that this acts more like eagerly monomorphizing functions, where we allow (in this case) ADTs with lifetimes, since those can be erased by codegen. However, I did not account for the call to `instantiate_and_check_impossible_predicates`, which was still passing an empty set of args. This means that if the ADT in question had any predicates, we'd get an index out of bounds panic. This PR creates the correct set of args for the ADT. Fixes rust-lang#135515. I assume that this manifests in that issue because of `-Clink-dead-code` or something.
This was referenced Jan 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Absolutely clueless mistake of mine. Whoops.
When eagerly collecting mono items, when we encounter an ADT, we try to monomorphize its drop glue. In #135313, I made it so that this acts more like eagerly monomorphizing functions, where we allow (in this case) ADTs with lifetimes, since those can be erased by codegen.
However, I did not account for the call to
instantiate_and_check_impossible_predicates
, which was still passing an empty set of args. This means that if the ADT in question had any predicates, we'd get an index out of bounds panic.This PR creates the correct set of args for the ADT.
Fixes #135515. I assume that this manifests in that issue because of
-Clink-dead-code
or something.