Skip to content

Update thinvec to 0.2.19 - #159974

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
panstromek:update-thin-vec
Jul 27, 2026
Merged

Update thinvec to 0.2.19#159974
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
panstromek:update-thin-vec

Conversation

@panstromek

@panstromek panstromek commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

It contains may_dangle Drop impl under a feature flag. This allows us to use it in a lot more places, notable in types that hold &'tcx references. This would previously fail in borrowck in arena code.

We have to enable its "unstable" feature for this. That also enables TrustedLen impl, which is behind unstable flag, too. I left the flag disabled, because it regressed next-solver benchmarks, but that will be fixed in PR that needs this flag (see the comment: #159974 (comment))

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 26, 2026
@panstromek panstromek changed the title Tpdate thinvec to latest version and enable it's unstable feature to … Tpdate thinvec to 0.2.19 to get may_dangle Drop impl Jul 26, 2026
@panstromek panstromek changed the title Tpdate thinvec to 0.2.19 to get may_dangle Drop impl Update thinvec to 0.2.19 to get may_dangle Drop impl Jul 26, 2026
@panstromek
panstromek marked this pull request as ready for review July 26, 2026 17:28
@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 26, 2026
@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

r? @davidtwco

rustbot has assigned @davidtwco.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 74 candidates
  • Random selection from 16 candidates

@rust-log-analyzer

This comment has been minimized.

@mejrs

mejrs commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

You can enable the unstable feature for rustc_type_ir as well, you just have to gate it behind its nightly feature (just like smallvec).

@panstromek

Copy link
Copy Markdown
Contributor Author

You can enable the unstable feature for rustc_type_ir as well, you just have to gate it behind its nightly feature

Yes, but if I understand corectly, Cargo will also enable it through feature unification automatically when you build the compiler, right?


I tried to use the new version in #159975 and it had surprisingly negative perf results, so let's try measure this in isolation, just in case.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
Update thinvec to 0.2.19 to get may_dangle Drop impl
@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 83b3c6e (83b3c6ea3bc5da808387eff3da89c310d09ad5e3)
Base parent: dfbea5b (dfbea5bc945a9d7ff017d3d4bfbd1af9295fe5b8)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (83b3c6e): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.6% [0.2%, 2.5%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -2.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.5%, -1.5%] 2
All ❌✅ (primary) - - 0

Cycles

Results (secondary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.4% [2.1%, 6.3%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 486.74s -> 487.133s (0.08%)
Artifact size: 387.74 MiB -> 388.40 MiB (0.17%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 27, 2026
@panstromek

panstromek commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Interesting, I wonder why is new-solver so sensitive to ThinVec. Anyway, let's first try to benchmark the update without unstable features - may_dangle changes how Drop is handled, and TrustedLen impacts which specializations are used.

@bors try @rust-timer queue

This should correspond to a smaller diff in thin-vec code:

@rustbot author
(until I figure it out)

@rust-timer

This comment has been minimized.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 27, 2026
@rustbot

rustbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
Update thinvec to 0.2.19 to get may_dangle Drop impl
@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 70848ee (70848eecea0054e9979a011fba24323e191e2e21)
Base parent: dfbea5b (dfbea5bc945a9d7ff017d3d4bfbd1af9295fe5b8)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (70848ee): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking 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 count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Cycles

Results (secondary -2.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [3.5%, 3.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.5% [-6.2%, -2.4%] 4
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 486.74s -> 490.208s (0.71%)
Artifact size: 387.74 MiB -> 389.79 MiB (0.53%)

@rustbot rustbot removed perf-regression Performance regression. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 27, 2026
@panstromek

panstromek commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Ok, this is great (include-blob is noise probably). It looks like the regression is in the unstable feature (probably TrustedLen impl on Drain?), but it turns out #160005 also needs this update and it will change the new-solver code to avoid or outweigh that regression.

I think we could do the update without "unstable" here and let #160005 enable the feature flag while fixing the regression. But we can also just close and wait for #160005 to do this all at once, but I'm not sure how long that's going to take.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 27, 2026
@panstromek panstromek changed the title Update thinvec to 0.2.19 to get may_dangle Drop impl Update thinvec to 0.2.19 Jul 27, 2026

@mejrs mejrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r? me @bors r+ rollup

It looks like the regression is in the unstable feature (probably TrustedLen impl on Drain?)

That's weird 🤔

View changes since this review

@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 02a54aa has been approved by mejrs

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

Reason for tree closure: spurious failures

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 27, 2026
@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #160009 (`rust-analyzer` subtree update)
 - #159833 (ci: Make the `x86_64-gnu-parallel-frontend` job non-optional)
 - #158873 (applying `/Brepro` in bootstrap on MSVC and adding a run-make test.)
 - #159777 (Enforce that we don't generate code for comptime fns)
 - #159997 (On many bindings with move error, limit the number of `Span`s)
 - #158205 (fix: defer const normalize in coherence mode)
 - #159312 (Windows implementation for stdio set/take/replace)
 - #159772 (Fix lowering of resolved const inference variables)
 - #159785 (Share _Unwind_Exception definition between native and wasm)
 - #159968 (Fix the const impl suggestion)
 - #159974 (Update thinvec to 0.2.19)
 - #160013 (tests/ui: Ignore one query cycle test in parallel frontend mode)
 - #160016 (compiletest: do not talk about JSON when the user never sees any)
 - #160018 (test suite: add ARM case to ABI-required target feature check for -Ctarget-cpu)
@rust-bors
rust-bors Bot merged commit 447eef1 into rust-lang:main Jul 27, 2026
14 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 27, 2026
rust-timer added a commit that referenced this pull request Jul 27, 2026
Rollup merge of #159974 - panstromek:update-thin-vec, r=mejrs

Update thinvec to 0.2.19

It contains `may_dangle` Drop impl under a feature flag. This allows us to use it in a lot more places, notable in types that hold `&'tcx` references. This would previously fail in borrowck in arena code.

We have to enable  its "unstable" feature for this. That also enables `TrustedLen` impl, which is behind unstable flag, too. I left the flag disabled, because it regressed next-solver benchmarks, but that will be fixed in PR that needs this flag (see the comment: #159974 (comment))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

6 participants