1
Fork 0
Commit graph

284846 commits

Author SHA1 Message Date
Matthias Krüger
a27b21e53a
Rollup merge of #138709 - Kobzol:update-gcc, r=GuillaumeGomez
Update GCC submodule

Includes https://github.com/rust-lang/gcc/pull/66 to use our mirrors for downloading GCC dependencies.

r? ```@GuillaumeGomez```
2025-03-21 15:48:57 +01:00
Matthias Krüger
ed3a39da7f
Rollup merge of #138706 - Kobzol:bootstrap-git-refactor-1, r=onur-ozkan
Improve bootstrap git modified path handling

Drive-by improvements extracted out of https://github.com/rust-lang/rust/pull/138591.

r? ``@onur-ozkan``
2025-03-21 15:48:56 +01:00
Matthias Krüger
015df66ee2
Rollup merge of #138669 - durin42:llvm-21-anon-func-unmangled, r=bjorn3
tests: accept some noise from LLVM 21 in symbols-all-mangled

I'm not entirely sure this is correct, but it doesn't feel obviously-wrong so I figured I'd just start by sending a PR rather than filing a bug and letting it linger.

``@rustbot`` label llvm-main
2025-03-21 15:48:55 +01:00
Matthias Krüger
0c594da55f
Rollup merge of #138627 - EnzymeAD:autodiff-cleanups, r=oli-obk
Autodiff cleanups

Splitting out some cleanups to reduce the size of my batching PR and simplify ``@haenoe`` 's [PR](https://github.com/rust-lang/rust/pull/138314).

r? ``@oli-obk``

Tracking:

- https://github.com/rust-lang/rust/issues/124509
2025-03-21 15:48:55 +01:00
Matthias Krüger
a8f0c6bbcb
Rollup merge of #138623 - daltenty:daltenty/fix-compiler-rt, r=Kobzol
[bootstrap] Use llvm_runtimes for compiler-rt

Trying to enable `compiler-rt` via `LLVM_ENABLE_PROJECTS` is no longer a supported option in LLVM, and gives you nasty warnings:
```
Using LLVM_ENABLE_PROJECTS=compiler-rt is deprecated now, and will become a
  fatal error in the LLVM 21 release.  Please use
  -DLLVM_ENABLE_RUNTIMES=compiler-rt or see the instructions at
  https://compiler-rt.llvm.org/ for building the runtimes.
```

try-job: aarch64-gnu-debug
try-job: x86_64-gnu-debug
2025-03-21 15:48:53 +01:00
Matthias Krüger
c354a97bd9
Rollup merge of #138570 - folkertdev:naked-function-target-feature-gate, r=Amanieu
add `naked_functions_target_feature` unstable feature

tracking issue: https://github.com/rust-lang/rust/issues/138568

tagging https://github.com/rust-lang/rust/pull/134213 https://github.com/rust-lang/rust/issues/90957

This PR puts `#[target_feature(/* ... */)]` on `#[naked]` functions behind its own feature gate, so that naked functions can be stabilized. It turns out that supporting `target_feature` on naked functions is tricky on some targets, so we're splitting it out to not block stabilization of naked functions themselves. See the tracking issue for more information and workarounds.

Note that at the time of writing, the `target_features` attribute is ignored when generating code for naked functions.

r? ``@Amanieu``
2025-03-21 15:48:52 +01:00
Matthias Krüger
f7f287077b
Rollup merge of #138364 - BLANKatGITHUB:compiler, r=RalfJung
ports the compiler test cases to new rust_intrinsic format

pr is part of #132735
2025-03-21 15:48:51 +01:00
bors
a4a11aca5e Auto merge of #138704 - Kobzol:ci-llvm-checks, r=onur-ozkan
Simplify CI LLVM checks in bootstrap

Extracted out of https://github.com/rust-lang/rust/pull/138591. Apart from simplifying the checks, it will make it easier to run E2E tests of bootstrap on a mostly empty directory without checking out LLVM on CI :)

The commits should be mostly self-explanatory.

r? `@onur-ozkan`
2025-03-21 14:47:25 +00:00
bjorn3
530ab61c0e Also check for compiler-builtins in linked_symbols
Otherwise the linker complains about EC symbols missing when compiling
for arm64ec.
2025-03-21 14:06:34 +00:00
bjorn3
63cfd47cb1 Don't attempt to export compiler-builtins symbols from rust dylibs
They are marked with hidden visibility to prevent them from getting
exported, so we shouldn't ask the linker to export them anyway. The only
thing that does it cause a warning on macOS.
2025-03-21 13:59:51 +00:00
bjorn3
cd929bfccb Fix lint name in unused linker_messages warning 2025-03-21 13:59:29 +00:00
bjorn3
41f1ed11c2 Move some calls to before calling codegen_crate
`--emit mir`, `#[rustc_symbol_name]` and `#[rustc_def_path]` now run
before codegen and thus work even if codegen fails. This can help with
debugging.
2025-03-21 13:23:07 +00:00
bjorn3
7d3965e0cd Move make_input call 2025-03-21 13:21:53 +00:00
bjorn3
521d0c4a30 Cache current_dll_path output
Computing the current dll path is somewhat expensive relative to other
work when compiling `fn main() {}` as `dladdr` needs to iterate over the
symbol table of librustc_driver.so until it finds a match.
2025-03-21 12:46:24 +00:00
Karol Zwolak
2c77a0775c test(ui): add tuple-struct-where-clause-suggestion ui test for #91520 2025-03-21 13:12:15 +01:00
Jakub Beránek
f5c59a444f Fix test using download-ci-llvm=true on CI 2025-03-21 12:23:44 +01:00
Jakub Beránek
e288faa4b0 Disable CI mode when checking default bootstrap profiles 2025-03-21 12:18:51 +01:00
Jakub Beránek
f53acd17cb Set if-unchanged as the default value for download-ci-llvm when we're on CI. 2025-03-21 12:18:50 +01:00
Jakub Beránek
68aaa8d103 Allow unused code in tests
To avoid working around some code being unused in tests due to it being stubbed out with `#[cfg(test)]`.
2025-03-21 12:18:50 +01:00
Jakub Beránek
9c05758ed4 Remove duplicated check for LLVM modifications and disable download-ci-llvm=true on CI 2025-03-21 12:18:50 +01:00
Jakub Beránek
80a5adf871 Unify LLVM invalidation path handling
Before it was using a different set of paths in different call-sites.
2025-03-21 12:18:50 +01:00
Ralf Jung
244e92ba5c catch_unwind intrinsic: document return value 2025-03-21 10:33:47 +01:00
bors
4ac032f857 Auto merge of #138768 - matthiaskrgr:rollup-nfu3cm3, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #137357 (Document results of non-positive logarithms)
 - #138650 (Optimize `io::Write::write_fmt` for constant strings)
 - #138694 (Fix: add ohos target notes)
 - #138713 (interpret memory access hooks: also pass through the Pointer used for the access)
 - #138724 (Check attrs: Don't try to retrieve the name of list stems)
 - #138743 (bootstrap: add `--ci` flag)
 - #138751 (Fix the "used_with_archive" test on Fuchsia)
 - #138754 (Handle spans of `~const`, `const`  and `async` trait bounds in macro expansion)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-21 08:06:38 +00:00
John Kåre Alsaker
93bfe39ba5 Use hashbrown from crates.io 2025-03-21 07:54:35 +01:00
John Kåre Alsaker
fcd3349d14 Optimize hash map operations in the query system 2025-03-21 07:51:20 +01:00
Matthias Krüger
5ba395a98b
Rollup merge of #138754 - oli-obk:push-vtqtnwluyxop, r=compiler-errors
Handle spans of `~const`, `const`  and `async` trait bounds in macro expansion

r? `@compiler-errors`

`visit_span` is actually only used in one place (the `transcribe::Marker`), and all of this syntax is unstable, so while it would still be nice to write a test for it, I wager there's lots more interesting things in `transcribe::Marker` to write tests for. And the worst is some diagnostics being weird or incremental being not as incremental as it could be
2025-03-21 06:56:49 +01:00
Matthias Krüger
4447953fdd
Rollup merge of #138751 - Jeff-A-Martin:used-with-archive-test-fuchsia, r=jieyouxu
Fix the "used_with_archive" test on Fuchsia

This change adds Fuchsia OS as a target to the cfg_attr in the pre_main_constructor external declaration. This allows the "tests/ui/attributes/used_with_archive.rs" to pass against Fuchsia.
2025-03-21 06:56:49 +01:00
Matthias Krüger
828f33ce96
Rollup merge of #138743 - onur-ozkan:override-is-ci-behaviour, r=Kobzol
bootstrap: add `--ci` flag

To make bootstrap act like it's running on CI, we had to override the `GITHUB_ACTIONS` environment variable which is a hidden detail of `CiEnv::is_ci`. Now, we can use the `--ci` flag directly on bootstrap which will be documented automatically from `x --help`. This also helps us to avoid race conditions on bootstrap (overriding `GITHUB_ACTIONS` env in each test can cause that if we run the tests in parallel) tests.
2025-03-21 06:56:48 +01:00
Matthias Krüger
1135a63286
Rollup merge of #138724 - fmease:list-stems-bear-no-name, r=nnethercote
Check attrs: Don't try to retrieve the name of list stems

Fixes #138723.

r? nnethercote or compiler
2025-03-21 06:56:47 +01:00
Matthias Krüger
7c1b128383
Rollup merge of #138713 - RalfJung:memory-hook-pointers, r=oli-obk
interpret memory access hooks: also pass through the Pointer used for the access

In some ongoing work on the Miri side, we need the absolute address that the memory access occurred at. That is non-trivial to obtain since we don't have an `ecx`. So pass through the `Pointer` used for the access, which contains the address, and which is available everywhere we are calling these hooks.

r? `@oli-obk`
2025-03-21 06:56:47 +01:00
Matthias Krüger
ff8738a0f7
Rollup merge of #138694 - LuuuXXX:fix-platform-support-book, r=jieyouxu
Fix: add ohos target notes
2025-03-21 06:56:46 +01:00
Matthias Krüger
809378bd2e
Rollup merge of #138650 - thaliaarchi:io-write-fmt-known, r=ibraheemdev
Optimize `io::Write::write_fmt` for constant strings

When the formatting args to `fmt::Write::write_fmt` are a statically known string, it simplifies to only calling `write_str` without a runtime branch. Do the same in `io::Write::write_fmt` with `write_all`.

Also, match the convention of `fmt::Write` for the name of `args`.
2025-03-21 06:56:46 +01:00
Matthias Krüger
1530b03655
Rollup merge of #137357 - syvb:sv/log-docs, r=tgross35
Document results of non-positive logarithms

The integer versions of logarithm functions panic on non-positive numbers. The floating point versions have different, undocumented behaviour (-inf on 0, NaN on <0). This PR documents that.

try-job: aarch64-gnu
2025-03-21 06:56:45 +01:00
bors
5d85a714b1 Auto merge of #138761 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Cargo.lock update is because of the `ui_test` dependency bump in Clippy.
2025-03-21 04:59:08 +00:00
王宇逸
e5fc7d6a55 Fix Thread::set_name on cygwin 2025-03-21 12:50:27 +08:00
bors
01dc45c10e Auto merge of #138760 - matthiaskrgr:rollup-2edtg2h, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #138435 (Add support for postfix yield expressions)
 - #138685 (Use `Option<Ident>` for lowered param names.)
 - #138700 (Suggest `-Whelp` when pass `--print lints` to rustc)
 - #138727 (Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType`)
 - #138729 (Clean up `FnCtxt::resolve_coroutine_interiors`)
 - #138731 (coverage: Add LLVM plumbing for expansion regions)
 - #138732 (Use `def_path_str` for def id arg in `UnsupportedOpInfo`)
 - #138735 (Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-21 01:52:00 +00:00
Alona Enraght-Moony
13335e313c tests/rustdoc-json: change assertions to use RFC 9535 jsonpath 2025-03-21 00:48:09 +00:00
Alona Enraght-Moony
42631d8027 tests/rustdoc-json: replace $.paths[*][? with $.paths[?
This fixes all 3 of these tests. Done automatically in VSCode.
2025-03-21 00:48:09 +00:00
Alona Enraght-Moony
7ab71c417b tests/rustdoc-json: replace $.index[*][? with $.index[?
Done automatically with VSCode.
2025-03-21 00:48:09 +00:00
Alona Enraght-Moony
a0918b7f5f jsondocck: Replace jsonpath_lib with jsonpath-rust 2025-03-21 00:48:09 +00:00
bors
eda7820be5 Auto merge of #138747 - matthiaskrgr:rollup-68x44rw, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #138435 (Add support for postfix yield expressions)
 - #138685 (Use `Option<Ident>` for lowered param names.)
 - #138700 (Suggest `-Whelp` when pass `--print lints` to rustc)
 - #138727 (Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType`)
 - #138729 (Clean up `FnCtxt::resolve_coroutine_interiors`)
 - #138731 (coverage: Add LLVM plumbing for expansion regions)
 - #138732 (Use `def_path_str` for def id arg in `UnsupportedOpInfo`)
 - #138735 (Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-20 22:35:15 +00:00
Philipp Krones
58142e99ae
Update Cargo.lock 2025-03-20 22:35:05 +01:00
Philipp Krones
ae31f7a024
Merge commit '1e5237f4a5' into clippy-subtree-update 2025-03-20 22:34:29 +01:00
Matthias Krüger
4a87516892
Rollup merge of #138735 - jieyouxu:drop-llvm-alias, r=nikic
Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group

Because it's way too easy to confuse LLVM Icebreakers ping group versus trying to ping WG-llvm.
And AFAIK, icebreakers-llvm isn't really used in a good while.

I also fixed the rustc-dev-guide docs about ```@rustbot`` ping llvm` (and changed that to the raw ping group name ```@rustbot`` icebreakers-llvm`) because it's very confusing.

Previously discussed in [#t-compiler/wg-llvm > Ping group renaming](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fwg-llvm/topic/Ping.20group.20renaming/with/453005029).

FYI ``@rust-lang/wg-llvm``
FYI ``@RalfJung`` (since you asked in https://github.com/rust-lang/rust/pull/138120#issuecomment-2710466874)
r? ``@nikic`` (or wg-llvm)
2025-03-20 22:34:06 +01:00
Matthias Krüger
73ed8b3ace
Rollup merge of #138732 - compiler-errors:did, r=jieyouxu
Use `def_path_str` for def id arg in `UnsupportedOpInfo`

We could alternatively just omit the def path from the label, but I think it's fine to keep around

Fixes #138730
2025-03-20 22:34:06 +01:00
Matthias Krüger
7df0170fc4
Rollup merge of #138731 - Zalathar:llvm-expansion, r=jieyouxu
coverage: Add LLVM plumbing for expansion regions

This is currently unused, but paves the way for future work on expansion regions without having to worry about the FFI parts.

The span conversion refactoring is only loosely related, but I've included it here because it would conflict with the main changes in `fill_region_tables`, and is pretty straightforward on its own.
2025-03-20 22:34:05 +01:00
Matthias Krüger
84a2bb953e
Rollup merge of #138729 - compiler-errors:gen, r=lcnr
Clean up `FnCtxt::resolve_coroutine_interiors`

Random cleanups before I make a PR that stalls generator obligations.

r? lcnr
2025-03-20 22:34:04 +01:00
Matthias Krüger
46594939f4
Rollup merge of #138727 - compiler-errors:ty-var-origin, r=fmease
Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType`

The ordering of ty var unification means that we may end up with a root variable whose ty var origin is from another item's params.

Let's not rely on this by just unifying the infer vars with the params of the impl + resolving. It's kinda goofy but it's clearer IMO.

Fixes #132826.

r? ``@fmease`` or ``@lcnr``
2025-03-20 22:34:03 +01:00
Matthias Krüger
d4218c2934
Rollup merge of #138700 - xizheyin:issue-138612, r=Nadrieril
Suggest `-Whelp` when pass `--print lints` to rustc

Closes #138612
2025-03-20 22:34:03 +01:00
Matthias Krüger
00f3ad0c88
Rollup merge of #138685 - nnethercote:use-Option-Ident-for-lowered-param-names, r=compiler-errors
Use `Option<Ident>` for lowered param names.

Parameter patterns are lowered to an `Ident` by `lower_fn_params_to_names`, which is used when lowering bare function types, trait methods, and foreign functions. Currently, there are two exceptional cases where the lowered param can become an empty `Ident`.

- If the incoming pattern is an empty `Ident`. This occurs if the parameter is anonymous, e.g. in a bare function type.

- If the incoming pattern is neither an ident nor an underscore. Any such parameter will have triggered a compile error (hence the `span_delayed_bug`), but lowering still occurs.

This commit replaces these empty `Ident` results with `None`, which eliminates a number of `kw::Empty` uses, and makes it impossible to fail to check for these exceptional cases.

Note: the `FIXME` comment in `is_unwrap_or_empty_symbol` is removed. It actually should have been removed in #138482, the precursor to this PR. That PR changed the lowering of wild patterns to `_` symbols instead of empty symbols, which made the mentioned underscore check load-bearing.

r? ```@compiler-errors```
2025-03-20 22:34:02 +01:00