Skip to content

Rollup of 9 pull requests#150901

Closed
tgross35 wants to merge 24 commits intorust-lang:mainfrom
tgross35:rollup-NJdMRaX
Closed

Rollup of 9 pull requests#150901
tgross35 wants to merge 24 commits intorust-lang:mainfrom
tgross35:rollup-NJdMRaX

Conversation

@tgross35
Copy link
Copy Markdown
Contributor

@tgross35 tgross35 commented Jan 9, 2026

Successful merges:

r? @ghost

Create a similar rollup

the8472 and others added 24 commits January 6, 2026 16:57
The documentation of `SipHasher` previously linked to a page about
SipHash on https://131002.net, a domain registered to Jean-Philippe
Aumasson, one of the co-authors of the original SipHash paper (alongside
Daniel J Bernstein).

That domain now redirects to another of Mr Aumasson's domains,
https://www.aumasson.jp, but which does not host a similar page
dedicated to SipHash.  Instead, his site links to a GitHub repository
containing a C implementation together with links to the original
research paper.  Mr Bernstein's own site, https://cr.yp.to, only hosts a
copy of the research paper.

Therefore the GitHub repository appears to be the most official and
complete reference to which we can link.
Signed-off-by: tison <wander4096@gmail.com>
Co-Authored-By: Orson Peters <orsonpeters@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
std supports redirecting stdio file descriptors.
This patch removes one call to `std::mem::take` to save two
`memcpy`s: `JsonRenderer::index` can be quite large as noted
rust-lang#142335. `self.index` can be
passed directly to `types::Crate`. This removal makes `self` immutable.

The private `serialize_and_write` method is moved as a function: the
`self` argument is replaced by `sess: &Session`. This `&Session` was
fetched earlier in `after_krate` in all cases. This change allows to
call `serialize_and_write` after `output_crate` is created, without
having a conflict around the move of `self`: the borrow checker is now
happy.
When PR rust-lang#147572 switched WASI to use Unix-style filesystem APIs, the
open_to_and_set_permissions function for WASI was implemented to call
OpenOptions::new().open() without setting any access mode flags.

This causes std::fs::copy to fail with the error:
"must specify at least one of read, write, or append access"

The fix is to explicitly set .write(true), .create(true), and
.truncate(true) on the OpenOptions, matching the behavior of the
non-WASI Unix implementation but without the permission handling
that WASI doesn't support.

Minimal reproduction:
    fn main() {
        std::fs::write("/src.txt", b"test").unwrap();
        match std::fs::copy("/src.txt", "/dst.txt") {
            Ok(_) => println!("PASS: fs::copy works!"),
            Err(e) => println!("FAIL: {}", e),
        }
    }

    # Compile and run:
    rustc +nightly --target wasm32-wasip2 test.rs -o test.wasm
    wasmtime -S cli --dir . test.wasm

    # Before fix: FAIL: must specify at least one of read, write, or append access
    # After fix:  PASS: fs::copy works!

Note: The existing test library/std/src/fs/tests.rs::copy_file_ok
would have caught this regression if the std test suite ran on WASI
targets. Currently std tests don't compile for wasm32-wasip2 due to
Unix-specific test code in library/std/src/sys/fd/unix/tests.rs.

Fixes the regression introduced in nightly-2025-12-10.
…oss35

Implement partial_sort_unstable for slice

This refers to rust-lang#149046.
adding Ordering enum to minicore.rs, importing minicore in "tests/assembly-llvm/rust-abi-arg-attr.rs" test file

this adds the `Ordering` enum to `minicore.rs`.

consequently, this updates `tests/assembly-llvm/rust-abi-arg-attr.rs` to import `minicore` directly. previously, this test file contained traits like `Copy` `Clone` `PointeeSized`, which were giving a duplicate lang item error, so replace those by importing `minicore` completely.
…Jung

Unix implementation for stdio set/take/replace

Tracking issue: rust-lang#150667
ACP: rust-lang/libs-team#500
mGCA: Support array expression as direct const arguments

tracking issue: rust-lang#132980
resolve: rust-lang#150612

Support array expression as direct const arguments (e. g. [1, 2, N]) in min_generic_const_args.

todo:
* [x] Rebase another mGCA PR
* [x] Add more test case
* [x] Modify clippy code
Fix broken documentation links to SipHash

The documentation of `SipHasher` previously linked to a page about SipHash on https://131002.net, a domain registered to Jean-Philippe Aumasson, one of the co-authors of the original SipHash paper (alongside Daniel J Bernstein).

That domain now redirects to another of Mr Aumasson's domains, https://www.aumasson.jp, but which does not host a similar page dedicated to SipHash.  Instead, his site links to a GitHub repository containing a C implementation together with links to the original research paper.  Mr Bernstein's own site, https://cr.yp.to, only hosts a copy of the research paper.

Therefore the GitHub repository appears to be the most official and complete reference to which we can link.

Fixes rust-lang#150806
r? reddevilmidzy
…GuillaumeGomez

rustdoc_json: Remove one call to `std::mem::take` in `after_krate`

This patch removes one call to `std::mem::take` to save two `memcpy`s: `JsonRenderer::index` can be quite large as noted rust-lang#142335. `self.index` can be passed directly to `types::Crate`. This removal makes `self` immutable.

The private `serialize_and_write` method is moved as a function: the `self` argument is replaced by `sess: &Session`. This `&Session` was fetched earlier in `after_krate` in all cases. This change allows to call `serialize_and_write` after `output_crate` is created, without having a conflict around the move of `self`: the borrow checker is now happy.

I wasn't able to measure the performance impact though because I don't know how to modify `rustc-perf` as [@nnethercote  did](rust-lang#142335 (comment)) (sorry).

---

Follow up of rust-lang#142335.

r? @nnethercote
Emit error instead of delayed bug when meeting mismatch type for const tuple

And rename some tests

Fixes rust-lang#150841

r? @BoxyUwU
Fix std::fs::copy on WASI by setting proper OpenOptions flags

When PR rust-lang#147572 switched WASI to use Unix-style filesystem APIs, the open_to_and_set_permissions function for WASI was implemented to call OpenOptions::new().open() without setting any access mode flags.

This causes std::fs::copy to fail with the error:
"must specify at least one of read, write, or append access"

The fix is to explicitly set .write(true), .create(true), and .truncate(true) on the OpenOptions, matching the behavior of the non-WASI Unix implementation but without the permission handling that WASI doesn't support.

Minimal reproduction:
```rs
    fn main() {
        std::fs::write("/src.txt", b"test").unwrap();
        match std::fs::copy("/src.txt", "/dst.txt") {
            Ok(_) => println!("PASS: fs::copy works!"),
            Err(e) => println!("FAIL: {}", e),
        }
    }
```
    # Compile and run:
    rustc +nightly --target wasm32-wasip2 test.rs -o test.wasm
    wasmtime -S cli --dir . test.wasm

    # Before fix: FAIL: must specify at least one of read, write, or append access
    # After fix:  PASS: fs::copy works!

Note: The existing test library/std/src/fs/tests.rs::copy_file_ok would have caught this regression if the std test suite ran on WASI targets. Currently std tests don't compile for wasm32-wasip2 due to Unix-specific test code in library/std/src/sys/fd/unix/tests.rs.

Fixes the regression introduced in nightly-2025-12-10.

r? @alexcrichton
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Jan 9, 2026
@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 9, 2026
@rustbot rustbot added T-clippy Relevant to the Clippy team. 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. labels Jan 9, 2026
@tgross35
Copy link
Copy Markdown
Contributor Author

tgross35 commented Jan 9, 2026

Whoops, looks like there's already #150900

@tgross35 tgross35 closed this Jan 9, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2026
@tgross35 tgross35 deleted the rollup-NJdMRaX branch March 30, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustc-dev-guide Area: rustc-dev-guide A-rustdoc-json Area: Rustdoc JSON backend A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` O-unix Operating system: Unix-like rollup A PR which is a rollup T-clippy Relevant to the Clippy team. 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.