Skip to content

Remove some unnecessary unsafe in VecCache #143406

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

Merged
merged 1 commit into from
Jul 5, 2025

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Jul 4, 2025

I'm pretty sure, but until perf confirms,
r? ghost

cc #142095 which added the unsafe.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 4, 2025
@scottmcm
Copy link
Member Author

scottmcm commented Jul 4, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 4, 2025
bors added a commit that referenced this pull request Jul 4, 2025
Remove some unnecessary `unsafe` in VecCache

I'm pretty sure, but until perf confirms,
r? ghost
@bors
Copy link
Collaborator

bors commented Jul 4, 2025

⌛ Trying commit 15286f2 with merge 6110ea8...

@bors
Copy link
Collaborator

bors commented Jul 4, 2025

☀️ Try build successful - checks-actions
Build commit: 6110ea8 (6110ea89ebffe97b1fd180abdeb8d7afdb2b52af)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6110ea8): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@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
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.9% [-2.9%, -2.9%] 1

Max RSS (memory usage)

Results (secondary 5.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)
5.4% [5.4%, 5.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.3%, secondary 1.1%)

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)
1.8% [0.5%, 3.5%] 3
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) -2.3% [-2.3%, -2.3%] 1

Binary size

Results (primary -1.1%)

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)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.1% [-1.1%, -1.1%] 1

Bootstrap: 462.222s -> 462.149s (-0.02%)
Artifact size: 372.18 MiB -> 372.17 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 4, 2025
@scottmcm
Copy link
Member Author

scottmcm commented Jul 4, 2025

The improvement in clap-derive is fake, but those results still show that the unsafe wasn't needed.

@scottmcm scottmcm marked this pull request as ready for review July 4, 2025 16:17
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 4, 2025
@scottmcm
Copy link
Member Author

scottmcm commented Jul 4, 2025

r? compiler

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 4, 2025

📌 Commit 15286f2 has been approved by compiler-errors

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 Jul 4, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 4, 2025
…r=compiler-errors

Remove some unnecessary `unsafe` in VecCache

I'm pretty sure, but until perf confirms,
r? ghost
bors added a commit that referenced this pull request Jul 4, 2025
Rollup of 9 pull requests

Successful merges:

 - #141532 (std: sys: net: uefi: tcp4: Implement write)
 - #143085 (Port `#[non_exhaustive]` to the new attribute parsing infrastructure)
 - #143298 (`tests/ui`: A New Order [23/N])
 - #143372 (Remove names_imported_by_glob_use query.)
 - #143386 (Assign dependency bump PRs to me)
 - #143406 (Remove some unnecessary `unsafe` in VecCache)
 - #143408 (mbe: Gracefully handle macro rules that end after `=>`)
 - #143414 (remove special-casing of boxes from match exhaustiveness/usefulness analysis)
 - #143444 (clean up GVN TypeId test)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 4, 2025
Rollup of 8 pull requests

Successful merges:

 - #141532 (std: sys: net: uefi: tcp4: Implement write)
 - #143085 (Port `#[non_exhaustive]` to the new attribute parsing infrastructure)
 - #143372 (Remove names_imported_by_glob_use query.)
 - #143386 (Assign dependency bump PRs to me)
 - #143406 (Remove some unnecessary `unsafe` in VecCache)
 - #143408 (mbe: Gracefully handle macro rules that end after `=>`)
 - #143414 (remove special-casing of boxes from match exhaustiveness/usefulness analysis)
 - #143444 (clean up GVN TypeId test)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 567c51d into rust-lang:master Jul 5, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 5, 2025
rust-timer added a commit that referenced this pull request Jul 5, 2025
Rollup merge of #143406 - scottmcm:did-we-need-that-unsafe, r=compiler-errors

Remove some unnecessary `unsafe` in VecCache

I'm pretty sure, but until perf confirms,
r? ghost
@scottmcm scottmcm deleted the did-we-need-that-unsafe branch July 5, 2025 04:40
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants