307171 Commits

Author SHA1 Message Date
usamoi
21dd997aec support link modifier as-needed for raw-dylib-elf 2025-10-06 08:56:40 +08:00
bors
839222065a Auto merge of #147384 - workingjubilee:rollup-2qqqfn4, r=workingjubilee
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#147327 (cg_llvm: Remove inherent methods from several LLVM FFI types)
 - rust-lang/rust#147332 (Set opt-level flag for installing tool only on CI)
 - rust-lang/rust#147374 (bootstrap: don't build book redirect pages during dry-run/test)
 - rust-lang/rust#147376 (bootstrap: relax `compiler-rt` root assertion)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 19:03:28 +00:00
Jubilee
0d3e4d1c2c
Rollup merge of #147376 - jieyouxu:bootstrap-compiler-rt-self-test, r=Kobzol
bootstrap: relax `compiler-rt` root assertion

Not needed during tests. This would otherwise require `src/llvm-project` submodule to be initialized and `compiler-rt/` subdirectory to be present.

I need this and rust-lang/rust#147374 to get bootstrap self-tests to pass with no git submodules checked out locally.

r? `@Kobzol` (or bootstrap)
2025-10-05 11:59:24 -07:00
Jubilee
aa37ad40d5
Rollup merge of #147374 - jieyouxu:bootstrap-redirect-pages, r=Kobzol
bootstrap: don't build book redirect pages during dry-run/test

Currently, `./x test bootstrap` does not automatically transitively checkout submodules needed to pass all involved test steps. Apparently one place where bootstrap's self-test can choke on locally is trying to build book redirect pages without the book submodules checked out.

This change is orthogonal to making bootstrap checking out required submodules for self-tests, and IMO is beneficial regardless since IMO we should not be building these redirect pages during test/dry-run _anyway_.

This was blocking me trying to rebless bootstrap self-tests for rust-lang/rust#147372. cf. [#t-infra/bootstrap > Bootstrap self-tests @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20self-tests/near/543157194).

r? `@Kobzol` (or bootstrap)
2025-10-05 11:59:24 -07:00
Jubilee
23d1cc7c52
Rollup merge of #147332 - Shunpoco:fast-spellcheck, r=Kobzol
Set opt-level flag for installing tool only on CI

## Context
ensure_version_or_cargo_install uses -Copt-level=0 for quicker installation. However, the flag affects the tool's performance. For example, typos-cli with opt-level=0 takes 15 seconds for checking /compiler on my local, but the tool with default opt-level only takes less than 1 sec.

It fixes rust-lang/rust#147331

## Changes
This PR enables the option only when the test tidy is run on CI.
We've discussed that opt-level=1 should be enough, so I also change the level from 0 to 1.
2025-10-05 11:59:23 -07:00
Jubilee
d8fc465bbb
Rollup merge of #147327 - Zalathar:inherent, r=workingjubilee
cg_llvm: Remove inherent methods from several LLVM FFI types

This is mainly motivated by rust-lang/rust#142897, which proposes to move the LLVM FFI bindings out of `rustc_codegen_llvm` and into `rustc_llvm`, which is arguably the more correct place for them from a linking perspective.

---

In order to perform that migration, all of the types used in FFI signatures also need to be moved. However, several of those types have inherent methods that convert from backend-independent types to LLVM FFI types.

Moving the inherent methods as-is would require adding a lot of otherwise-unnecessary dependencies to `rustc_llvm`. And we can't leave them behind as-is, because inherent methods can't be defined in another crate.

Therefore, this PR replaces several of those inherent methods with either extension trait methods or free functions.
2025-10-05 11:59:23 -07:00
Shunpoco
8a31837054 Set opt-level for installing tool only on CI
ensure_version_or_cargo_install uses -Copt-level=0 for quicker installation.
However, the flag affects the tool's performance. For example, typos-cli with opt-level=0 takes 15 seconds for checking ./compiler, but the tool with default opt-level only takes less than 1 sec.
This commit enables the option only when the test tidy is run on CI.
2025-10-05 16:57:51 +01:00
bors
981353ca16 Auto merge of #147345 - Kivooeo:tidy-flt-fix, r=Kobzol
Tidy: revert `flt` to `ftl`

As was explained here https://github.com/rust-lang/rust/pull/147191#issuecomment-3353801210, this reverting this change because `flt` is incorrect format

Also maybe there is existed PR for that? I didn't found one

Follow up https://github.com/rust-lang/rust/pull/147191

cc `@GuillaumeGomez`
2025-10-05 15:55:18 +00:00
bors
bcbbdcb852 Auto merge of #147371 - Zalathar:rollup-897uitw, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144908 (Fix doctest output json)
 - rust-lang/rust#147262 (Make #[link="dl"] an FCW rather than an error)
 - rust-lang/rust#147364 (update autodiff testcases)
 - rust-lang/rust#147367 (Trivial code cleanup in resolve)
 - rust-lang/rust#147369 (Fill out AVR target metadata)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 12:43:00 +00:00
Jieyou Xu
a8b9a57674
bootstrap: relax compiler-rt root assertion
Not needed during tests.
2025-10-05 20:30:52 +08:00
Jieyou Xu
7ed476f51f
bootstrap: don't build redirect pages during dry-run/test 2025-10-05 20:18:38 +08:00
Stuart Cook
21b5d6bd86
Rollup merge of #147369 - Noratrieb:avr-metadata, r=jieyouxu
Fill out AVR target metadata

This will make `-Zbuild-std` automatically build the right crates, notably not building `std` by default, which will both be useful for users and also fix the build for https://does-it-build.noratrieb.dev, which currently tries to build std: http://localhost:3000/build?nightly=2025-07-12&target=avr-none&mode=std.

cc `@Patryk27` but I don't think this necessarily needs your approval
2025-10-05 22:15:08 +11:00
Stuart Cook
94e04993a1
Rollup merge of #147367 - chenyukang:yukang-trivial-cleanup, r=jieyouxu
Trivial code cleanup in resolve

r? `@jieyouxu`
2025-10-05 22:15:07 +11:00
Stuart Cook
c8407194f9
Rollup merge of #147364 - ZuseZ4:update-autodiff-tests, r=jieyouxu
update autodiff testcases

unblock https://github.com/EnzymeAD/Enzyme/pull/2430 (again).
Just as I landed a fix for the last test, this one broke. The test should now be fine if the name mangling hash changes again.

Also removed an outdated fixme that's not needed since moving autodiff to an intrinsic. The test currently just checks that it compiles, I'll add more precise checks once we actually run this in CI.

r? compiler
2025-10-05 22:15:06 +11:00
Stuart Cook
d97e346ac7
Rollup merge of #147262 - JonathanBrouwer:fix-link, r=jieyouxu
Make #[link="dl"] an FCW rather than an error

Fixes https://github.com/rust-lang/rust/issues/147254
I forgot to implement the T-lang decision in https://github.com/rust-lang/rust/pull/143193#issuecomment-3138479942, this implements that decision

r? ``@jdonszelmann``
Can be reviewed commit-by-commit
This needs a beta backport
2025-10-05 22:15:06 +11:00
Stuart Cook
cc1a80629f
Rollup merge of #144908 - GuillaumeGomez:fix-doctest-output-json, r=fmease
Fix doctest output json

Fixes rust-lang/rust#144798.

Hopefully it will work with the new changes in `libtest` without needing to do both at once.

This PR moves the `rustdoc` merged doctest extra information directly into `libtest` to ensure they share the same rendering to prevent the bug uncovered in rust-lang/rust#144798.

cc `@lolbinary` (as you reviewed the first PR)

And since we're making changes to `libtest`:

r? `@Amanieu`
2025-10-05 22:15:05 +11:00
nora
9ccaf080cb
Fill out AVR target metadata
This will make `-Zbuild-std` automatically build the right crates, notably not building `std` by default, which will both be useful for users and also fix the build for https://does-it-build.noratrieb.dev.
2025-10-05 12:01:23 +02:00
yukang
95445f9b96 Trivial code cleanup in resolve 2025-10-05 17:27:45 +08:00
Guillaume Gomez
99c7959bb7 Add regression test for rustdoc output format 2025-10-05 11:13:05 +02:00
Manuel Drehwald
7c8fe29fd6 solve autodiffv2.rs FIXME and make identical_fnc test more robust 2025-10-05 03:07:51 -04:00
bors
e2c96cc06b Auto merge of #147363 - Zalathar:rollup-d9kd06g, r=Zalathar
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting)
 - rust-lang/rust#147309 (Add documentation about unwinding to wasm targets)
 - rust-lang/rust#147310 (Mark `PatternTypo` suggestion as maybe incorrect)
 - rust-lang/rust#147320 (Avoid to suggest pattern match on the similarly named in fn signature)
 - rust-lang/rust#147328 (Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`)
 - rust-lang/rust#147337 (Make `fmt::Write` a diagnostic item)
 - rust-lang/rust#147349 (Improve the advice given by panic_immediate_abort)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 04:36:49 +00:00
Stuart Cook
a0a4905723
Rollup merge of #147349 - saethlin:panic-immediate-advice, r=Noratrieb
Improve the advice given by panic_immediate_abort

Now that https://github.com/rust-lang/rust/pull/147338 is merged, users should consider using the Cargo support for immediate-aborting panics.
2025-10-05 15:35:05 +11:00
Stuart Cook
80759350c7
Rollup merge of #147337 - ada4a:write-diag-item, r=fmease
Make `fmt::Write` a diagnostic item

I'm working on an enhancement to [`clippy::format_push_string`](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string), which would suggest an autofix to replace `push_str`/`+=` with `write!`. But that could require importing `std::fmt::Write`, and so I need this diagnostic item to check if it's already in scope.

The reason I called it `FmtWrite` and not just `Write` is that there's already an `IoWrite` defined.
2025-10-05 15:35:04 +11:00
Stuart Cook
56c96aebfc
Rollup merge of #147328 - EFanZh:lock-with, r=joboet
Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`

ACP: https://github.com/rust-lang/libs-team/issues/497.
2025-10-05 15:35:04 +11:00
Stuart Cook
cae84c695a
Rollup merge of #147320 - chenyukang:yukang-fix-147303-fn-arg, r=jieyouxu
Avoid to suggest pattern match on the similarly named in fn signature

Fixes rust-lang/rust#147303
2025-10-05 15:35:03 +11:00
Stuart Cook
620ffe6595
Rollup merge of #147310 - Jules-Bertholet:maybe-incorrect-pattern-typo, r=chenyukang
Mark `PatternTypo` suggestion as maybe incorrect

Partial fix for https://github.com/rust-lang/rust/issues/147303.

`@rustbot` label A-diagnostics A-suggestion-diagnostics D-invalid-suggestion
2025-10-05 15:35:03 +11:00
Stuart Cook
ff86a7db83
Rollup merge of #147309 - alexcrichton:wasm-unwinding-docs, r=jieyouxu
Add documentation about unwinding to wasm targets

This commit adds some documentation about the state of `-Cpanic=unwind` for the following wasm targets:

* `wasm32-unknown-unknown`
* `wasm32-wasip1`
* `wasm32-wasip2`
* `wasm32v1-none`

Notably it's possible to use `-Cpanic=unwind` with `-Zbuild-std` and it's also mentioned that there are no concrete proposals at this time to adding a new set of targets which support unwinding. My hunch is that in a few years' time it would make sense to enable it by default on these targets (except for `wasm32v1-none`) but that's a problem for future folks to debate. For now this is an attempt to document the status quo.
2025-10-05 15:35:02 +11:00
Stuart Cook
59982f9a29
Rollup merge of #147288 - Zalathar:directive, r=jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting

- Follow-up to rust-lang/rust#147170.

---

Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent.

The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits.

r? jieyouxu
2025-10-05 15:35:02 +11:00
Zalathar
33c99a0468 Use new DirectiveLine features in directive parsing 2025-10-05 10:47:21 +11:00
Zalathar
6783e9465b Allow easy extraction of name/value from a DirectiveLine 2025-10-05 10:47:21 +11:00
Zalathar
757d98ce2b Move DirectiveLine into its own submodule 2025-10-05 10:47:19 +11:00
bors
227ac7c3cd Auto merge of #147293 - nnethercote:avoid-dep_dep_node, r=saethlin
Avoid getting `dep_dep_node` unnecessarily.

It's gotten on a hot path but only for use within `debug!`.

r? `@saethlin`
2025-10-04 21:23:46 +00:00
Ben Kimock
b5fb01d67d Improve the advice given by panic_immediate_abort 2025-10-04 15:53:00 -04:00
Kivooeo
67bc030833 change flt back to ftl 2025-10-04 18:18:58 +00:00
bors
2cb4e7dce8 Auto merge of #147340 - matthiaskrgr:rollup-icymmsc, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#142670 (Document fully-qualified syntax in `as`' keyword doc)
 - rust-lang/rust#145685 (add CloneFromCell and Cell::get_cloned)
 - rust-lang/rust#146330 (Bump unicode_data and printables to version 17.0.0)
 - rust-lang/rust#146451 (Fix atan2 inaccuracy in documentation)
 - rust-lang/rust#146479 (add mem::conjure_zst)
 - rust-lang/rust#147117 (interpret `#[used]` as `#[used(compiler)]` on illumos)
 - rust-lang/rust#147190 (std: `sys::net` cleanups)
 - rust-lang/rust#147251 (Do not assert that a change in global cache only happens when concurrent)
 - rust-lang/rust#147280 (Return to needs-llvm-components being info-only)
 - rust-lang/rust#147315 (bless autodiff batching test)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-04 18:08:24 +00:00
Matthias Krüger
a84359c5a7
Rollup merge of #147315 - ZuseZ4:fix-ad-batching-test, r=jieyouxu
bless autodiff batching test

This pr blesses a broken test and unblocks running rust in the Enzyme CI: https://github.com/EnzymeAD/Enzyme/pull/2430
Enzyme is the plugin used by our std::autodiff and (future) std::batching modules, both of which are not build by default.
In the near future we also hope to enable std::autodiff in the Rust CI.

This test is the only one to combine two features, automatic differentiation and batching/vectorization. This combination is even more experimental than either feature on its own. I have a wip branch in which I enable more vectorization/batching and as part of that I'll think more about how to write those tests in a robust way (and likely change the interface). Until that lands, I don't care too much about what specific IR we generate here; it's just nice to track changes.

r? compiler
2025-10-04 17:11:13 +02:00
Matthias Krüger
6c24eeeb62
Rollup merge of #147280 - workingjubilee:you-can-put-your-gcc-in-my-llvm-components, r=Kobzol
Return to needs-llvm-components being info-only

Partially revert a535042e80a38196a58c27a8c95552546affe5dc

Even with non-LLVM codegen backends, we want to allow for annotations that express dependencies to LLVM-specific parts of the test suite. This includes `//@ needs-llvm-components`, which just allows checking that LLVM is built with relevant target support before the test is run. It does not assert the test cannot work with another codegen backend.
2025-10-04 17:11:12 +02:00
Matthias Krüger
dade9fe04b
Rollup merge of #147251 - jackh726:global-cache-non-concurrent-change, r=lcnr
Do not assert that a change in global cache only happens when concurrent

Fixes rust-lang/trait-system-refactor-initiative#234

I think it should just be safe to remove this assert (rather than delaying a bug). If the previous and current result are the same, I wouldn't expect issues.

r? lcnr
2025-10-04 17:11:12 +02:00
Matthias Krüger
c389e2ed9e
Rollup merge of #147190 - joboet:sys-net-cleanup, r=hkBst,tgross35
std: `sys::net` cleanups

This PR contains three improvements to the socket-based networking implementation (aa1263e7684341a73b600eaf0bbc70067e196243 is just to add the now missing `unsafe`). Best reviewed commit-by-commit.
2025-10-04 17:11:11 +02:00
Matthias Krüger
3f7b8c5198
Rollup merge of #147117 - iximeow:ixi/illumos-used-attr, r=Noratrieb
interpret `#[used]` as `#[used(compiler)]` on illumos

helps rust-lang/rust#146169 not be as painful: fixes the illumos regression in rust-lang/rust#140872, but `#[used(linker)]` is still erroneous on illumos generally.

illumos' `ld` does not support a flag like either SHF_GNU_RETAIN or SHF_SUNW_NODISCARD, so there is no way to communicate `#[used(linker)]` for that target. Setting `USED_LINKER` to try results in LLVM setting SHF_SUNW_NODISCARD for Solaris-like targets, which is an unknown section header flag for illumos `ld` and prevents sections from being merged that otherwise would.

As a motivating example, the `inventory` crate produces `#[used]` items to merge into `.init_array`. Because those items have an unknown section header flag they are not merged with the default `.init_array` with `frame_dummy`, and end up never executed.

Downgrading `#[used]` to `#[used(compiler)]` on illumos keeps so-attributed items as preserved as they had been before https://github.com/rust-lang/rust/pull/140872. As was the case before that change, because rustc passes `-z ignore` to illumos `ld`, it's possible that `used` sections are GC'd at link time. https://github.com/rust-lang/rust/issues/146169 describes this unfortunate circumstance.

----

as it turns out, `tests/ui/attributes/used_with_archive.rs` had broken on `x86_64-unknown-illumos`, and this patch fixes it. the trials and tribulations of tier 2 :(

r? ````@Noratrieb```` probably?
2025-10-04 17:11:11 +02:00
Matthias Krüger
18388b8420
Rollup merge of #146479 - Qelxiros:mem_conjure_zst, r=scottmcm,tgross35
add mem::conjure_zst

Tracking issue: rust-lang/rust#95383
2025-10-04 17:11:10 +02:00
Matthias Krüger
baea20ba44
Rollup merge of #146451 - DimitriiTrater:atan2_correctness_docs, r=tgross35
Fix atan2 inaccuracy in documentation

Fixes rust-lang/rust#136275
2025-10-04 17:11:09 +02:00
Matthias Krüger
dbc1e82f25
Rollup merge of #146330 - Marcondiro:unicode-17, r=Manishearth
Bump unicode_data and printables to version 17.0.0

Unicode 17 ~~is not stable yet (release planned for 2025-09-09).~~ [has been released!](https://www.unicode.org/versions/Unicode17.0.0/)

Update Unicode data and printables to [Unicode 17](https://www.unicode.org/versions/Unicode17.0.0/)
2025-10-04 17:11:09 +02:00
Matthias Krüger
47bd38c2f1
Rollup merge of #145685 - Qelxiros:cell_get_cloned, r=programmerjake,tgross35
add CloneFromCell and Cell::get_cloned

Tracking issue: rust-lang/rust#145329
2025-10-04 17:11:08 +02:00
Matthias Krüger
f837cfe5ac
Rollup merge of #142670 - fpdotmonkey:doc/as-fully-qualified-syntax, r=ibraheemdev,fmease
Document fully-qualified syntax in `as`' keyword doc
2025-10-04 17:11:08 +02:00
bors
99ca0ae87b Auto merge of #147338 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

3 commits in 2394ea6cea8b26d717aa67eb1663a2dbf2d26078..801d9b4981dd07e3aecdca1ab86834c13615737e
2025-10-03 14:13:01 +0000 to 2025-10-04 13:30:15 +0000
- chore: Disabled `reserved_windows_name` test temporaily (rust-lang/cargo#16048)
- Add panic=immediate-abort support to Cargo (rust-lang/cargo#16041)
- Accessing each build script's `OUT_DIR` (rust-lang/cargo#15891)
2025-10-04 14:57:32 +00:00
Weihang Lo
b4578775b4
Update cargo submodule 2025-10-04 10:22:41 -04:00
Ada Alakbarova
2688f601dd
Make fmt::Write a diagnostic item 2025-10-04 16:07:06 +02:00
bors
99b9a88503 Auto merge of #147323 - chenyukang:yukang-fix-tidy-check, r=jieyouxu
Fix top level ui tests check in tidy

I got an error when pushing code:

```console
fmt check
fmt: checked 6330 modified files
tidy check
tidy [ui_tests (tests)]: ui tests should be added under meaningful subdirectories: `/Users/yukang/rust/tests/ui/.DS_Store`
tidy [ui_tests (tests)]: FAIL
```

I think it's better to use `ignore::WalkBuilder` for checking the path.

r? `@jieyouxu`
2025-10-04 10:22:52 +00:00
Jonathan Brouwer
1c85a1dc2e
Make #[link="dl"] a warning rather than an error 2025-10-04 11:22:56 +02:00