Skip to content

alloc: remove unsound IsZero for raw pointers #135339

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
Jan 11, 2025
Merged

Conversation

joboet
Copy link
Member

@joboet joboet commented Jan 10, 2025

Fixes #135338

@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 10, 2025
@Noratrieb
Copy link
Member

a bit unfortunate to lose this optimization, but it's fine.
@bors r+

@bors
Copy link
Collaborator

bors commented Jan 10, 2025

📌 Commit 4426e9a has been approved by Noratrieb

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

@bors rollup=never p=1

@scottmcm
Copy link
Member

a bit unfortunate to lose this optimization

More proof that Option<NonNull<_>> is better than raw pointers :D

@bors
Copy link
Collaborator

bors commented Jan 10, 2025

⌛ Testing commit 4426e9a with merge 760b6f8...

@bors
Copy link
Collaborator

bors commented Jan 11, 2025

☀️ Test successful - checks-actions
Approved by: Noratrieb
Pushing 760b6f8 to master...

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

Finished benchmarking commit (760b6f8): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

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

Max RSS (memory usage)

Results (primary -3.9%, secondary 1.0%)

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

Cycles

Results (primary -2.3%, secondary -2.2%)

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

Binary size

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

Bootstrap: 764.797s -> 764.732s (-0.01%)
Artifact size: 325.90 MiB -> 325.97 MiB (0.02%)

@workingjubilee
Copy link
Member

...yeah, this was why I wanted to make sure the removal of this optimization landed first.

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-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IsZero for raw pointers is unsound
8 participants