Skip to content
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

Rollup of 9 pull requests #128142

Merged
merged 27 commits into from
Jul 24, 2024
Merged

Rollup of 9 pull requests #128142

merged 27 commits into from
Jul 24, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

fitzgen and others added 27 commits July 2, 2024 15:00
…hods

Some architectures (i386) do not define a "count leading zeros" instruction,
they define a "find first set bit" instruction (`bsf`) whose result is undefined
when given zero (ie none of the bits are set). Of this family of bitwise
operations, I always forget which of these things is potentially undefined for
zero, and I'm also not 100% sure that Rust provides a hard guarantee for the
results of these methods when given zero. So I figured there are others who have
these same uncertainties, and it would be good to resolve them and answer the
question via extending these doc examples/tests.

See https://en.wikipedia.org/wiki/Find_first_set#Hardware_support for more info
on i386 and `bsf` on zero.
…. User can set the stack size using RUST_MIN_STACK, with min size of libc::PTHREAD_STACK_MIN(4kib)
When converting something like `#![cfg_attr(cond, attr)]` into
`#![attr]`, we currently duplicate the `#` token and the `!` token. But
weirdly, there is also this comment:

// We don't really have a good span to use for the synthesized `[]`
// in `#[attr]`, so just use the span of the `#` token.

Maybe that comment used to be true? But now it is false: we can
duplicate the existing delimiters (and their spans and spacing), much
like we do for the `#` and `!`.

This commit does that, thus removing the incorrect comment, and
improving the spans on `Group`s in a few proc-macro tests.
size_of_val_raw: for length 0 this is safe to call

For motivation, see rust-lang/unsafe-code-guidelines#465, specifically around [here](rust-lang/unsafe-code-guidelines#465 (comment)).
Cc `@rust-lang/opsem`
…rations, r=m-ou-se

Add edge-case examples to `{count,leading,trailing}_{ones,zeros}` methods

Some architectures (i386) do not define a "count leading zeros" instruction, they define a "find first set bit" instruction (`bsf`) whose result is undefined when given zero (ie none of the bits are set). Of this family of bitwise operations, I always forget which of these things is potentially undefined for zero, and I'm also not 100% sure that Rust provides a hard guarantee for the results of these methods when given zero. So I figured there are others who have these same uncertainties, and it would be good to resolve them and answer the question via extending these doc examples/tests.

See https://en.wikipedia.org/wiki/Find_first_set#Hardware_support for more info on i386 and `bsf` on zero.
…-obk

Tweak "wrong # of generics" suggestions

Fix incorrect suggestion, make verbose and change message to make more sense when it isn't a span label.
Make tidy fast without compromising case alternation

Fixes tidy speed issue but still catches case-alternation, enabled for other `style.rs` files, and also detects test files better.
r? `@albertlarsan68`
`@Nilstrieb`
Fix build failure on vxworks rust-lang#127084

PR to address issue rust-lang#127084 .
1. Skip `reset_segpipe` for vxworks
2. Return unimplemented error for vxworks from settimes and lchown
3. Temporarily skip dirfd for vxworks
4. Add allow unused unsafe on read_at and write_at functions in unix/fs.rs
5. Using cfg disable ON_BROKEN_PIPE_FLAG_USED and on_broken_pipe_flag_used() for vxworks
6. Remove old crate::syscommon::thread::min_stack() reference from process_vxworks.rs and update to set stack size of rtpthread

Thank you.
Replace some `mem::forget`'s with `ManuallyDrop`

              > but I would like to see a larger effort to replace all uses of `mem::forget`.

_Originally posted by `@saethlin` in rust-lang#127584 (comment)

So,
r? `@saethlin`

Sorry, I have finished writing all of this before I got your response.
…li-obk

Gate `AsyncFn*` under `async_closure` feature

T-lang has not come to a consensus on the naming of async closure callable bounds, and as part of allowing the async closures RFC merge, we agreed to place `AsyncFn` under the same gate as `async Fn` so that these syntaxes can be evaluated in parallel.

See rust-lang/rfcs#3668 (comment)

r? oli-obk
Import `c_void` rather than using the full path

Follow up to rust-lang#128092. As requested, this imports `c_void` in more places. I also fixed up some imports to use `core` for core types instead of `crate`. While that is not strictly necessary, I think ideally things in `sys/pal` should only depend on itself or core so that the code is less spaghetti. We're far away from that ideal at the moment but I can at least try to slowly move in that direction.

Also this forbids `unsafe_op_in_unsafe_fn` for library/std/src/sys/pal/windows by fixing up the remaining unsafe bits that are just punting their unsafe requirements onto the caller of the `unsafe` function (or definition macro).

<!--
r? workingjubilee
-->
…petrochenkov

Improve spans on evaluated `cfg_attr`s.

When converting something like `#![cfg_attr(cond, attr)]` into `#![attr]`, we currently duplicate the `#` token and the `!` token. But weirdly, there is also this comment:

// We don't really have a good span to use for the synthesized `[]`
// in `#[attr]`, so just use the span of the `#` token.

Maybe that comment used to be true? But now it is false: we can duplicate the existing delimiters (and their spans and spacing), much like we do for the `#` and `!`.

This commit does that, thus removing the incorrect comment, and improving the spans on `Group`s in a few proc-macro tests.

`@petrochenkov`
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc O-hermit Operating System: Hermit O-SGX Target: SGX labels Jul 24, 2024
@rustbot rustbot added O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 24, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jul 24, 2024

📌 Commit 2dc88bf has been approved by matthiaskrgr

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 24, 2024
@bors
Copy link
Contributor

bors commented Jul 24, 2024

⌛ Testing commit 2dc88bf with merge 6106b05...

@bors
Copy link
Contributor

bors commented Jul 24, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 6106b05 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 24, 2024
@bors bors merged commit 6106b05 into rust-lang:master Jul 24, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 24, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#126152 size_of_val_raw: for length 0 this is safe to call 634d5ef885b728061d96e21cf34ecce5afa5ec7b (link)
#127252 Add edge-case examples to `{count,leading,trailing}_{ones,z… 2c116b770a0772ca4ad9610a4a96ea63b0f7614d (link)
#127374 Tweak "wrong # of generics" suggestions ea116d183ebd54a41ab48ee78672d27c09d61d94 (link)
#127457 Make tidy fast without compromising case alternation 1cf3fa80d68e81be42cb7f88acb8bc817007bff3 (link)
#127480 Fix build failure on vxworks #127084 f4dc23c120514e010822ac6b6cc3a5109f8e1c13 (link)
#127733 Replace some mem::forget's with ManuallyDrop 9122903a9002007761b512f191b1355c0f3171ca (link)
#128120 Gate AsyncFn* under async_closure feature b8bb93d0816fe3708303d0bfc37e6074d00bd4ea (link)
#128131 Import c_void rather than using the full path fd73cb8bf372aac5cee261365fcaf0ec76092cf2 (link)
#128133 Improve spans on evaluated cfg_attrs. 17067770d27fd4483a9c1f79770109e0f4daffcb (link)

previous master: 2ccafed862

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6106b05): 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.

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

Max RSS (memory usage)

Results (primary 0.1%, secondary 2.7%)

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)
4.5% [4.5%, 4.5%] 1
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
-4.3% [-4.3%, -4.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-4.3%, 4.5%] 2

Cycles

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

Binary size

Results (primary -0.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)
-0.2% [-0.5%, -0.0%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.5%, -0.0%] 6

Bootstrap: 772.807s -> 770.858s (-0.25%)
Artifact size: 328.91 MiB -> 328.89 MiB (-0.01%)

@matthiaskrgr matthiaskrgr deleted the rollup-rep8ofv branch September 1, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.