about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-08-29Rollup merge of #145387 - zachs18:remove-tmplayout, r=cjgillotStuart Cook-30/+9
Remove TmpLayout in layout_of_enum 09a3846 from <https://github.com/rust-lang/rust/pull/103693> made LayoutData be owned instead of interned in `Variants::Multiple::variants`[^1], so there's no need for `TmpLayout` in layout_of_enum anymore, and we can just store the variants' layouts directly in the prospective `LayoutData`s' `variants` fields. This should have no effect on semantics or layout. (written as part of rust-lang/rust#145337 but not related to the layout optimizations in that PR) [^1]: see line 1154 of `compiler/rustc_target/src/abi/mod.rs` in the linked commit; `Variants::Multiple::variants` effectively changed from `IndexVec<.., Layout<'tcx>>` to `IndexVec<.., LayoutData>` where the `LayoutData`s are not interned as `Layout`s (`LayoutData` was at the time called `LayoutS`)
2025-08-29Rollup merge of #144354 - rafaeling:fix-142726-qnx8-link-fail, r=tgross35Stuart Cook-1/+1
fix(std): Fix undefined reference to __my_thread_exit on QNX 8.0 When cross-compiling for the x86_64/aarch64-unknown-nto-qnx800 target (QNX SDP 8.0), the build fails during the final link stage with the error: ``` error: linking with `qcc` failed: exit status: 1 ... = note: undefined reference to `__my_thread_exit' ``` - **On QNX 7.1**: The __my_thread_exit symbol is defined and exported by the main C library (libc.a/libc.so). The std backtrace code can therefore successfully take its address at compile time. - **On QNX 8.0**: As part of a toolchain modernization, this symbol has been refactored. It is no longer present in any of the standard system libraries (.a or .so). This patch addresses the problem at its source by conditionally compiling the problematic code. Fixes rust-lang/rust#142726
2025-08-29Rollup merge of #144275 - Qelxiros:saturating-arithmetic, r=tgross35Stuart Cook-1/+93
implement Sum and Product for Saturating(u*) ACP: rust-lang/libs-team#604 `@rustbot` label +needs-fcp
2025-08-29Rollup merge of #143713 - tgross35:mailmap, r=Mark-SimulacrumStuart Cook-0/+1
Add a mailmap entry for gnzlbg The submodule->subtree changes add a lot of commits with the GitHub email.
2025-08-28implement Sum and Product for Saturating(u*)Jeremy Smart-1/+93
2025-08-28Auto merge of #145970 - GuillaumeGomez:rollup-pr11qds, r=GuillaumeGomezbors-194/+514
Rollup of 6 pull requests Successful merges: - rust-lang/rust#142472 (Add new `doc(attribute = "...")` attribute) - rust-lang/rust#145368 (CFI: Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins`) - rust-lang/rust#145853 (Improve error messages around invalid literals in attribute arguments) - rust-lang/rust#145920 (bootstrap: Explicitly mark the end of a failed test's captured output) - rust-lang/rust#145937 (add doc-hidden to exports in attribute prelude) - rust-lang/rust#145965 (Move exporting of profiler and sanitizer symbols to the LLVM backend) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-28Rollup merge of #145965 - bjorn3:sanitize_symbol_export_improvements, r=lqdGuillaume Gomez-54/+33
Move exporting of profiler and sanitizer symbols to the LLVM backend Only the LLVM backend needs those specific symbols exported and it only needs them to be exported for LTO, not from cdylibs in general.
2025-08-28Rollup merge of #145937 - jdonszelmann:doc-hidden-prelude, r=fmeaseGuillaume Gomez-1/+11
add doc-hidden to exports in attribute prelude Seems to fix rust-lang/rust#145870, at least temporarily. The underlying problem of course is still there. r? `@fmease` <img width="653" height="167" alt="image" src="https://github.com/user-attachments/assets/b5a8094c-849e-4328-997d-b772f9aa4088" /> Fixes rust-lang/rust#145870
2025-08-28Rollup merge of #145920 - Zalathar:failure-stdout, r=jieyouxuGuillaume Gomez-1/+7
bootstrap: Explicitly mark the end of a failed test's captured output While working on some compiletest stuff, I noticed that when bootstrap prints a failed test's captured output, there's no indication of where that output actually ends. In addition to indicating where the captured output ends, this end marker also makes it easier to see the relevant test name when scrolling upwards in terminal output.
2025-08-28Rollup merge of #145853 - JonathanBrouwer:fix-lit-parsing, r=jdonszelmannGuillaume Gomez-71/+64
Improve error messages around invalid literals in attribute arguments r? `@jdonszelmann` This previously created two errors, which is a bit ugly and the second one didn't add any value Blocked on https://github.com/rust-lang/rust/pull/143193
2025-08-28Rollup merge of #145368 - rcvalle:rust-cfi-fix-142284, r=dianqkGuillaume Gomez-12/+23
CFI: Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins` Fix rust-lang/rust#142284 by ensuring that `#![no_builtins]` crates can still emit bitcode when proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto) is used.
2025-08-28Rollup merge of #142472 - GuillaumeGomez:doc-attribute-attribute, r=fmeaseGuillaume Gomez-55/+376
Add new `doc(attribute = "...")` attribute Fixes rust-lang/rust#141123. The implementation and purpose of this new `#[doc(attribute = "...")]` attribute is very close to `#[doc(keyword = "...")]`. Which means that luckily for us, most of the code needed was already in place and `@Noratrieb` nicely wrote a first draft that helped me implement this new attribute very fast. Now with all this said, there is one thing I didn't do yet: adding a `rustdoc-js-std` test. I added GUI tests with search results for attributes so should be fine but I still plan on adding one for it once documentation for builtin attributes will be written into the core/std libs. You can test it [here](https://rustdoc.crud.net/imperio/doc-attribute-attribute/foo/index.html). cc `@Noratrieb` `@Veykril`
2025-08-28Move ___asan_globals_registered exportbjorn3-6/+4
All other sanitizer symbols are handled in prepare_lto already.
2025-08-28Only export the sanitizer symbols for LTO and move export code to cg_llvmbjorn3-48/+29
Don't export them from cdylibs. There is no need to do so and it complicates exported_non_generic_symbols. In addition the GCC backend likely uses different symbols and may potentially not even need us to explicitly tell it to export the symbols it needs.
2025-08-28Update uitest stderrJonathan Brouwer-50/+4
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-28Improve error messages around invalid literals in attribute argumentsJonathan Brouwer-35/+52
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-28Add another case to the bad-lit-suffixes testJonathan Brouwer-1/+23
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-28Auto merge of #145807 - zachs18:only-consider-auto-traits-empty, ↵bors-1/+167
r=compiler-errors When determining if a trait has no entries for the purposes of omitting vptrs from subtrait vtables, consider its transitive supertraits' entries, instead of just its own entries. When determining if a non-first supertrait vptr can be omitted from a subtrait vtable, check if the supertrait or any of its (transitive) supertraits have methods, instead of only checking if the supertrait itself has methods. This fixes the soundness issue where a vptr would be omitted for a supertrait with no methods but that itself had a supertrait with methods, while still optimizing the case where the supertrait is "truly" empty (it has no own vtable entries, and none of its (transitive) supertraits have any own vtable entries). Fixes <https://github.com/rust-lang/rust/issues/145752> ----- Old description: ~~Treat all non-auto traits as non-empty (possibly having methods) for purposes of determining if we need to emit a vptr for a non-direct supertrait (and for new "sibling" entries after a direct or non-direct supertrait).~~ This fixes (I believe) the soundness issue, ~~but regresses vtable sizes and possibly upcasting perf in some cases when using trait hierarchies with empty non-auto traits (see `tests/ui/traits/vtable/multiple-markers.stderr`) since we use vptrs in some cases where we could re-use the vtable.~~ Fixes <https://github.com/rust-lang/rust/issues/145752> Re-opens (not anymore) <https://github.com/rust-lang/rust/issues/114942> Should not affect <https://github.com/rust-lang/rust/issues/131813> (i.e. the soundness issue is still fixed, ~~though the relevant vtables in the `trait Evil` example will be larger now~~) cc implementation history <https://github.com/rust-lang/rust/pull/131864> <https://github.com/rust-lang/rust/pull/113856> ----- ~~It should be possible to check if a trait has any methods from itself *or* supertraits (instead of just from itself), but to fix the immediate soundness issue, just assume any non-auto trait could have methods. A more optimistic check can be implemented later (or if someone does it soon it could just supercede this PR :smile:).~~ Done in latest push `@rustbot` label A-dyn-trait F-trait_upcasting
2025-08-28Add ui test for unsupported `doc(attribute = "...")` case for attributes ↵Guillaume Gomez-0/+18
with namespace
2025-08-28Create new `Item::is_fake_item` method as equivalent to check for ↵Guillaume Gomez-23/+58
`is_primitive`, `is_keyword` and `is_attribute` methods
2025-08-28Add documentation for `doc(attribute = "...")` attributeGuillaume Gomez-1/+18
2025-08-28Add tests for `doc(attribute = "...")` attributeGuillaume Gomez-5/+135
2025-08-28Add new `doc(attribute = "...")` attributeGuillaume Gomez-47/+168
2025-08-28Auto merge of #145958 - Zalathar:rollup-ii9z77c, r=Zalatharbors-1712/+2182
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142727 (wasm: rm static mut) - rust-lang/rust#143193 (Port `#[link]` to the new attribute parsing infrastructure ) - rust-lang/rust#144864 (No source fixes) - rust-lang/rust#145913 (Add spin_loop hint for LoongArch) - rust-lang/rust#145926 (compiletest: Remove several remnants of the old libtest-based executor) - rust-lang/rust#145928 (Rename `Location::file_with_nul` to `file_as_c_str`) - rust-lang/rust#145930 (`const`ify (the unstable) `str::as_str`) - rust-lang/rust#145941 (Disable `integer_to_ptr_transmutes` suggestion for unsized types) - rust-lang/rust#145953 (Update `icu_list` to 2.0) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-28Rollup merge of #145953 - robertbastian:master, r=ManishearthStuart Cook-442/+193
Update `icu_list` to 2.0 This updates the `icu_list` crate, which is used for error formatting, from 1.5 to 2.0.
2025-08-28Rollup merge of #145941 - Urgau:int_to_ptr_transmutes-unsized, r=lcnrStuart Cook-13/+69
Disable `integer_to_ptr_transmutes` suggestion for unsized types This PR disables the machine-applicable `integer_to_ptr_transmutes` lint suggestion for unsized types, as [`std::ptr::with_exposed_provenance`](https://doc.rust-lang.org/std/ptr/fn.with_exposed_provenance.html) requires sized types. We should probably mention [`std::ptr::from_raw_parts`](https://doc.rust-lang.org/std/ptr/fn.from_raw_parts.html) when it becomes stable. Related to https://github.com/rust-lang/rust/issues/145935
2025-08-28Rollup merge of #145930 - GrigorenkoPV:const_str_as_str, r=joshtriplettStuart Cook-1/+1
`const`ify (the unstable) `str::as_str` Tracking issue: rust-lang/rust#130366 The method was not initially marked `const` presumably because it is only useful with `Deref`. But now that const traits seem to be a thing that can actually become real, why not make it `const`? PR `const`ifying `Deref`: rust-lang/rust#145279
2025-08-28Rollup merge of #145928 - Darksonn:file_as_c_str, r=joshtriplettStuart Cook-5/+5
Rename `Location::file_with_nul` to `file_as_c_str` This renames the method to be consistent with the ongoing T-libs-api FCP found at https://github.com/rust-lang/rust/issues/141727#issuecomment-3228016708. I did not rename the unstable feature as we are going to be stabilizing it soon anyway. This will probably break RfL, so it will require an updated commit hash for the Linux Kernel that I will add here soon. r? `@Amanieu`
2025-08-28Rollup merge of #145926 - Zalathar:no-libtest, r=jieyouxuStuart Cook-90/+53
compiletest: Remove several remnants of the old libtest-based executor I noticed a few bits of low-hanging cleanup that are possible now that the non-libtest executor is well and truly established.
2025-08-28Rollup merge of #145913 - heiher:loong-hint, r=joshtriplettStuart Cook-33/+23
Add spin_loop hint for LoongArch
2025-08-28Rollup merge of #144864 - Muscraft:no-source-fixes, r=jieyouxuStuart Cook-43/+128
No source fixes This PR started as a fix for a rendering bug that [got noticed in #143661](https://github.com/rust-lang/rust/pull/143661#discussion_r2199109530), but turned into a fix for any rendering bugs related to files with no source. - Don't add an end column separator after a file with no source - Add column separator before secondary messages with no source - Render continuation between no source labels Before ``` error[E0423]: expected function, tuple struct or tuple variant, found struct `std::collections::HashMap` ╭▸ $DIR/multi-suggestion.rs:17:13 │ LL │ let _ = std::collections::HashMap(); │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ╭▸ $SRC_DIR/std/src/collections/hash/map.rs:LL:COL │ ╰ note: `std::collections::HashMap` defined here ╰╴ note: constructor is not visible here due to private fields ╭▸ $SRC_DIR/alloc/src/boxed.rs:LL:COL │ ╰ note: private field │ ╰ note: private field ``` After ``` error[E0423]: expected function, tuple struct or tuple variant, found struct `std::collections::HashMap` ╭▸ $DIR/multi-suggestion.rs:17:13 │ LL │ let _ = std::collections::HashMap(); │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ╰╴ ╭▸ $SRC_DIR/std/src/collections/hash/map.rs:LL:COL │ ╰ note: `std::collections::HashMap` defined here note: constructor is not visible here due to private fields ╭▸ $SRC_DIR/alloc/src/boxed.rs:LL:COL │ ├ note: private field │ ╰ note: private field ``` Note: This PR also makes it so `rustc` and `annotate-snippets` match in these cases
2025-08-28Rollup merge of #143193 - JonathanBrouwer:link_rework, r=jdonszelmannStuart Cook-1078/+1700
Port `#[link]` to the new attribute parsing infrastructure Ports `link` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
2025-08-28Rollup merge of #142727 - hkBst:rm-static-mut-wasm, r=ChrisDentonStuart Cook-7/+10
wasm: rm static mut More https://github.com/rust-lang/rust/issues/125035. I'm not sure this is correct, but it compiles.
2025-08-28Use default locale fallback dataRobert Bastian-216/+30
2025-08-28Bump icu_list to 2.0Robert Bastian-434/+371
2025-08-28Auto merge of #145891 - nikic:llvm-21.1.0, r=cuviperbors-0/+0
Update to LLVM 21.1.0
2025-08-28Auto merge of #145949 - jhpratt:rollup-smzd7tr, r=jhprattbors-47/+179
Rollup of 5 pull requests Successful merges: - rust-lang/rust#145382 (Add assembly test for `-Zreg-struct-return` option) - rust-lang/rust#145746 (Fix STD build failing for target_os = "espidf") - rust-lang/rust#145826 (Use AcceptContext in AttribueParser::check_target) - rust-lang/rust#145894 (Ensure the coordinator thread terminates before its channels drop) - rust-lang/rust#145946 (Remove unnecessary `[dependencies.unicode-properties]` entries.) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-27Rollup merge of #145946 - nnethercote:cargo-style, r=jdonszelmannJacob Pratt-14/+3
Remove unnecessary `[dependencies.unicode-properties]` entries. The Cargo style guide says to put dependencies on a single line if they fit. r? `@jdonszelmann`
2025-08-27Rollup merge of #145894 - zetanumbers:issue-142949, r=WaffleLapkinJacob Pratt-2/+5
Ensure the coordinator thread terminates before its channels drop Fixes rust-lang/rust#142949 Explanation: https://github.com/rust-lang/rust/issues/142949#issuecomment-3224573185
2025-08-27Rollup merge of #145826 - scrabsha:push-vrpwttmzqwpt, r=jdonszelmannJacob Pratt-29/+17
Use AcceptContext in AttribueParser::check_target
2025-08-27Rollup merge of #145746 - ivmarkov:fix-nofollow-espidf, r=ibraheemdevJacob Pratt-2/+11
Fix STD build failing for target_os = "espidf" A regression from rust-lang/rust#142938 cc `@lolbinarycat` cc `@ibraheemdev` ESP-IDF (and a few other embedded Tier-3 systems) is considered `cfg(unix)`, but it does not have the `O_NOFOLLOW` flag because neither of its three supported filesystems (FATFS, LitteLF and Spiffs) has symbolic links in the first place. What this fix does is to keep the `set_permissions_nofollow` method available and non-failing for ESP-IDF, but it behaves as if no `O_NONFOLLOW` was set. This should be fine as there is nothing to follow in the first place, as there are no symbolic links there. EDIT: Also added the same fix for Horizon, as requested by `@Meziu.`
2025-08-27Rollup merge of #145382 - winstonallo:reg-struct-return-asm-test, r=tgross35Jacob Pratt-0/+143
Add assembly test for `-Zreg-struct-return` option r? `@tgross35` As discussed in rust-lang/rust#145309 with `@tgross35` and `@ojeda,` I added assembly tests for the `-Zreg-struct-return` option verifying that it changes the ABI from hidden pointer to register-return on x86_32. The test covers: - Direct struct construction, showing register return vs hidden pointer - External function calls returning structs, showing ABI mismatch handling Different memory layouts affect ABI mismatch handling, but register returns use the same register allocation regardless of struct field layout (apart from the fact that they use smaller registers for smaller structs, of course). [Here](https://godbolt.org/z/dcW6rnMG3) is a compiler explorer with 2 examples. Let me know if there is anything more I could add. Since register returns only happen for structs up to the size of 2 registers, I figured testing the pivot value (8 bytes) would be most critical.
2025-08-28Auto merge of #145877 - nikic:capture-address, r=tmiaskobors-35/+47
Use captures(address) instead of captures(none) for indirect args While provenance cannot be captured through these arguments, the address / object identity can. Fixes https://github.com/rust-lang/rust/issues/137668. r? `@ghost`
2025-08-28Remove unnecessary `[dependencies.unicode-properties]` entries.Nicholas Nethercote-14/+3
The Cargo style guide says to put dependencies on a single line if they fit.
2025-08-27Auto merge of #145851 - lolbinarycat:rustdoc-optimize, r=GuillaumeGomezbors-19/+24
rustdoc: a few micro-optimizations targeted at build_impl Unsure if these will be anything substantial, but the first one at least should git rid of quite a few branches, second one unsure if it's worth it. r? `@GuillaumeGomez`
2025-08-27Disable `int_to_ptr_transmutes` suggestion for unsized typesUrgau-13/+69
2025-08-27Changes to the uitestsJonathan Brouwer-366/+945
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-27Port the `#[link]` attribute to the new parserJonathan Brouwer-623/+639
2025-08-27Move `NativeLibKind` from `rustc_session` to `rustc_hir`Jonathan Brouwer-89/+116
2025-08-27Add assembly tests verifying the functionality of `-Zreg-struct-return` for ↵winstonallo-0/+143
structs of different sizes. This test covers: * The callee side, making sure that the structs are correctly loaded into registers when `-Zreg-struct-return` is enabled * The caller side, making sure that callers do receive returned structs in registers when `-Zreg-struct-return` is enabled Structs of the size of up to 2 registers (8 bytes) can be returned in registers in x86_32. Therefore, the tests are done with 3 different struct sizes: * 2 bytes (register returns should happen) * 8 bytes (last value where register returns should happen) * 12 bytes (register returns should not happen even when `-Zreg-struct-return` is enabled)