Skip to content

[pull] master from rust-lang:master #12

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

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 8, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

antoyo and others added 27 commits May 12, 2025 11:04
Fixes rust-lang/rust-clippy#13973.

I don't think we can make `fn_to_numeric_cast_any` to be emitted in some
special cases. Its category cannot be changed at runtime.

I think in this case, the best might be a specialized new lint so we can
target exactly what we want.

----

changelog: Add new `confusing_method_to_numeric_cast` lint
relates to rust-lang/rust-clippy#14653

changelog: [`elidable_lifetime_names`]: Fix clippy version that this
lint was introduced in.

It might be good to have some automation to check that the version is
correct.
IIUC the version should be the current nightly version at the time a PR
is merged.
If a release happens while a PR is open, the version needs to be bumped
- this is easy to forget.
If an expression is not going to return from the current function of
closure, it should not get linted.

This also allows `return` expression to be linted, in addition to the
final expression. Those require blockification and proper indentation.

changelog: [`return_and_then`]: only lint returning expressions

Fixes rust-lang/rust-clippy#14781
Also, include the type name in the lint message, and simplify the span
computation.
changelog: [`type_repetition_in_bounds`]: include all generic bounds in
suggestion, clearer message which now includes the repeated type name

Fixes rust-lang/rust-clippy#14744
It was showing compare mode instead of test name.
cg_llvm: Clean up some inline assembly bindings

This PR combines a few loosely-related cleanups to LLVM bindings related to inline assembly. These include:
- Replacing `LLVMRustInlineAsm` with LLVM-C's `LLVMGetInlineAsm`
- Adjusting FFI declarations to avoid the need for explicit `as_c_char_ptr` conversions
- Flattening control flow in `inline_asm_call`

There should be no functional changes.
Update "Changelog update walkthrough" section based on
rust-lang/rust-clippy#14748 discussion

changelog: none
Use new form for T-rustdoc's {beta,stable}-{nominated,accepted} notify-Zulip triggers

Applies [#t-rustdoc > PSA: New actions on backport notifs @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/PSA.3A.20New.20actions.20on.20backport.20notifs/near/514823133).
Complements #140397.

r? `@apiraino` or T-triagebot
folkertdev and others added 30 commits May 18, 2025 11:28
apparently it doesn't really use the asm parsing at present, so this may work?
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
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.
…ross

Stabilize the avx512 target features

This PR stabilizes the AVX512 target features - see [this comment](#111137 (comment)).

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
…aviscross

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 #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 rust-lang/style-team#152).

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

cc ``@ytmimi`` we discussed asm formatting a little while ago in rust-lang/rustfmt#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
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.
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``
…-returns-layout-error, r=oli-obk

Return value of coroutine_layout fn changed to Result with LayoutError

Continue of #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.
…eyouxu

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.
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
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
Extend the existing tests for `f32` and `f64` with versions that include
`f16`'s new printing and parsing implementations.

Co-authored-by: Speedy_Lex <[email protected]>
This requires a fix to the subnormal test to cap the maximum allowed
value within the maximum mantissa.
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
Cygwin support in rustc

This PR builds host rustc targeting cygwin.

- [x] rust-lang/stacker#122
- [x] nagisa/rust_libloading#173
- [x] Detegr/rust-ctrlc#131
- [x] rust-random/getrandom#654
- [x] msys2/MSYS2-packages#5350
- [x] #140886
- [x] #140921
- [x] #140973

Currently supported:
* rustc
* rustdoc
* rustfmt
* clippy

Blocking:
* cargo: blocked by rust-lang/socket2#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
```
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: #124509
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.
add regression test for #101650

closes #101650, which was already fixed.
[std] fix the presentation of `split_off_mut` and `split_off` documentation

Fixes #141107

r? libs
Rollup of 4 pull requests

Successful merges:

 - #140049 (fix autodiff macro on generic functions)
 - #140874 (make `rustc_attr_parsing` less dominant in the rustc crate graph)
 - #141094 (add regression test for #101650)
 - #141110 ([std] fix the presentation of `split_off_mut` and `split_off` documentation)

r? `@ghost`
`@rustbot` modify labels: rollup
[win][CI] Convert paths to Windows format before adding to PATH

While trying to get the `aarch64-msvc` build working correctly (#140136), I noticed that the `PATH` observed during the Rust steps of the build on Windows builds had some entries still in MinGW format, which means that Windows would not be able to use them correctly:

From <https://github.com/rust-lang/rust/actions/runs/14606167901/job/40975555680#step:28:192> note the path for `ninja` and `sccache`.

```
PATH = Some(C:\a\rust\rust\src\ci\citool\../../../build/citool\debug\deps;C:\a\rust\rust\src\ci\citool\../../../build/citool\debug;C:\Users\runneradmin\.rustup\toolchains\stable-aarch64-pc-windows-msvc\lib\rustlib\aarch64-pc-windows-msvc\lib;C:\Program Files\Git\clangarm64/bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;/c/a/rust/rust/ninja;/c/a/rust/rust/sccache;C:\Users\runneradmin/.cargo/bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS\;C:\Program Files\Mercurial\;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files (x86)\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver\;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\arm64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.442-6\x64\bin;C:\Program Files (x86)\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PowerShell\7\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\160\DTS\Binn\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\Git\clangarm64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\Amazon\SessionManagerPlugin\bin\;C:\Program Files\Amazon\AWSSAMCLI\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps)
```
The fix for this is to use `cygpath` to convert from the Cygwin format back to native Windows format before adding to the `PATH`.

---
try-job: dist-aarch64-msvc
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: i686-msvc-1
try-job: i686-msvc-2
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
try-job: dist-i686-mingw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.