Skip to content

add a few more assert_unsafe_precondition #102315

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 2 commits into from
Oct 8, 2022

Conversation

RalfJung
Copy link
Member

Add debug-assertion checking for ptr.read(), ptr.write(_), and unreachable_unchecked.

This is quite useful for cargo-careful.

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Sep 26, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 26, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Contributor

r? @joshtriplett

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2022
@RalfJung RalfJung force-pushed the assert_unsafe_precondition branch 2 times, most recently from 75b0f4c to 85bf118 Compare September 26, 2022 15:50
@RalfJung
Copy link
Member Author

r? libs

@RalfJung
Copy link
Member Author

RalfJung commented Oct 7, 2022

r? @thomcc

@rust-highfive rust-highfive assigned thomcc and unassigned m-ou-se Oct 7, 2022
@thomcc
Copy link
Member

thomcc commented Oct 7, 2022

Thanks! Really wanted the alignment ones the other day!

@bors r+ rollup=iffy

@bors
Copy link
Collaborator

bors commented Oct 7, 2022

📌 Commit 85bf118649b3f32dc795e400d0a28d88d269d1ae has been approved by thomcc

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 Oct 7, 2022
@bors
Copy link
Collaborator

bors commented Oct 7, 2022

⌛ Testing commit 85bf118649b3f32dc795e400d0a28d88d269d1ae with merge fb3ba99601b5972a9694f4e0ef056ff40b54665b...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Oct 7, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 7, 2022
@RalfJung RalfJung force-pushed the assert_unsafe_precondition branch from 85bf118 to 6f64334 Compare October 7, 2022 12:36
@rustbot
Copy link
Collaborator

rustbot commented Oct 7, 2022

The Miri subtree was changed

cc @rust-lang/miri

@RalfJung
Copy link
Member Author

RalfJung commented Oct 7, 2022

@bors r=thomcc

@bors
Copy link
Collaborator

bors commented Oct 7, 2022

📌 Commit d71a851 has been approved by thomcc

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2022
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 7, 2022
@bors
Copy link
Collaborator

bors commented Oct 8, 2022

⌛ Testing commit d71a851 with merge 3c49830f5329b10c80ddec098e5e378935fbbc05...

@bors
Copy link
Collaborator

bors commented Oct 8, 2022

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 8, 2022
@RalfJung
Copy link
Member Author

RalfJung commented Oct 8, 2022

@bors retry timeout on apple-alt

@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 Oct 8, 2022
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Collaborator

bors commented Oct 8, 2022

⌛ Testing commit d71a851 with merge 8796e7a...

@bors
Copy link
Collaborator

bors commented Oct 8, 2022

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing 8796e7a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 8, 2022
@bors bors merged commit 8796e7a into rust-lang:master Oct 8, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 8, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8796e7a): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.7% [0.4%, 1.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

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.

mean1 range count2
Regressions ❌
(primary)
8.8% [0.2%, 22.3%] 26
Regressions ❌
(secondary)
2.8% [2.1%, 3.7%] 3
Improvements ✅
(primary)
-4.8% [-5.5%, -4.1%] 4
Improvements ✅
(secondary)
-1.5% [-1.5%, -1.5%] 1
All ❌✅ (primary) 7.0% [-5.5%, 22.3%] 30

Cycles

Results

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.

mean1 range count2
Regressions ❌
(primary)
13.4% [2.0%, 41.6%] 70
Regressions ❌
(secondary)
8.0% [2.1%, 15.2%] 22
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 13.4% [2.0%, 41.6%] 70

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@RalfJung RalfJung deleted the assert_unsafe_precondition branch October 10, 2022 18:09
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
… r=thomcc

add a few more assert_unsafe_precondition

Add debug-assertion checking for `ptr.read()`, `ptr.write(_)`, and `unreachable_unchecked.`

This is quite useful for [cargo-careful](https://github.com/RalfJung/cargo-careful).
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.

9 participants