Skip to content
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

Eagerly mono drop for structs with lifetimes #135313

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

compiler-errors
Copy link
Member

That is, use !generics.requires_monomorphization() rather than generics.is_empty() like the rest of the mono collector code.

@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2025

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot 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 10, 2025
@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 14, 2025

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 14, 2025

📌 Commit 27603b2 has been approved by BoxyUwU

It is now in the queue for this repository.

@bors 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 14, 2025
@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 14, 2025

@bors rollup=never
oops

@bors
Copy link
Contributor

bors commented Jan 14, 2025

⌛ Testing commit 27603b2 with merge 3736b85...

@bors
Copy link
Contributor

bors commented Jan 14, 2025

☀️ Test successful - checks-actions
Approved by: BoxyUwU
Pushing 3736b85 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 14, 2025
@bors bors merged commit 3736b85 into rust-lang:master Jan 14, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 14, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3736b85): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -4.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.7% [-6.2%, -3.3%] 2
All ❌✅ (primary) - - 0

Cycles

Results (secondary 2.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.4%, 2.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 762.502s -> 763.479s (0.13%)
Artifact size: 326.12 MiB -> 326.06 MiB (-0.02%)

jhpratt added a commit to jhpratt/rust that referenced this pull request Jan 15, 2025
…op-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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants