Skip to content

minor: Sync from downstream #20032

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

Merged
merged 56 commits into from
Jun 18, 2025
Merged

minor: Sync from downstream #20032

merged 56 commits into from
Jun 18, 2025

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Jun 18, 2025

Downgrade object because it fails downstream.

The Miri Cronjob Bot and others added 30 commits May 10, 2025 05:01
Add more comments to libc-fs-with-isolation test
test direct usage of io::{stdout,stderr,stdin}
FileDescription: improve read/write docs
native-lib: allow multiple libraries and/or dirs
TB: Add flag to disable the more precise interior mutability tracking
…RalfJung

Enable Non-determinism of float operations in Miri and change std tests

Links to [rust-lang#4208](rust-lang/miri#4208) and [rust-lang#3555](rust-lang/miri#3555) in Miri.

Non-determinism of floating point operations was disabled in rust-lang/rust#137594 because it breaks the tests and doc-tests in core/coretests and std. This PR enables some of them.

This pr includes the following changes:

- Enables the float non-determinism but with a lower relative error of 4ULP instead of 16ULP
- These operations now have a fixed output based on the C23 standard, except the pow operations, this is tracked in [rust-lang#4286](rust-lang/miri#4286 (comment))
- Changes tests that made incorrect assumptions about the operations, not to make that assumption anymore (from `assert_eq!` to `assert_approx_eq!`.
- Changed the doctests of the stdlib of these operations to compare against fixed constants instead of `f*::EPSILON`, which now succeed with Miri and `-Zmiri-many-seeds`
- Added a constant `APPROX_DELTA` in `std/tests/floats/f32.rs` which is used for approximation tests, but with a different value when run in Miri. This is to make these tests succeed.
- Added tests in the float tests of Miri to test the C23 behaviour.

Fixes rust-lang/miri#4208
Subtree update of `rust-analyzer`

r? `@ghost`
Update cargo

18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51
2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000
- fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640)
- Update "time out" to "timeout" (rust-lang/cargo#15637)
- fix(workspace): reload current manifest path member only (rust-lang/cargo#15633)
- Update dependencies (rust-lang/cargo#15635)
- fix(publish): Don't tell people to ctrl-c without knowing consequences  (rust-lang/cargo#15632)
- refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631)
- fix(package): Skip registry check if its not needed (rust-lang/cargo#15629)
- Add --offline for comp (rust-lang/cargo#15623)
- cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295)
- test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628)
- fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626)
- docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572)
- Remove double reference in Shell::print_json (rust-lang/cargo#15460)
- fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614)
- test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621)
- fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617)
- Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281)
- chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616)

r? ghost
test_dup: ensure the FDs remain in sync even after dup'ing
mir-opt: Do not create storage marks in EarlyOtherwiseBranch

Fixes #141212.

The first commit add `StorageDead` by creating new indirect BB that makes CFG more complicated, but I think it's better to just not create storage marks.

r? mir-opt
Make root vars more stable

Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in rust-lang/rust#141500 more "stable" when there are a lot of vars flying around.

r? `@ghost`
`FIXME(-Znext-solver)` triage

r? `@BoxyUwU`
bors and others added 24 commits June 14, 2025 16:43
Simplify implementation of Rust intrinsics by using type parameters in the cache

The current implementation of intrinsics have a lot of duplication to handle different overloads of overloaded LLVM intrinsic. This PR uses the **base name and the type parameters** in the cache instead of the full, overloaded name. This has the benefit that `call_intrinsic` doesn't need to provide the full name, rather the type parameters (which is most of the time more available). This uses `LLVMIntrinsicCopyOverloadedName2` to get the overloaded name from the base name and the type parameters, and only uses it to declare the function.

(originally was part of rust-lang/rust#140763, split off later)

`@rustbot` label A-codegen A-LLVM
r? codegen
…nTheVoid

rustdoc_json: reduce allocations

These commits reduce the number of allocations done for rustdoc_json, mostly by avoiding unnecessary clones.

Best reviewed one commit at a time.

r? `@aDotInTheVoid`
Do not clone Arc when hashing span.

Tiny improvement I was when trying to profile span hashing.
…Jung

clarify `rustc_do_not_const_check` comment

~~Given that we have used this attribute for other reasons before it seems appropriate to make this a "usually".~~

Add function name as a pointer

cc ```@rust-lang/wg-const-eval```
…iler-errors

use `if let` guards where possible

these crates already enable the feature
Remove an `njn:` comment accidentaly left behind.

r? `@chenyukang`
Fix `-nopt` CI jobs

They were using `--config` instead of `--set`, which overrides too much stuff after recent changes to config merging.

Should hopefully unblock rust-lang/rust#142447.

r? `@jieyouxu`
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#141639 (Expose discriminant values in stable_mir)
 - rust-lang/rust#142082 (Refactor `rustc_attr_data_structures` documentation)
 - rust-lang/rust#142125 (Stabilize "file_lock" feature)
 - rust-lang/rust#142236 (Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls)
 - rust-lang/rust#142373 (Fix Debug for Location)
 - rust-lang/rust#142416 (Assorted bootstrap cleanups (step 2))
 - rust-lang/rust#142431 (Add initial version of snapshot tests to bootstrap)
 - rust-lang/rust#142450 (Add documentation on top of `rustc_middle/src/query/mod.rs`)
 - rust-lang/rust#142528 (clarify `rustc_do_not_const_check` comment)
 - rust-lang/rust#142530 (use `if let` guards where possible)
 - rust-lang/rust#142561 (Remove an `njn:` comment accidentaly left behind.)
 - rust-lang/rust#142566 (Fix `-nopt` CI jobs)

r? `@ghost`
`@rustbot` modify labels: rollup
Sized Hierarchy: Part I

This patch implements the non-const parts of rust-lang/rfcs#3729. It introduces two new traits to the standard library, `MetaSized` and `PointeeSized`. See the RFC for the rationale behind these traits and to discuss whether this change makes sense in the abstract.

These traits are unstable (as is their constness), so users cannot refer to them without opting-in to `feature(sized_hierarchy)`. These traits are not behind `cfg`s as this would make implementation unfeasible, there would simply be too many `cfg`s required to add the necessary bounds everywhere. So, like `Sized`, these traits are automatically implemented by the compiler.

RFC 3729 describes changes which are necessary to preserve backwards compatibility given the introduction of these traits, which are implemented and as follows:

- `?Sized` is rewritten as `MetaSized`
- `MetaSized` is added as a default supertrait for all traits w/out an explicit sizedness supertrait already.

There are no edition migrations implemented in this,  as these are primarily required for the constness parts of the RFC and prior to stabilisation of this (and so will come in follow-up PRs alongside the const parts). All diagnostic output should remain the same (showing `?Sized` even if the compiler sees `MetaSized`) unless the `sized_hierarchy` feature is enabled.

Due to the use of unstable extern types in the standard library and rustc, some bounds in both projects have had to be relaxed already - this is unfortunate but unavoidable so that these extern types can continue to be used where they were before. Performing these relaxations in the standard library and rustc are desirable longer-term anyway, but some bounds are not as relaxed as they ideally would be due to the inability to relax `Deref::Target` (this will be investigated separately).

It is hoped that this is implemented such that it could be merged and these traits could exist "under the hood" without that being observable to the user (other than in any performance impact this has on the compiler, etc). Some details might leak through due to the standard library relaxations, but this has not been observed in test output.

**Notes:**

- Any commits starting with "upstream:" can be ignored, as these correspond to other upstream PRs that this is based on which have yet to be merged.
- This best reviewed commit-by-commit. I've attempted to make the implementation easy to follow and keep similar changes and test output updates together.
  - Each commit has a short description describing its purpose.
  - This patch is large but it's primarily in the test suite.
- I've worked on the performance of this patch and a few optimisations are implemented so that the performance impact is neutral-to-minor.
- `PointeeSized` is a different name from the RFC just to make it more obvious that it is different from `std::ptr::Pointee` but all the names are yet to be bikeshed anyway.
- `@nikomatsakis` has confirmed [that this can proceed as an experiment from the t-lang side](https://rust-lang.zulipchat.com/#narrow/channel/435869-project-goals/topic/SVE.20and.20SME.20on.20AArch64.20.28goals.23270.29/near/506196491)
- FCP in rust-lang/rust#137944 (comment)

Fixes rust-lang/rust#79409.

r? `@ghost` (I'll discuss this with relevant teams to find a reviewer)
Subtree update of `rust-analyzer`

r? `@ghost`
impl `Default` for `array::IntoIter`

cc rust-lang/rust#91583

my personal use of this feature comes from https://github.com/fee1-dead/w/blob/092db5df631ea515b688bae99c7f02eef12d7221/src/cont.rs#L154-L170

insta-stable, but I feel like this is small enough to _not_ require an ACP (but a FCP per https://forge.rust-lang.org/libs/maintaining-std.html#when-theres-new-trait-impls)? feel free to correct me if I am wrong.
Add support for repetition to `proc_macro::quote`

Progress toward: rust-lang/rust#140238
…ochenkov

avoid `&mut P<T>` in `visit_expr` etc methods

trying a different way than rust-lang/rust#141636
r? ghost
Windows: Use anonymous pipes in Command

When setting `Stdio::pipe` on `Command` we want to create an anonymous pipe that can be used asynchronously (at least on our end). Usually we'd use [`CreatePipe`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createpipe) to open anonymous pipes but unfortunately it opens pipes for synchronous access. The alternative is to use [`CreateNamedPipeW`](https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-createnamedpipew) which does allow asynchronous access but that requires giving a file name to the pipe. So we currently have this awful hack where we attempt to emulate anonymous pipes using `CreateNamedPipeW` by attempting to create a unique name and looping until we find one that doesn't already exist.

The better option is to use the lower level [`NtCreateNamedPipeFile`](https://learn.microsoft.com/en-us/windows/win32/devnotes/nt-create-named-pipe-file) (which is used internally by both `CreatePipe` and `CreateNamedPipeW`). This function wasn't documented until a few years ago but now that it is it's ok for us to use it.

try-job: *msvc*
try-job: *mingw*
alloc: less static mut + some cleanup

I'm looking into rust-lang/rust#125035 and would like some feedback on my approach.
Generic ctx imprv

Cleanup work for my gpu pr

r? `@oli-obk`
…rycat

Lint about `console` calls in rustdoc JS

As discussed [here](rust-lang/rust#142100 (comment)), this PR enforces that `console` is not used in rustdoc JS by default.

cc `@lolbinarycat`
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#141574 (impl `Default` for `array::IntoIter`)
 - rust-lang/rust#141608 (Add support for repetition to `proc_macro::quote`)
 - rust-lang/rust#142100 (rustdoc: make srcIndex no longer a global variable)
 - rust-lang/rust#142371 (avoid `&mut P<T>` in `visit_expr` etc methods)
 - rust-lang/rust#142517 (Windows: Use anonymous pipes in Command)
 - rust-lang/rust#142520 (alloc: less static mut + some cleanup)
 - rust-lang/rust#142588 (Generic ctx imprv)
 - rust-lang/rust#142605 (Don't unwrap in enzyme builds in case of missing llvm-config)
 - rust-lang/rust#142608 (Refresh module-level docs for `rustc_target::spec`)
 - rust-lang/rust#142618 (Lint about `console` calls in rustdoc JS)
 - rust-lang/rust#142620 (Remove a panicking branch in `BorrowedCursor::advance`)
 - rust-lang/rust#142631 (Dont suggest remove semi inside macro expansion for redundant semi lint)
 - rust-lang/rust#142632 (Update cargo)
 - rust-lang/rust#142635 (Temporarily add back -Zwasm-c-abi=spec)

r? `@ghost`
`@rustbot` modify labels: rollup
Safer implementation of RepeatN

I've seen the "Use MaybeUninit for RepeatN" commit while reading This Week In Rust and immediately thought about something I've written some time ago - https://github.com/Soveu/repeat_finite/blob/master/src/lib.rs.

Using the fact, that `Option` will find niche in `(T, NonZeroUsize)`, we can construct something that has the same size as `(T, usize)` while completely getting rid of `MaybeUninit`.
This leaves only `unsafe` on `TrustedLen`, which is pretty neat.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 18, 2025
@lnicola lnicola enabled auto-merge June 18, 2025 06:56
@lnicola lnicola added this pull request to the merge queue Jun 18, 2025
Merged via the queue into rust-lang:master with commit 6807f60 Jun 18, 2025
14 checks passed
@lnicola lnicola deleted the sync-from-rust branch June 18, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants