Commit Graph

291081 Commits

Author SHA1 Message Date
The Miri Cronjob Bot
b2a8690aa1 Preparing for merge from rustc 2025-05-19 04:54:41 +00:00
The rustc-dev-guide Cronjob Bot
288ca05976 Merge from rustc 2025-05-19 04:16:41 +00:00
The rustc-dev-guide Cronjob Bot
70ead0af5b Preparing for merge from rustc 2025-05-19 04:10:52 +00:00
Jeremy Smart
90ebad3f49 add exact_div functions 2025-05-18 23:49:28 -04:00
Stuart Cook
93bc64dd49 Rollup merge of #141110 - xizheyin:issue-141107, r=workingjubilee
[std] fix the presentation of `split_off_mut` and `split_off` documentation

Fixes #141107

r? libs
2025-05-19 13:24:55 +10:00
Stuart Cook
a22efe773d Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin
make `rustc_attr_parsing` less dominant in the rustc crate graph

It has/had a glob re-export of `rustc_attr_data_structures`, which is a crate much lower in the graph, and a lot of crates were using it *just* (or *mostly*) for that re-export, while they can rely on `rustc_attr_data_structures` directly.

Previous graph:
![graph_1](https://github.com/user-attachments/assets/f4a5f13c-4222-4903-b56d-28c83511fcbd)

Graph with this PR:
![graph_2](https://github.com/user-attachments/assets/1e053d9c-75cc-402b-84df-86229c98277a)

The first commit keeps the re-export, and just changes the dependency if possible. The second commit is the "breaking change" which removes the re-export, and "explicitly" adds the `rustc_attr_data_structures` dependency where needed. It also switches over some src/tools/*.

The second commit is actually a lot more involved than I expected. Please let me know if it's a better idea to back it out and just keep the first commit.
2025-05-19 13:24:54 +10:00
Stuart Cook
d5e59b8a38 Rollup merge of #141094 - satler-git:issue-101650, r=lcnr
add regression test for rust-lang#101650

closes #101650, which was already fixed.
2025-05-19 13:24:54 +10:00
Stuart Cook
599b08ada8 Rollup merge of #140874 - mejrs:rads, r=WaffleLapkin
make `rustc_attr_parsing` less dominant in the rustc crate graph

It has/had a glob re-export of `rustc_attr_data_structures`, which is a crate much lower in the graph, and a lot of crates were using it *just* (or *mostly*) for that re-export, while they can rely on `rustc_attr_data_structures` directly.

Previous graph:
![graph_1](https://github.com/user-attachments/assets/f4a5f13c-4222-4903-b56d-28c83511fcbd)

Graph with this PR:
![graph_2](https://github.com/user-attachments/assets/1e053d9c-75cc-402b-84df-86229c98277a)

The first commit keeps the re-export, and just changes the dependency if possible. The second commit is the "breaking change" which removes the re-export, and "explicitly" adds the `rustc_attr_data_structures` dependency where needed. It also switches over some src/tools/*.

The second commit is actually a lot more involved than I expected. Please let me know if it's a better idea to back it out and just keep the first commit.
2025-05-19 13:24:54 +10:00
Stuart Cook
0513e3b463 Rollup merge of #140049 - haenoe:fix-autodiff-generics, r=ZuseZ4
fix autodiff macro on generic functions

heloo there!
This short PR allows applying the `autodiff` macro to generic functions like this one.
It only touches the frontend part, since the `rustc_autodiff` macro can already handle generics.
```rust
#[autodiff(d_square, Reverse, Duplicated, Active)]
fn square<T: std::ops::Mul<Output = T> + Copy>(x: &T) -> T {
    *x * *x
}
```
Thanks to Manuel for creating an issue on this. For more information on this see #140032
r? `@ZuseZ4`

As always: thanks for any piece of feedback!!

Fixes: #140032
Tracking issue for autodiff: https://github.com/rust-lang/rust/issues/124509
2025-05-19 13:24:53 +10:00
bors
e42bbfe1f7 Auto merge of #140154 - Berrysoft:cygwin-host, r=jieyouxu
Cygwin support in rustc

This PR builds host rustc targeting cygwin.

- [x] https://github.com/rust-lang/stacker/pull/122
- [x] https://github.com/nagisa/rust_libloading/pull/173
- [x] https://github.com/Detegr/rust-ctrlc/pull/131
- [x] https://github.com/rust-random/getrandom/pull/654
- [x] https://github.com/msys2/MSYS2-packages/issues/5350
- [x] https://github.com/rust-lang/rust/pull/140886
- [x] https://github.com/rust-lang/rust/pull/140921
- [x] https://github.com/rust-lang/rust/pull/140973

Currently supported:
* rustc
* rustdoc
* rustfmt
* clippy

Blocking:
* cargo: blocked by https://github.com/rust-lang/socket2/pull/568
* rust-analyzer: needs `cargo update`, fixed upstream

```
$ rustc --version --verbose
rustc 1.88.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-cygwin
release: 1.88.0-dev
LLVM version: 20.1.4
```
2025-05-18 23:53:04 +00:00
bors
4d051fb306 Auto merge of #127013 - tgross35:f16-format-parse, r=Mark-Simulacrum
Add `f16` formatting and parsing

Use the same algorithms as for `f32` and `f64` to implement `f16` parsing and printing.

try-job: x86_64-gnu-aux
2025-05-18 20:38:01 +00:00
Samuel Tardieu
375c65030b fix: unnecessary_to_owned FP when map key is a reference (#14834)
Closes rust-lang/rust-clippy#14833

changelog: [`unnecessary_to_owned`] fix FP when map key is a reference
2025-05-18 19:49:20 +00:00
llogiq
b03370b9ce Add a reason to/remove some //@no-rustfix annotations (#14839)
changelog: none
2025-05-18 18:53:22 +00:00
León Orell Valerian Liehr
46aad859c8 Merge pull request #2391 from fmease/excl-iss-w-pr
Exclude issues with an associated PR from the "What should I work on" GH query
2025-05-18 20:05:13 +02:00
León Orell Valerian Liehr
34ee7e206f Exclude issues with an associated PR from the "What should I work on" GH query 2025-05-18 20:01:47 +02:00
Trevor Gross
250869e909 float: Add f16 to test-float-parse
This requires a fix to the subnormal test to cap the maximum allowed
value within the maximum mantissa.
2025-05-18 16:51:28 +00:00
Trevor Gross
977d841869 float: Add tests for f16 conversions to and from decimal
Extend the existing tests for `f32` and `f64` with versions that include
`f16`'s new printing and parsing implementations.

Co-authored-by: Speedy_Lex <alex.ciocildau@gmail.com>
2025-05-18 16:51:28 +00:00
bors
4455c89370 Auto merge of #141232 - fmease:rollup-qr9mobf, r=fmease
Rollup of 8 pull requests

Successful merges:

 - #138940 (Stabilize the avx512 target features)
 - #140490 (split `asm!` parsing and validation)
 - #140628 (std: stop using TLS in signal handler)
 - #140746 (name resolution for guard patterns)
 - #140926 (Return value of coroutine_layout fn changed to Result with LayoutError)
 - #141127 (bump windows crate for compiler,bootstrap and tools)
 - #141214 (Miri subtree update)
 - #141218 (gvn: avoid creating overlapping assignments)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-18 16:46:11 +00:00
León Orell Valerian Liehr
50b20b73da Rollup merge of #141218 - dianqk:gvn-overlapping, r=oli-obk
gvn: avoid creating overlapping assignments

Quick fix #141038, as I couldn't find a way to avoid in-place modification. I'm considering handling all `ravlue` modifications within the `visit_statement` function.

r? mir-opt
2025-05-18 18:44:14 +02:00
León Orell Valerian Liehr
cf3b1b1d92 Rollup merge of #141214 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? ``@ghost``

Fixes https://github.com/rust-lang/miri/issues/4328
2025-05-18 18:44:13 +02:00
León Orell Valerian Liehr
20bd5977ed Rollup merge of #141127 - klensy:windows-bump-61, r=albertlarsan68,jieyouxu
bump windows crate for compiler,bootstrap and tools

This dedupes crate versions. For `x86_64-pc-windows-msvc` stage1 cuts few kb from `rustc_driver.dll`, nice.
2025-05-18 18:44:13 +02:00
León Orell Valerian Liehr
3af0c43f06 Rollup merge of #140926 - azhogin:azhogin/async-drop-coroutine-layout-returns-layout-error, r=oli-obk
Return value of coroutine_layout fn changed to Result with LayoutError

Continue of https://github.com/rust-lang/rust/pull/140902:
`coroutine_layout` fn is now returns `Result` with `LayoutError` to have consistent error with `layout_of_uncached`.
`async_drop_coroutine_layout` fn is now return `LayoutError::TooGeneric` in case of not-fully-specialized `async_drop_in_place<T>::{closure}` coroutine.
2025-05-18 18:44:12 +02:00
León Orell Valerian Liehr
4e5b1aa055 Rollup merge of #140746 - dianne:guard-pat-res, r=oli-obk
name resolution for guard patterns

This PR provides an initial implementation of name resolution for guard patterns [(RFC 3637)](https://github.com/rust-lang/rfcs/blob/master/text/3637-guard-patterns.md). This does not change the requirement that the bindings on either side of an or-pattern must be the same [(proposal here)](https://github.com/rust-lang/rfcs/blob/master/text/3637-guard-patterns.md#allowing-mismatching-bindings-when-possible); the code that handles that is separate from what this PR touches, so I'm saving it for a follow-up.

On a technical level, this separates "collecting the bindings in a pattern" (which was already done for or-patterns) from "introducing those bindings into scope". I believe the approach used here can be extended straightforwardly in the future to work with `if let` guard patterns, but I haven't tried it myself since we don't allow those yet.

Tracking issue for guard patterns: #129967

cc ``@Nadrieril``
2025-05-18 18:44:11 +02:00
León Orell Valerian Liehr
6f415e0f4c Rollup merge of #140628 - joboet:async_signal_safe, r=Mark-Simulacrum
std: stop using TLS in signal handler

TLS is not async-signal-safe, making its use in the signal handler used to detect stack overflows unsound (c.f. #133698). POSIX however lists two thread-specific identifiers that can be obtained in a signal handler: the current `pthread_t` and the address of `errno`. Since `pthread_equal` is not AS-safe, `pthread_t` should be considered opaque, so for our purposes, `&errno` is the only option. This however works nicely: we can use the address as a key into a map that stores information for each thread. This PR uses a `BTreeMap` protected by a spin lock to hold the guard page address and thread name and thus fixes #133698.
2025-05-18 18:44:11 +02:00
León Orell Valerian Liehr
2f0c6e217f Rollup merge of #140490 - folkertdev:asm-parser-changes, r=Amanieu,traviscross
split `asm!` parsing and validation

This PR splits `asm!` parsing and validation into two separate steps.

The parser constructs a `Vec<RawAsmArg>`, with each element corresponding to an argument to one of the `asm!` macros.
The validation then checks things like ordering of arguments or that options are not provided twice.

The motivation is https://github.com/rust-lang/rust/issues/140279, which wants to add `#[cfg(...)]` support to these arguments. This support can now be added in a straightforward way by adding an `attributes: ast::AttrVec` field to `RawAsmArg`.

An extra reason for this split is that `rustfmt` probably wants to format the assembly at some point (currently that appears to be stubbed out, and the formatting is unstable https://github.com/rust-lang/style-team/issues/152).

r? ``@ghost`` (just want to look at CI for now)

cc ``@ytmimi`` we discussed asm formatting a little while ago in https://github.com/rust-lang/rustfmt/issues/6526. Am I correct in assuming that `AsmArgs` does not give enough information for formatting, but that `RawAsmArgs` would (it e.g. does not join information from multiple lines). This must have been an issue before?

try-job: aarch64-apple
2025-05-18 18:44:10 +02:00
León Orell Valerian Liehr
2f6811eff8 Rollup merge of #138940 - sayantn:stabilize-avx512, r=Amanieu,traviscross
Stabilize the avx512 target features

This PR stabilizes the AVX512 target features - see [this comment](https://github.com/rust-lang/rust/issues/111137#issuecomment-2745821279).

Tracking Issue - #44839

The target feature UI tests have been changed to `x87` (chosen because this is very unlikely to stablize ever, please comment if some other feature will be better)

related: #111137
2025-05-18 18:44:10 +02:00
Trevor Gross
6fc60b8b04 float: Add f16 parsing and printing
Use the existing Lemire (decimal -> float) and Dragon / Grisu algorithms
(float -> decimal) to add support for `f16`. This allows updating the
implementation for `Display` to the expected behavior for `Display`
(currently it prints the a hex bitwise representation), matching other
floats, and adds a `FromStr` implementation.

In order to avoid crashes when compiling with Cranelift or on targets
where f16 is not well supported, a fallback is used if
`cfg(target_has_reliable_f16)` is not true.
2025-05-18 16:43:13 +00:00
bjorn3
0e43247bc9 Fix rustc testsuite 2025-05-18 16:29:38 +00:00
yanglsh
492c4e197d fix: unnecessary_to_owned FP when map key is a reference 2025-05-19 00:27:53 +08:00
Ralf Jung
a4eb91fa63 Merge pull request #4330 from RalfJung/build-sysroot-bump
bump rustc-build-sysroot
2025-05-18 16:16:23 +00:00
Alex Macleod
19e967c6b7 Add a reason to/remove some //@no-rustfix annotations 2025-05-18 16:15:43 +00:00
mejrs
035146e398 Remove rustc_attr_data_structures re-export from rustc_attr_parsing 2025-05-18 18:14:43 +02:00
mejrs
178e09ed37 Remove rustc_attr_data_structures re-export from rustc_attr_parsing 2025-05-18 18:14:43 +02:00
Ralf Jung
eb11adc7b0 bump rustc-build-sysroot 2025-05-18 17:51:15 +02:00
Matthias Krüger
0443a66d39 more ice tests 2025-05-18 17:25:34 +02:00
xizheyin
8b48bac63d [std] fix the presentation of split_off_mut and split_off documentation
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-18 23:22:08 +08:00
bjorn3
bc02a99f8f Rustup to rustc 1.89.0-nightly (777d37277 2025-05-17) 2025-05-18 14:30:42 +00:00
bjorn3
7b670d243f Sync from rust 777d372772 2025-05-18 14:21:04 +00:00
Mahmoud Mazouz
228a7bb918 Fix typos in "Libraries and Metadata" 2025-05-18 15:37:18 +02:00
Alex Macleod
618ccd7f03 Do not call TyCtxt::type_of() on a trait (#14830)
changelog: [`useless_as_ref`]: fix ICE on trait method

Fixes rust-lang/rust-clippy#14828
2025-05-18 12:22:57 +00:00
Michael Goulet
407fac5479 Fast path for sized pred 2025-05-18 12:18:44 +00:00
Michael Goulet
1d0d258a86 Fast path for processing some obligations in the new solver 2025-05-18 12:18:44 +00:00
Ralf Jung
3c50b9be19 Merge pull request #4322 from tiif/move_test
Add more comments to libc-fs-with-isolation test
2025-05-18 12:07:38 +00:00
bors
b53e5c9db0 Auto merge of #141216 - fmease:rollup-pa5mvx3, r=fmease
Rollup of 8 pull requests

Successful merges:

 - #140113 (Add per page TOC in the `rustc` book)
 - #140511 (Stabilize `#![feature(non_null_from_ref)]`)
 - #140924 (Make some `f32`/`f64` tests also run in const-context)
 - #140966 (Remove #![feature(let_chains)] from library and src/librustdoc)
 - #141045 ([win][arm64] Remove 'Arm64 Hazard' undocumented MSVC option and instead disable problematic test)
 - #141071 (Enable [behind-upstream] triagebot option for rust-lang/rust)
 - #141132 (Use `crate::` prefix for root macro suggestions)
 - #141139 (Fix Rust for Linux ping group label)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-18 12:05:55 +00:00
tiif
f9a75a00b4 Add more comment to libc-fs-with-isolation test 2025-05-18 13:42:07 +02:00
dianne
f0b8ec1d71 name resolution for guard patterns 2025-05-18 04:21:57 -07:00
dianqk
d2e5a3d131 gvn: avoid creating overlapping assignments 2025-05-18 18:42:00 +08:00
MarcoIeni
c2792b29c3 ci: split dist-arm-linux job 2025-05-18 12:12:20 +02:00
Ralf Jung
6eb1afa468 tools-aux ci runner: also cross-test doctests 2025-05-18 11:36:59 +02:00
Folkert de Vries
26e3a5041a add AsmOptions with some named fields 2025-05-18 11:28:31 +02:00