about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-08-28Rollup merge of #145853 - JonathanBrouwer:fix-lit-parsing, r=jdonszelmannGuillaume Gomez-35/+52
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/+1
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-24/+98
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-28Improve error messages around invalid literals in attribute argumentsJonathan Brouwer-35/+52
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-28Add ui test for unsupported `doc(attribute = "...")` case for attributes ↵Guillaume Gomez-0/+1
with namespace
2025-08-28Create new `Item::is_fake_item` method as equivalent to check for ↵Guillaume Gomez-21/+45
`is_primitive`, `is_keyword` and `is_attribute` methods
2025-08-28Add new `doc(attribute = "...")` attributeGuillaume Gomez-22/+71
2025-08-28Rollup merge of #145953 - robertbastian:master, r=ManishearthStuart Cook-251/+138
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/+19
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 #144864 - Muscraft:no-source-fixes, r=jieyouxuStuart Cook-24/+65
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-713/+757
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-28Use default locale fallback dataRobert Bastian-202/+22
2025-08-28Bump icu_list to 2.0Robert Bastian-248/+315
2025-08-28Auto merge of #145949 - jhpratt:rollup-smzd7tr, r=jhprattbors-45/+25
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-28Auto merge of #145877 - nikic:capture-address, r=tmiaskobors-18/+15
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-2/+7
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/+19
2025-08-27Changes to the uitestsJonathan Brouwer-1/+3
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/+115
2025-08-27Auto merge of #145923 - matthiaskrgr:rollup-rkejtos, r=matthiaskrgrbors-97/+97
Rollup of 6 pull requests Successful merges: - rust-lang/rust#144274 (add Option::reduce) - rust-lang/rust#145562 (Simplify macro generating ToString implementations for `&…&str`) - rust-lang/rust#145625 (improve float to_degrees/to_radians rounding comments and impl) - rust-lang/rust#145740 (Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml`) - rust-lang/rust#145885 (Inherit TCC in debuginfo tests on macOS) - rust-lang/rust#145905 (Stop calling unwrap when format foreign has trailing dollar) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-27Rollup merge of #145905 - TaKO8Ki:fix-137580, r=nnethercoteMatthias Krüger-1/+1
Stop calling unwrap when format foreign has trailing dollar Fixes rust-lang/rust#137580
2025-08-27Rollup merge of #145740 - nnethercote:workspace-members, r=KobzolMatthias Krüger-96/+96
Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml` It lets us avoid a lot of repetition of crate versions, etc. I've just done a few as a start. Many more can be done in follow-ups. r? `@Kobzol`
2025-08-27Auto merge of #140737 - amandasystems:revised-constraint-search, r=lcnrbors-204/+256
Region inference: Use outlives-static constraints in constraint search Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive `'static`. This cosmetically changes the output of two UI tests. I blessed them i separate commits with separate motivations, but that can of course be squashed as desired. We probably want that. The PR was extracted out of rust-lang/rust#130227 and consists of one-third of its functional payload. r? lcnr
2025-08-27Use `AcceptContext` in `AttribueParser::check_target`Sasha Pourcelot-29/+17
2025-08-27Add `itertools` to `[workspace.dependencies]`.Nicholas Nethercote-13/+13
2025-08-27Add `tracing` to `[workspace.dependencies]`.Nicholas Nethercote-45/+45
2025-08-27Add `rustc-literal-escaper` to `[workspace.dependencies]`.Nicholas Nethercote-4/+4
2025-08-27Add `memchr` to `[workspace.dependencies]`.Nicholas Nethercote-2/+2
2025-08-27Add `bitflags` to `[workspace.dependencies]`.Nicholas Nethercote-14/+14
2025-08-27Add `thin-vec` to newly added `[workspace.dependencies]`.Nicholas Nethercote-18/+18
2025-08-27Auto merge of #144841 - cjgillot:typeck-no-attrs, r=davidtwcobors-35/+35
Access less HIR attributes from typeck Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions. This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: https://github.com/rust-lang/rust/pull/144841#issuecomment-3153339771 Fixes https://github.com/rust-lang/rust/issues/124352
2025-08-26Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins`Matthew Maurer-12/+1
Fix #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-26Auto merge of #145906 - samueltardieu:rollup-p8ibzhz, r=samueltardieubors-55/+178
Rollup of 9 pull requests Successful merges: - rust-lang/rust#144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`) - rust-lang/rust#145790 (Improve dist for gnullvm hosts) - rust-lang/rust#145792 (Use attribute name in message for "outer attr used as inner attr" errors) - rust-lang/rust#145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags) - rust-lang/rust#145876 (Enable building/disting standard library in stage 0) - rust-lang/rust#145887 (bootstrap: Don't panic if codegen-backends is set to empty) - rust-lang/rust#145888 (platform-support: Fix LoongArch32 host column) - rust-lang/rust#145892 (add a flag to codegen fn attrs for foreign items) - rust-lang/rust#145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs) r? `@ghost` `@rustbot` modify labels: rollup
2025-08-26Rollup merge of #145892 - jdonszelmann:codegen-fn-attrs-foreign-item, r=bjorn3Samuel Tardieu-10/+13
add a flag to codegen fn attrs for foreign items r? `@ghost` refiled to rerun CI
2025-08-26Rollup merge of #145840 - a4lg:riscv-elf-flags-for-internal-objs, r=WaffleLapkinSamuel Tardieu-3/+11
rustc_codegen_ssa: More comprehensive RISC-V ELF flags This change implements more conformant, more comprehensive RISC-V ELF flags handling when generating certain object files directly from rustc. * Use `"zca"` instead of `"c"` The "Zca" extension (a subset of "C") is the minimal configuration for compressed instructions to set `EF_RISCV_RVC` flag. * Set TSO flag from `"ztso"` The "Ztso" extension denotes that the program depends on the RVTSO (Total Store Ordering) memory consistency model, which is stronger than the standard RVWMO (Weak Memory Ordering) consistency model and on ELF targets, we need to set `EF_RISCV_TSO` flag.
2025-08-26Rollup merge of #145792 - scrabsha:push-umpytyxunpxq, r=jdonszelmannSamuel Tardieu-42/+154
Use attribute name in message for "outer attr used as inner attr" errors
2025-08-26fix: Render continuation between no source labelsScott Schafer-19/+20
2025-08-26fix: Add col separator before secondary messages with no sourceScott Schafer-0/+25
2025-08-26fix: Don't add an end column separator after a file with no sourceScott Schafer-5/+20
2025-08-27stop returning errors when format foreign has trailing dollarTakayuki Maeda-1/+1
2025-08-26Auto merge of #145890 - GuillaumeGomez:subtree-update_cg_gcc_2025-08-26, ↵bors-60/+76
r=GuillaumeGomez GCC backend subtree update cc `@antoyo` r? ghost
2025-08-26Comment on intentional field orderDaria Sukhonina-0/+3
2025-08-26Ensure the coordinator thread terminates firstDaria Sukhonina-2/+2
2025-08-26Fix sync conflictGuillaume Gomez-1/+1
2025-08-26Merge commit 'feb42827f11a7ae241ceecc81e9ae556fb6ba214' into ↵Guillaume Gomez-61/+77
subtree-update_cg_gcc_2025-08-26