Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Rollup of 4 pull requests #127848

Closed
wants to merge 14 commits into from
Closed

Conversation

tgross35
Copy link
Contributor

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ChrisDenton and others added 14 commits July 15, 2024 14:16
These need to get their safety story straight
Add a test for rust-lang#107975

The int is zero. But also not zero. This is so much fun.

This is a part of rust-lang#105107.

Initially I was going to just rebase rust-lang#108445, but quite a few things changed since then:
* The [mcve](rust-lang#105787 (comment)) used for rust-lang#105787 got fixed.[^upd2]
* You can't just `a ?= b` for rust-lang#107975 anymore. Now you have to `a-b ?= 0`. This is what this PR does. As an additional flex, it show that three ways of converting a pointer to its address have this issue:
  1. `as usize`
  2. `.expose_provenance()`
  3. `.addr()`
* rust-lang#108425 simply got fixed. Yay.

As an aside, the naming for `addr_of!` is quite unfortunate in context of provenance APIs. Because `addr_of!` gives you a pointer, but what provenance APIs refer to as "address" is the `usize` value. Oh well.

UPD1: GitHub is incapable of parsing rust-lang#107975 in the PR name, so let's add it here.

[^upd2]: UPD2: [The other mcve](rust-lang#105787 (comment)) does not work anymore either, saying "this behavior recently changed as a result of a bug fix; see rust-lang#56105 for details."
…tgross35

Make more Windows functions `#![deny(unsafe_op_in_unsafe_fn)]`

As part of rust-lang#127747, I've evaluated some more Windows functions and added `unsafe` blocks where necessary. Some are just trivial wrappers that "inherit" the full unsafety of their function, but for others I've added some safety comments. A few functions weren't actually unsafe at all. I think they were just using `unsafe fn` to avoid an `unsafe {}` block.

I'm not touching `c.rs` yet because that is partially being addressed by another PR and also I have plans to further reduce the number of wrapper functions we have in there.

r? libs
Prevent double reference in generic futex

In the Windows futex implementation we were a little lax at allowing references to references (i.e. `&&`) which can lead to deadlocks due to reading the wrong memory address. This uses a trait to tighten the constraints and ensure this doesn't happen.

r? libs
Reviewer on vacation

`@jhpratt` asked to be set as on vacation
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 17, 2024
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Jul 17, 2024

📌 Commit 3813b1a has been approved by tgross35

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 17, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 17, 2024
Rollup of 4 pull requests

Successful merges:

 - rust-lang#127003 (Add a test for rust-lang#107975)
 - rust-lang#127763 (Make more Windows functions `#![deny(unsafe_op_in_unsafe_fn)]`)
 - rust-lang#127813 (Prevent double reference in generic futex)
 - rust-lang#127847 (Reviewer on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jul 17, 2024

⌛ Testing commit 3813b1a with merge 51add16...

@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-on-stack.rs ... ok
test [ui] tests/ui/codegen/duplicated-path-in-error.rs ... ignored, only executed when the operating system is linux
test [ui] tests/ui/cmse-nonsecure/cmse-nonsecure-entry/wrong-abi.rs ... ok
test [ui] tests/ui/codegen/const-bool-bitcast.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/basic.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/function.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/inline1.rs ... ok
test [ui] tests/ui/closures/deeply-nested_closures.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/print.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/inline2.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/print3.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs ... FAILED
test [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/zero.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/basic.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/function.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline1.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/inline2.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/print.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/print3.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault.rs ... FAILED
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/basic.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/zero.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/function.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline1.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/print.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/inline2.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/print3.rs ... ok
test [ui] tests/ui/codegen/freeze-on-polymorphic-projection.rs ... ok
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs ... FAILED
test [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/zero.rs ... ok
test [ui] tests/ui/codegen/issue-101585-128bit-repeat.rs ... ok
---
test [ui] tests/ui/wrong-hashset-issue-42918.rs ... ok

failures:

---- [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs stdout ----
0




The actual run.stdout differed from the expected run.stdout.
Actual run.stdout saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/as-cast/segfault/segfault.run.stdout
error: 1 errors occurred comparing run output.
status: exit status: 0
status: exit status: 0
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/as-cast/segfault" && RUST_TEST_THREADS="4" "/wasmtime-v19.0.0-x86_64-linux/wasmtime" "run" "-C" "cache=n" "--dir" "." "--env" "RUSTC_BOOTSTRAP" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/as-cast/segfault/a.wasm"
0
------------------------------------------
stderr: none

---



The actual run.stdout differed from the expected run.stdout.
Actual run.stdout saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault/segfault.run.stdout
error: 1 errors occurred comparing run output.
status: exit status: 0
status: exit status: 0
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault" && RUST_TEST_THREADS="4" "/wasmtime-v19.0.0-x86_64-linux/wasmtime" "run" "-C" "cache=n" "--dir" "." "--env" "RUSTC_BOOTSTRAP" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault/a.wasm"
0
------------------------------------------
stderr: none

---



The actual run.stdout differed from the expected run.stdout.
Actual run.stdout saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/strict-provenance/segfault/segfault.run.stdout
error: 1 errors occurred comparing run output.
status: exit status: 0
status: exit status: 0
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/strict-provenance/segfault" && RUST_TEST_THREADS="4" "/wasmtime-v19.0.0-x86_64-linux/wasmtime" "run" "-C" "cache=n" "--dir" "." "--env" "RUSTC_BOOTSTRAP" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/codegen/equal-pointers-unequal/strict-provenance/segfault/a.wasm"
0
------------------------------------------
stderr: none




failures:
    [ui] tests/ui/codegen/equal-pointers-unequal/as-cast/segfault.rs
    [ui] tests/ui/codegen/equal-pointers-unequal/exposed-provenance/segfault.rs
    [ui] tests/ui/codegen/equal-pointers-unequal/strict-provenance/segfault.rs
test result: FAILED. 16695 passed; 3 failed; 610 ignored; 0 measured; 0 filtered out; finished in 383.23s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=wasm32-wasip1
Build completed unsuccessfully in 0:35:05

@bors
Copy link
Contributor

bors commented Jul 17, 2024

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 17, 2024
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 17, 2024
@tgross35 tgross35 closed this Jul 17, 2024
@tgross35 tgross35 deleted the rollup-j6k2dak branch July 17, 2024 09:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

6 participants