Skip to content

Rollup of 8 pull requests - #155503

Closed
jhpratt wants to merge 21 commits into
rust-lang:mainfrom
jhpratt:rollup-4H5RUqD
Closed

Rollup of 8 pull requests#155503
jhpratt wants to merge 21 commits into
rust-lang:mainfrom
jhpratt:rollup-4H5RUqD

Conversation

@jhpratt

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

folkertdevand others added 21 commits March 15, 2026 11:18
similar to how constants in those modules for numeric types have been deprecated
The test array is sorted by name at compile time. When `--exact` is
passed in, use binary search for O(f log n) lookups instead of an O(n)
linear scan, under the assumption that f << n (which is true for the
most relevant cases).
This is important for Miri, where the interpreted execution makes the
linear scan very expensive.
I measured this against a repo with 1000 empty tests, running
`cargo +stage1 miri nextest run test_00` (100 tests) under hyperfine:
* Before (linear scan): 49.7s ± 0.6s
* After (binary search): 41.9s ± 0.2s (-15.7%)
I also tried a few other variations (particularly swapping matching tests to the front of the list + truncating the list), but the index + swap_remove approach proved to be the fastest.
Questions:
- [ ] To be conservative, I've assumed that test_main can potentially receive an unsorted list of tests. Is this assumption correct?
…tilities to observe, set, and create a Permissions struct with certain file attributes
…parser
The spdx-rs crate is no longer maintained and is behind on its own dependency
updates. The only function that collect-license-metadata uses from it is
`spdx_rs::parsers::spdx_from_tag_value`, which parses the output of the `reuse`
tool to extract file names, licences and copyright text.
Replace this with a small minimal parser that handles just the subset
of the SPDX tag-value format that is needed: `Tag: Value` line pairs
and multi-line `<text>...</text>` blocks.
Coincidentally, this gets rid of the last transitive dependency on syn v1.
Certain links will not be valid when moved into `core::io`
* Checking exhaustion will no longer be possible for `repr_bitpacked`. Moving `kind_from_prim` into an associated function, and setting it up to be moved into `core::io` as well.
* `ErrorKind::as_str` is private, but it's only usage is trivially replaced with `Display::fmt`
* The features io_error_inprogress, io_error_more, and io_error_uncategorized will all need to be enabled
Move `std::io::ErrorKind` to `core::io`
* Update `rustdoc-html` tests for the new path
* Add `core_io` feature to control stability. This replaces the use of `core_io_borrowed_buf` on the `core::io` module itself.
* Re-export `core::io::ErrorKind` in `std::io::error`
In `autolabel."T-compiler"`, several `./tests/*` dirs are listed.
But many of them are missing from `assign.owners`. Add them all to
`assign.owners` so reviewers are picked from the compiler group, and not
from the small `assign.adhoc_groups.fallback` group.
Dead code elimination used to fail when a Drop impl contained a panic
and a potentially-panicking external function was called after the value
was created. This was fixed since 1.82 but no regression test was added.
The test verifies that foo() compiles to just a call to unknown() and
ret void, with no panic or panicking call in the function body.
Signed-off-by: Naveen R. Iyer <iyernaveenr@gmail.com>
Addresses rust-lang#154406 in part.
assert_eq will be done in a separate PR.
…4532-needs-test, r=Mark-Simulacrum
Add regression test for dead code elimination with drop + panic
Add a codegen test for rust-lang#114532.
The bug was that dead code elimination failed when a `Drop` impl contained a `panic!` and a potentially-panicking external function was called after the value was created. This was fixed since 1.82 but no regression test was added.
The test verifies that `foo()` compiles to just a call to `unknown()` + `ret void`, with no panic or panicking call in the function body.
Closesrust-lang#114532
…Mark-Simulacrum
Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser
The spdx-rs crate [is no longer maintained](https://github.com/doubleopen-project/spdx-rs/pulls) and is behind on its own dependency updates. It is currently used in [the collect-license-metadata tool](https://github.com/rust-lang/rust/tree/main/src/tools/collect-license-metadata), employing a single function therefrom: `spdx_rs::parsers::spdx_from_tag_value`, which parses the output of the `reuse` tool to extract file names, licences and copyright text.
This PR replaces the use of said function with a small minimal parser that handles just the subset of the SPDX tag-value format that is needed: `Tag: Value` line pairs and multi-line `<text>...</text>` blocks.
Coincidentally, this gets rid of the last transitive dependency on syn v1.
triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`
In `autolabel."T-compiler"`, several `./tests/*` dirs are listed.
But many of them are missing from `assign.owners`. Add them all to `assign.owners` so reviewers are picked from the compiler group, and not from the small `assign.adhoc_groups.fallback` group.
Discovered in rust-lang#153941 (comment).
CC fallback group @Mark-Simulacrum@jieyouxu who can maybe confirm that the old setup was not intentional? (Edit: I hope it was not intentional, because in that case I should have reached out to you personally beforehand.)
…-matches, r=Amanieu
Add temporary scope to assert_matches
Addresses rust-lang#154406 in part. `assert_eq` will be done in a separate PR.
… r=Mark-Simulacrum
ACP Implementation of PermissionsExt for Windows
This PR implements the `PermissionsExt` for Windows ACP and adds file attribute methods in `FilePermissions` struct (to be decided whether we use them or not). See this [tracking issue](rust-lang#152956 (comment)) for further detail and links.
I also added some comments in the code for clarifications about the ACP (e.g. whether we should have a `set_file_attributes()` + `from_file_attributes()` method to mirror what unix's `PermissionsExt` is doing).
Also, some relevant links on this:
* [File Attribute Constants](https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants)
* [`attrib` command](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/attrib)
* [SetFileAttributesA](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfileattributesa)
* [GetFileAttributesA](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfileattributesa)
* [Window's File Attributes Column Values](https://superuser.com/questions/44812/windows-explorers-file-attribute-column-values)
* [What is the 'M' attribute in Windows file system for?](https://superuser.com/questions/1621649/what-is-the-m-attribute-in-windows-file-system-for)
Note: Apologies for the multiple forced push. I haven't set up my Windows VM up yet to compile and check the code, so I've been using the CI to help me with that.
r? @ChrisDenton
…ark-Simulacrum
deprecate `std::char` constants and functions
similar to how constants in those modules for numeric types have been deprecated. The `std::char` module contains:
Three stable constants that this PR deprecates. These already link to their associated constant equivalents.
- `MAX`
- `REPLACEMENT_CHARACTER`
- `UNICODE_VERSION`
two unstable constants that this PR removes. The constants are already stablized as associated constants on `char`.
- `MAX_LEN_UTF8`
- `MAX_LEN_UTF16`
Four stable functions that this PR deprecates. These already link to their method equivalents.
- `fn decode_utf16`
- `fn from_digit`
- `fn from_u32`
- `fn from_u32_unchecked⚠`
discussion at [#t-libs > should &rust-lang#96;std::char::{MIN, MAX}&rust-lang#96; be deprecated?](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/should.20.60std.3A.3Achar.3A.3A.7BMIN.2C.20MAX.7D.60.20be.20deprecated.3F/with/579444750).
r? libs-api
…r=Mark-Simulacrum
Move `std::io::ErrorKind` to `core::io`
ACP: rust-lang/libs-team#755
Tracking issue: rust-lang#154046
Related: rust-lang#152918
## Description
I consider rust-lang#154046 to be really important for `no_std`, but I'm concerned rust-lang#152918 might be too controversial. As an alternative, I'd like to propose starting small with `ErrorKind`, since it can be moved somewhat trivially. It has no dependencies on functionality in `std`, no platform specific behaviour, and could provide an excellent bridging point for `no_std` IO libraries.
Since `std::io::Error` implements `From<ErrorKind>`, libraries could write functions which return `Result<T, core::io::ErrorKind>`, and therefore be usable in `std`-using libraries with the `?` operator. For that reason, I'd consider this to be a worthwhile change even if the rest of `std::io` couldn't be moved to `core`/`alloc`, and entirely compatible with any efforts to make such a change in the future.
## Notes
* This is my first PR against Rust, please let me know if there's anything I should be doing that I have not done. I tried reading through the library contributors guide but I'm sure I've missed _something_.
* No AI tooling of any kind was used in the creation of this PR.
* I believe it's appropriate that this be a part of the linked tracking issue, but please let me know if that's not the case!
…ark-Simulacrum
libtest: use binary search for --exact test filtering
When `--exact` is passed in, use binary search for O(f log n) lookups instead of an O(n) linear scan, under the assumption that f << n (which is true for the most relevant cases).
This is important for Miri, where the interpreted execution makes the linear scan very expensive.
I measured this against a repo with 1000 empty tests, running `cargo +stage1 miri nextest run test_00` (100 tests) under hyperfine:
* Before (linear scan): 49.7s ± 0.6s
* After (binary search): 41.9s ± 0.2s (-15.7%)
I also tried a few other variations (particularly swapping matching tests to the front of the list + truncating the list), but the index + swap_remove approach proved to be the fastest.
Questions:
- [ ] To be conservative, I've assumed that test_main can potentially receive an unsorted list of tests. Is this assumption correct?
@rust-borsrust-borsBot added the rollup A PR which is a rollup label Apr 19, 2026
@rustbotrustbot 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Apr 19, 2026
@jhpratt

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=5

@rust-bors

rust-borsBot commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

📌 Commit d8048a2 has been approved by jhpratt

It is now in the queue for this repository.

@rust-borsrust-borsBot 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 Apr 19, 2026
@rust-bors

This comment has been minimized.

rust-borsBot pushed a commit that referenced this pull request Apr 19, 2026
Rollup of 8 pull requests
Successful merges:
- #155370 (Add regression test for dead code elimination with drop + panic)
- #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser)
- #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`)
- #155431 (Add temporary scope to assert_matches)
- #152995 (ACP Implementation of PermissionsExt for Windows )
- #153873 (deprecate `std::char` constants and functions)
- #154654 (Move `std::io::ErrorKind` to `core::io`)
- #154865 (libtest: use binary search for --exact test filtering)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

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

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

error[E0624]: method `as_str` is private
--> /rustc/f852fda4259685e0df3f425bda03b8d336f7d428/library/std/src/sys/io/error/sgx.rs:63:34
|
63 | decode_error_kind(errno).as_str().into()
| ^^^^^^ private method
|
--> /rustc/f852fda4259685e0df3f425bda03b8d336f7d428/library/core/src/io/error.rs:250:4
|
= note: private method defined here

@rust-borsrust-borsBot 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 Apr 19, 2026
@rust-bors

rust-borsBot commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

💔 Test for f852fda failed: CI. Failed job:

@jhprattjhpratt closed this Apr 19, 2026
@rust-borsrust-borsBot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 19, 2026
@rust-bors

rust-borsBot commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

PR #154654, which is a member of this rollup, was unapproved.

@rust-borsrust-borsBot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 19, 2026
@jhpratt
jhpratt deleted the rollup-4H5RUqD branch April 19, 2026 03:56
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-metaArea: Issues & PRs about the rust-lang/rust repository itselfO-windowsOperating system: WindowsrollupA PR which is a rollupS-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libsRelevant to the library team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@jhpratt@rust-log-analyzer@rustbot@folkertdev@sunshowers@asder8215@jakubadamw@bushrat011899@Enselic@iyernaveenr@Voultapher