ptr::replace: make calls on ZST null ptr not UB#149169
ptr::replace: make calls on ZST null ptr not UB#149169rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
|
r? @ibraheemdev rustbot has assigned @ibraheemdev. Use |
bb81fb2 to
43aa6a7
Compare
|
@rust-lang/libs any thoughts on this? |
|
r? libs |
|
@rfcbot merge libs-api |
|
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
r=me with FCP complete @rustbot author |
|
Yeah technically this PR just changes the implementation, the API already got changed a while ago. |
43aa6a7 to
2484cfe
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
@bors r=Mark-Simulacrum |
…ark-Simulacrum ptr::replace: make calls on ZST null ptr not UB See rust-lang#138351 for context. We made `ptr::read` and `ptr::write` not UB on ZST null pointers. This does the same with `ptr::replace`. Since we're just adding a branch on a constant, this should come at no runtime cost.
Rollup of 8 pull requests Successful merges: - #149169 (ptr::replace: make calls on ZST null ptr not UB) - #150562 (Fix doc link used in suggestion for pinning self) - #152679 (rustc_expand: improve diagnostics for non-repeatable metavars) - #153017 (Implement debuginfo for unsafe binder types) - #152868 (delete some very old trivial `Box` tests) - #152922 (rustc_public: Make fields that shouldn't be exposed visible only in `rustc_public`) - #153029 (Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`.) - #153051 (Migration of `LintDiagnostic` - part 3)
Rollup of 12 pull requests Successful merges: - #149169 (ptr::replace: make calls on ZST null ptr not UB) - #150562 (Fix doc link used in suggestion for pinning self) - #152418 (`BTreeMap::merge` optimized) - #152679 (rustc_expand: improve diagnostics for non-repeatable metavars) - #152952 (mGCA: improve ogca diagnostic message ) - #152977 (Fix relative path handling for --extern-html-root-url) - #153017 (Implement debuginfo for unsafe binder types) - #152868 (delete some very old trivial `Box` tests) - #152922 (rustc_public: Make fields that shouldn't be exposed visible only in `rustc_public`) - #153032 (Fix attribute parser and kind names.) - #153051 (Migration of `LintDiagnostic` - part 3) - #153060 (Give a better error when updating a submodule fails)
Rollup merge of #149169 - RalfJung:replace-zst-null-ptr, r=Mark-Simulacrum ptr::replace: make calls on ZST null ptr not UB See #138351 for context. We made `ptr::read` and `ptr::write` not UB on ZST null pointers. This does the same with `ptr::replace`. Since we're just adding a branch on a constant, this should come at no runtime cost.
|
@rust-timer build 6e1951f For #153074. |
|
Missing artifact for sha |
|
@rust-timer build 6e1951f |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (6e1951f): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.0%, secondary -4.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 482.035s -> 480.395s (-0.34%) |
|
Noise. |
See #138351 for context.
We made
ptr::readandptr::writenot UB on ZST null pointers. This does the same withptr::replace. Since we're just adding a branch on a constant, this should come at no runtime cost.