306861 Commits

Author SHA1 Message Date
Guillaume Gomez
b7e444de16 Add regression test for merged doctests compilation time display 2025-09-26 22:04:00 +02:00
Augie Fackler
eb3fb457f1 split-dwarf: add documentation and test coverage 2025-09-26 16:02:59 -04:00
Augie Fackler
bd860bdf26
Fix typo in LLVM_VERSION_ macro use
Co-authored-by: Nikita Popov <github@npopov.com>
2025-09-26 15:38:30 -04:00
Jakub Beránek
852aa20c90
Rename rust.use-lld to rust.bootstrap-override-lld 2025-09-26 20:21:21 +02:00
David Carlier
c0de794949
std::net: update tcp deferaccept delay type to Duration. 2025-09-26 18:39:29 +01:00
Joshua Rayton
2e904c4d07
update issue number for more_float_constants 2025-09-26 18:35:29 +01:00
Augie Fackler
77c6acc74e debuginfo: add an unstable flag to write split DWARF to an explicit directory
Bazel requires knowledge of outputs from actions at analysis time,
including file or directory name. In order to work around the lack of
predictable output name for dwo files, we group the dwo files in a
subdirectory of --out-dir as a post-processing step before returning
control to bazel. Unfortunately some debugging workflows rely on
directly opening the dwo file rather than loading the merged dwp file,
and our trick of moving the files breaks those users. We can't just
hardlink the file or copy it, because with remote build execution we
wouldn't end up with the un-moved file copied back to the developer's
workstation. As a fix, we add this unstable flag that causes dwo files
to be written to a build-system-controllable location, which then lets
bazel hoover up the dwo files, but the objects also have the correct
path for the dwo files.
2025-09-26 13:34:40 -04:00
Augie Fackler
99456cc015 tests: use max-llvm-major-version instead of ignore-llvm-version 2025-09-26 13:32:03 -04:00
Augie Fackler
4c7292aba3 PassWrapper: drop unused variable for LLVM 22+ 2025-09-26 13:27:34 -04:00
Li-yao Xia
c0e0d4b68d Make def_path_hash_to_def_id not panic when passed an invalid hash 2025-09-26 18:36:15 +02:00
Matthias Krüger
a91918f96b
Rollup merge of #147058 - GuillaumeGomez:ignore-more-ui-tests, r=Kobzol
Ignore more failing ui tests for GCC backend

Needed for https://github.com/rust-lang/rust/pull/146414.

r? ``@Kobzol``
2025-09-26 18:11:15 +02:00
Matthias Krüger
978c960ed6
Rollup merge of #147031 - joshtriplett:mbe-opt-collect, r=lcnr
mbe: Simplify check_redundant_vis_repetition

Eliminate a use of `map_or` in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.
2025-09-26 18:11:14 +02:00
Matthias Krüger
67d88f93cd
Rollup merge of #147027 - GuillaumeGomez:tyalias-disambiguator, r=lolbinarycat
Add new `tyalias` intra-doc link disambiguator

Fixes https://github.com/rust-lang/rust/issues/146855.

Alternative to rust-lang/rust#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc ``@fmease``
r? lolbinarycat
2025-09-26 18:11:13 +02:00
Matthias Krüger
e504c108df
Rollup merge of #147016 - hkBst:whitespace-1, r=nnethercote
fix doc comments to be more standard
2025-09-26 18:11:12 +02:00
Matthias Krüger
ba93a4f674
Rollup merge of #146849 - joshtriplett:macro-reduce-legacy-bang, r=petrochenkov
Reduce some uses of `LegacyBang`

- **Switch `dummy_bang` from `LegacyBang` to `Bang`**
- **mbe: Switch dummy extension used for errors from `LegacyBang` to `Bang`**
2025-09-26 18:11:12 +02:00
Matthias Krüger
35f443d318
Rollup merge of #146778 - nikic:allocator-shim-attributes, r=jackh726
Use standard attribute logic for allocator shim

Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here).

This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...
2025-09-26 18:11:11 +02:00
Matthias Krüger
ebe90c7ae7
Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petrochenkov
Stop linking rs{begin,end} objects on x86_64-*-windows-gnu

Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just like i686-pc-windows-gnu, even though they were no-ops for it. This was likely done for the simplicity back when it was introduced.
Today the things are different and these startup/end objects harm other features, like `build-std`. Given the demotion of i686-pc-windows-gnu from tier 1, there is no point in hurting x86_64-pc-windows-gnu, which remains a tier 1.

The files are still shipped in case downstream crates expect them, as in case of the unmaintained `xargo`.

Fixes https://github.com/rust-lang/rust/issues/146739
2025-09-26 18:11:10 +02:00
Matthias Krüger
d09bb02eb5
Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petrochenkov
port `#[debugger_visualizer]` to the new attribute system
2025-09-26 18:11:09 +02:00
Matthias Krüger
024fbad4a0
Rollup merge of #146523 - thejpster:demote-armebv7r-targets, r=jackh726
Demote both armebv7r-none-* targets.

OK, slightly more controversial than https://github.com/rust-lang/rust/pull/146520 and https://github.com/rust-lang/rust/pull/146522  - I'd like to drop the bare-metal **big-endian** Armv7-R targets down to Tier 3.

The reason is simple - we cannot test them in https://github.com/rust-embedded/cortex-ar/. This because QEMU support for Big Endian Armv7-R is broken. I tried quite hard, but all the strings I printed with semihosting came out byte swapped (or "etybawa depp") because of how QEMU kludges the access to memory in big-endian mode.

The target also has only a single maintainer. Although, if ````@chrisnc```` wants to put up a case for keeping it at Tier 2 though, I'm happy to hear it!

This PR wil be rebased once https://github.com/rust-lang/rust/pull/146419 completes the queue.
2025-09-26 18:11:09 +02:00
Matthias Krüger
f104ae4252
Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnr
resolve: Do not finalize shadowed bindings

I.e. do not mark them as used, or non-speculatively loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-26 18:11:08 +02:00
bors
54a8a1db60 Auto merge of #146885 - lcnr:method-selection-opaques, r=BoxyUwU
support opaque types in method selection

See my notes in https://hackmd.io/4ILASx3mQ3u_gW9r1JyqCw.

This PR builds on https://github.com/rust-lang/rust/pull/145993 and allows not-yet defined opaque types as self types in the `method_autoderef_chain`.

E.g. for `Box<impl Deref<impl Foo>>` this results in the autoderef chain `Box<impl Deref> -> ?deref_hidden_ty -> ?foo_hidden_ty`. Method selection stays ambiguous if the final autoderef step is still an infer var unless that var is an opaque.

TODO: treating opaques as rigid jank.

r? `@BoxyUwU`
2025-09-26 16:10:47 +00:00
lcnr
c2e39c2f20 review 2025-09-26 16:37:08 +02:00
lcnr
d6fe533418 add tests 2025-09-26 16:33:15 +02:00
lcnr
eebf871fea move tests 2025-09-26 16:33:15 +02:00
lcnr
148fd9ad3c allow method calls on opaques 2025-09-26 16:33:15 +02:00
lcnr
6b379b560d use try_structurally_resolve_type for method receiver
We'll still error due to the `opt_bad_ty` of `method_autoderef_steps`.
This slightly worsens the span of `infer_var.method()` which is now the
same as for `Box::new(infer_var).method()`.

Unlike `structurally_resolve_type`, `probe_op` does not check whether
the infcx is already tainted, so this results in 2 previously not emitted
errors.
2025-09-26 16:33:15 +02:00
lcnr
70f6493f26 remove unnecessary structurally resolve
`autoderef` already resolved and `method_autoderef_steps` makes
sure we won't encounter an inference variable
2025-09-26 16:33:15 +02:00
lcnr
b70a15f5f6 predefined opaques to method_autoderef_steps 2025-09-26 16:33:15 +02:00
lcnr
1acd65cd6d predefined opaques use List 2025-09-26 16:33:15 +02:00
Guillaume Gomez
a535c7be54 Ignore more failing ui tests for GCC backend 2025-09-26 15:33:48 +02:00
lcnr
4e44d58bbc rename search_graph::Delegate fns 2025-09-26 15:29:01 +02:00
lcnr
4a0c7cc730 fix cycle head usages tracking 2025-09-26 15:29:01 +02:00
Guillaume Gomez
62c457bb02 Mention tyalias in intra-doc link rustdoc book chapter 2025-09-26 15:07:12 +02:00
Guillaume Gomez
dba45cde68 Add tests for new tyalias intra-doc link disambiguator 2025-09-26 15:07:12 +02:00
bors
a885811104 Auto merge of #146595 - Shourya742:make-cargo-test-work-for-self-test, r=Kobzol
Make cargo test work for  bootstrap self test

This PR enables the bootstrap self-test to run via cargo test. I have removed the detect_src_and_out test for now, but it will be reintroduced in a follow-up PR where all bootstrap tests will be migrated to use testCtx.

r? `@Kobzol`

try-job: aarch64-apple
2025-09-26 12:55:15 +00:00
Guillaume Gomez
7a2c173033 Add new tyalias intra-doc link disambiguator 2025-09-26 12:04:16 +02:00
Marijn Schouten
fc703ec5c8 fix doc comments to be more standard 2025-09-26 09:25:56 +00:00
Yotam Ofek
a40032d9e3 Simplify notable traits map serialization 2025-09-26 11:42:52 +03:00
Yotam Ofek
82fecf0ee3 Cleanup notable_traits_decl 2025-09-26 11:42:52 +03:00
Yotam Ofek
78ff5ddad9 Remove usages of write_str from render_assoc_items_inner 2025-09-26 11:42:44 +03:00
bors
5b9007bfc3 Auto merge of #147054 - matthiaskrgr:rollup-660g92w, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#146283 (Resolve: (Ref)Cell wrappers to deny mutation during spec resolution.)
 - rust-lang/rust#146453 (Add general arm-linux.md platform doc.)
 - rust-lang/rust#146991 (const_caller_location to use real Span instead of `DUMMY_SP`)
 - rust-lang/rust#146994 (Add `clippy::unconditional_recursion` to `./x clippy ci`)
 - rust-lang/rust#147038 (Rename verbosity functions in bootstrap)
 - rust-lang/rust#147047 (rustdoc: put the toolbar on the all item index)
 - rust-lang/rust#147049 (std: fix warning in VEXos stdio module)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-26 07:45:10 +00:00
Fabian Grünbichler
68c0e97cc6 re-order normalizations in run-make linker-warning test
otherwise a buildroot containing `libpanic_abort` would be mangled before being
replaced by the build root placeholder value..

e.g., running `./x.py test --verbose tests/run-make/linker-warning` with rustc
checked out in ~/ext/rustc-libpanic_abort will result in (output slightly shortened):

```
running 1 tests
test [run-make] tests/run-make/linker-warning ... FAILED

failures:

---- [run-make] tests/run-make/linker-warning stdout ----

------rustc stdout------------------------------

------rustc stderr------------------------------

------------------------------------------

error: rmake recipe failed to complete
status: exit status: 101
command: cd "/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED AR="ar" BUILD_ROOT="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RUSTC_DYLIB_PATH="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/stage1/lib" LD_LIBRARY_PATH="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="<...>" LLVM_FILECHECK="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" NODE="/usr/bin/node" PYTHON="/usr/bin/python3" RUSTC="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" RUSTDOC="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" SOURCE_ROOT="/home/user/ext/rustc-libpanic_abort" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/user/ext/rustc-libpanic_abort/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake"
stdout: none
--- stderr -------------------------------

thread 'main' panicked at /home/user/ext/rustc-libpanic_abort/tests/run-make/linker-warning/rmake.rs:74:14:
test failed: `short-error.txt` is different from `(linker error)`

--- short-error.txt
+++ (linker error)
@@ -1,6 +1,6 @@
 error: linking with `./fake-linker` failed: exit status: 1
   |
-  = note:  "./fake-linker" "-m64" "/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/build-root/test/run-make/linker-warning/rmake_out/{libfoo,libbar}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/build-root/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
+  = note:  "./fake-linker" "-m64" "/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/home/user/ext/rustc-libpanic_unwind/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out/{libfoo,libbar}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/user/ext/rustc-libpanic_unwind/build/x86_64-unknown-linux-gnu/test/run-make/linker-warning/rmake_out" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "main" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "run_make_error"
   = note: some arguments are omitted. use `--verbose` to show all linker arguments
   = note: error: baz

[..]
```

without this fix.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-09-26 08:14:25 +02:00
Matthias Krüger
87b8eca516
Rollup merge of #147049 - vexide:vex-std, r=workingjubilee
std: fix warning in VEXos stdio module

Fixes building `std` on the `armv7a-vex-v5` target due to an unnecessarily mutable argument in `Stdin`.

This was a stupid oversight on my part towards the end of rust-lang/rust#145973's review process. Missed a warning and had a bad bootstrap config that didn't tell me about it when testing changes.
2025-09-26 06:36:34 +02:00
Matthias Krüger
1285b164e1
Rollup merge of #147047 - notriddle:toolbar-index, r=GuillaumeGomez
rustdoc: put the toolbar on the all item index
2025-09-26 06:36:33 +02:00
Matthias Krüger
610a601f36
Rollup merge of #147038 - Kobzol:bootstrap-verbose-fn, r=jieyouxu
Rename verbosity functions in bootstrap

Just a small cleanup, these function names have been bothering me for a while. I realized that we can delete some of them outright, rather than just renaming them.

r? ``@jieyouxu``
2025-09-26 06:36:33 +02:00
Matthias Krüger
07d13a6469
Rollup merge of #146994 - cuviper:clippy-ci-recursion, r=Kobzol
Add `clippy::unconditional_recursion` to `./x clippy ci`

The clippy lint catches some things that rustc's equivalent builtin lint
does not, for example rust-lang/rust#146940:

    error: function cannot return without recursing
        --> library/std/src/path.rs:3428:5
         |
    3428 | /     fn eq(&self, other: &String) -> bool {
    3429 | |         self == &*other
    3430 | |     }
         | |_____^
         |
    note: recursive call site
        --> library/std/src/path.rs:3429:9
         |
    3429 |         self == &*other
         |         ^^^^^^^^^^^^^^^
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
         = note: requested on the command line with `-D clippy::unconditional-recursion`
2025-09-26 06:36:32 +02:00
Matthias Krüger
b184550f0e
Rollup merge of #146991 - cachebag:span-caller-location, r=RalfJung
const_caller_location to use real Span instead of `DUMMY_SP`

Clarifying usage of DUMMY_SP
2025-09-26 06:36:32 +02:00
Matthias Krüger
72fee890e2
Rollup merge of #146453 - thejpster:arm-linux-docs, r=petrochenkov
Add general arm-linux.md platform doc.

Adds a new page that covers all 32-bit Arm Linux systems. This means that we can reduce the amount of information required in the target specific pages to just the Tier level, the maintainer, and any specific details for that target.

I have no changed those pages yet, though. Let's start with this.
2025-09-26 06:36:31 +02:00
Matthias Krüger
82e9e54ef3
Rollup merge of #146283 - LorrensP-2158466:resolve-cm-cell, r=petrochenkov
Resolve: (Ref)Cell wrappers to deny mutation during spec resolution.

Introduces wrappers around `Cell` and `RefCell` that only allow mutation when we are not in speculative resolution. This is preparatory work for rust-lang/rust#145108.

It would allow us to make `ImportData` and `ModuleData` sync and send safe.

r? ``@petrochenkov``
2025-09-26 06:36:30 +02:00
bors
40ace17fc3 Auto merge of #145882 - m-ou-se:format-args-extend-1-arg, r=petrochenkov
Extended temporary argument to format_args!() in all cases

Fixes https://github.com/rust-lang/rust/issues/145880 by removing the special case.
2025-09-26 04:34:09 +00:00