about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-06-16Rollup merge of #142530 - fee1-dead-contrib:push-klusvwusyqvq, r=compiler-errorsJakub Beránek-20/+12
use `if let` guards where possible these crates already enable the feature
2025-06-16Rollup merge of #142528 - fee1-dead-contrib:push-rlxklunqkwmv, r=RalfJungJakub Beránek-1/+1
clarify `rustc_do_not_const_check` comment ~~Given that we have used this attribute for other reasons before it seems appropriate to make this a "usually".~~ Add function name as a pointer cc ```@rust-lang/wg-const-eval```
2025-06-16Rollup merge of #142450 - xizheyin:rustc-query-doc, r=SparrowLiiJakub Beránek-4/+60
Add documentation on top of `rustc_middle/src/query/mod.rs` The `rustc-dev-guide` gives a high-level intro, but many details—especially about how the code works and modifiers in `query xxx(){...}`—are only in code comments or the macro implementation. This doc makes it easier for contributors and code readers to understand the workflow and available modifiers without jumping between files and docs. This PR adds a comprehensive module-level doc comment to `rustc_middle::query::mod.rs` that: 1. Provides an overview of the query system and macro-based query definitions for reading code more easily 2. Centralizes documentation for all query modifiers (previously scattered or only in `rustc_macro` code), closely following the authoritative list in QueryModifiers.
2025-06-16Rollup merge of #142082 - xizheyin:rustc_attr_data_structures, r=jdonszelmannJakub Beránek-14/+48
Refactor `rustc_attr_data_structures` documentation I was reading through `AttributeKind` and realized that attributes like `InlineAttr` didn't appear in it, however, I found them in `rustc_codegen_ssa` and understood why (guessing). There's almost no overall documentation for this crate, I've added the organized documentation at the top of `lib.rs`, and I've grouped the Attributes into two categories: `AttributeKind` that run all through the compiler, and the ones that are only used in `codegen_ssa`, such as `InlineAttr`, `OptimizeAttr`, `InstructionSetAttr`. Also, I've added documentation for `AttributeKind` that further explains why attributes like `InlineAttr` don't appear in it, with examples for each variant. r? ```@jdonszelmann```
2025-06-16candidate_is_applicable to methodlcnr-17/+6
2025-06-16Emit linker timing sectionJakub Beránek-0/+2
2025-06-16Add infrastructure for emitting timing sectionsJakub Beránek-11/+146
2025-06-16Add parsing of `--json=timings`Jakub Beránek-0/+17
2025-06-16Fix RISC-V C function ABI when passing/returning structs containing floatsbeetrees-134/+272
2025-06-16Implement Stable for DiscrNotLebedev-14/+15
2025-06-16Add discriminant_for_variant to CoroutineDefNotLebedev-8/+44
2025-06-16Add discriminant_for_variant to AdtDefNotLebedev-4/+30
2025-06-16Add documentation on top of `rustc_middle/src/query/mod.rs`xizheyin-4/+60
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-16Remove an `njn:` comment accidentaly left behind.Nicholas Nethercote-1/+2
2025-06-16Auto merge of #142521 - sayantn:simplify-intrinsics, r=nikic,workingjubileebors-242/+55
Use `LLVMIntrinsicGetDeclaration` to completely remove the hardcoded intrinsics list Follow-up to rust-lang/rust#142259 This also needs a rustc-perf run, because `Intrinsic::getType` can be expensive `@rustbot` label A-LLVM A-codegen T-compiler r? `@workingjubilee` cc `@nikic`
2025-06-16Auto merge of #142550 - fmease:rollup-fteyzcv, r=fmeasebors-657/+396
Rollup of 10 pull requests Successful merges: - rust-lang/rust#133952 (Remove wasm legacy abi) - rust-lang/rust#134661 (Reduce precedence of expressions that have an outer attr) - rust-lang/rust#141769 (Move metadata object generation for dylibs to the linker code ) - rust-lang/rust#141937 (Report never type lints in dependencies) - rust-lang/rust#142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future) - rust-lang/rust#142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`) - rust-lang/rust#142470 (Add some missing mailmap entries) - rust-lang/rust#142481 (Add `f16` inline asm support for LoongArch) - rust-lang/rust#142499 (Remove check run bootstrap) - rust-lang/rust#142543 (Suggest adding semicolon in user code rather than macro impl details) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-16Fix `PathSource` lifetimes.Nicholas Nethercote-33/+33
It currently has two, which don't accurately capture what's happening -- the `TupleStruct` spans are allocated in `ResolverArenas`, which is different to where the `Expr` is allocated -- and require some "outlives" constraints to be used. This commit adds another lifetime, renames the existing ones, and removes the "outlives" constraints.
2025-06-15Rollup merge of #142543 - Urgau:span-borrowck-semicolon, r=fmeaseLeón Orell Valerian Liehr-3/+7
Suggest adding semicolon in user code rather than macro impl details This PR tries to find the right span (by peeling expansion) so that the suggestion for adding a semicolon is suggested in user code rather than in the expanded code (in the example a macro impl). Fixes rust-lang/rust#139049 r? `@fmease`
2025-06-15Rollup merge of #142481 - heiher:loong-asm-f16, r=AmanieuLeón Orell Valerian Liehr-3/+26
Add `f16` inline asm support for LoongArch r? `````@Amanieu`````
2025-06-15Rollup merge of #142389 - beetrees:cranelift-arg-ext, r=bjorn3León Orell Valerian Liehr-24/+40
Apply ABI attributes on return types in `rustc_codegen_cranelift` - The [x86-64 System V ABI standard](https://gitlab.com/x86-psABIs/x86-64-ABI/-/jobs/artifacts/master/raw/x86-64-ABI/abi.pdf?job=build) doesn't sign/zero-extend integer arguments or return types. - But the de-facto standard as implemented by Clang and GCC is to sign/zero-extend arguments to 32 bits (but not return types). - Additionally, Apple targets [sign/zero-extend both arguments and return values to 32 bits](https://developer.apple.com/documentation/xcode/writing-64-bit-intel-code-for-apple-platforms#Pass-arguments-to-functions-correctly). - However, the `rustc_target` ABI adjustment code currently [unconditionally extends both arguments and return values to 32 bits](https://github.com/rust-lang/rust/blame/e703dff8fe220b78195c53478e83fb2f68d8499c/compiler/rustc_target/src/callconv/x86_64.rs#L240) on all targets. - This doesn't cause a miscompilation when compiling with LLVM as LLVM will ignore the `signext`/`zeroext` attribute when applied to return types on non-Apple x86-64 targets. - Cranelift, however, does not have a similar special case, requiring `rustc` to set the argument extension attribute correctly. - However, `rustc_codegen_cranelift` doesn't currently apply ABI attributes to return types at all, meaning `rustc_codegen_cranelift` will currently miscompile `i8`/`u8`/`i16`/`u16` returns on x86-64 Apple targets as those targets require sign/zero-extension of return types. This PR fixes the bug(s) by making the `rustc_target` x86-64 System V ABI only mark return types as sign/zero-extended on Apple platforms, while also making `rustc_codegen_cranelift` apply ABI attributes to return types. The RISC-V and s390x C ABIs also require sign/zero extension of return types, so this will fix those targets when building with `rustc_codegen_cranelift` too. r? `````@bjorn3`````
2025-06-15Rollup merge of #142347 - azhogin:azhogin/async-drop-storage-live-dead-fix, ↵León Orell Valerian Liehr-5/+30
r=oli-obk Async drop - fix for StorageLive/StorageDead codegen for pinned future Fixes: rust-lang/rust#140429, Fixes: rust-lang/rust#140531, Fixes: rust-lang/rust#141761, Fixes: rust-lang/rust#141409. StorageLive/StorageDead codegen is corrected for pinned async drop future.
2025-06-15Rollup merge of #141937 - WaffleLapkin:never-report-in-deps, ↵León Orell Valerian Liehr-0/+2
r=oli-obk,traviscross Report never type lints in dependencies This PR marks never type lints (`never_type_fallback_flowing_into_unsafe` & `dependency_on_unit_never_type_fallback`) to be included in cargo's reports / to be emitted when they happen in dependencies. This PR is based on rust-lang/rust#141936 r? oli-obk
2025-06-15Rollup merge of #141769 - bjorn3:codegen_metadata_module_rework, ↵León Orell Valerian Liehr-281/+153
r=workingjubilee,saethlin Move metadata object generation for dylibs to the linker code This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time. Prerequisite of https://github.com/rust-lang/rust/issues/96708.
2025-06-15Rollup merge of #134661 - dtolnay:prefixattr, r=fmeaseLeón Orell Valerian Liehr-34/+110
Reduce precedence of expressions that have an outer attr Previously, `-Zunpretty=expanded` would expand this program as follows: ```rust #![feature(stmt_expr_attributes)] macro_rules! repro { ($e:expr) => { #[allow(deprecated)] $e }; } #[derive(Default)] struct Thing { #[deprecated] field: i32, } fn main() { let thing = Thing::default(); let _ = repro!(thing).field; } ``` ```rs #![feature(prelude_import)] #![feature(stmt_expr_attributes)] #[prelude_import] use std::prelude::rust_2021::*; #[macro_use] extern crate std; struct Thing { #[deprecated] field: i32, } #[automatically_derived] impl ::core::default::Default for Thing { #[inline] fn default() -> Thing { Thing { field: ::core::default::Default::default() } } } fn main() { let thing = Thing::default(); let _ = #[allow(deprecated)] thing.field; } ``` This is not the correct expansion. The correct output would have `(#[allow(deprecated)] thing).field` with the attribute applying only to `thing`, not to `thing.field`.
2025-06-15Rollup merge of #133952 - bjorn3:remove_wasm_legacy_abi, r=alexcrichtonLeón Orell Valerian Liehr-307/+28
Remove wasm legacy abi Closes https://github.com/rust-lang/rust/issues/122532 Closes https://github.com/rust-lang/rust/issues/138762 Fixes https://github.com/rust-lang/rust/issues/71871 https://github.com/rust-lang/rust/issues/88152 Fixes https://github.com/rust-lang/rust/issues/115666 Fixes https://github.com/rust-lang/rust/issues/129486
2025-06-15Auto merge of #142471 - lqd:sparse-borrows, r=nnethercotebors-6/+6
use `MixedBitSet` for borrows-in-scope dataflow analysis The `Borrows` dataflow analysis uses a dense bitset, but a bitset supporting _some_ amount of sparseness is better suited for big functions with a big number of loans. The cutoff between dense and chunked bitset is around 2K loans IIRC, and we could finesse that value if we wanted to, but as-is it happens to a couple of rustc-perf benchmarks (which IIRC are at least partially generated from macros and the likes.). It's a small win on these two, and shouldn't have any impact on the others. r? `@matthewjasper`
2025-06-15Only traverse reachable blocks in JumpThreading.Camille GILLOT-1/+1
2025-06-15Suggest adding semicolon in user code rather than macro impl detailsUrgau-3/+7
2025-06-15Correctly account for different address spaces in LLVM intrinsic invocationssayantn-19/+24
2025-06-15Auto merge of #142455 - ↵bors-9/+81
jdonszelmann:attempt-to-mitigate-delayed-lint-perf-problems, r=oli-obk collect delayed lints in hir_crate_items r? `@oli-obk` Attempt to mitigate perf problems in rust-lang/rust#138164
2025-06-15Use `LLVMIntrinsicGetDeclaration` to completely remove the hardcoded ↵sayantn-224/+32
intrinsics list
2025-06-15Manually invalidate caches in SimplifyCfg.Camille GILLOT-3/+13
2025-06-15Un-remap `rustc-dev` component pathsUrgau-0/+37
2025-06-15Auto merge of #142430 - compiler-errors:external-constraints, r=lcnrbors-0/+22
Don't fold `ExternalConstraintsData` when it's empty Probably useless, but let's see. r? lcnr
2025-06-15clarify `rustc_do_not_const_check` commentDeadbeef-1/+1
2025-06-15Refactor `rustc_attr_data_structures` documentationxizheyin-14/+48
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-15Auto merge of #142398 - fee1-dead-contrib:push-ynxrtswtkyxw, r=oli-obkbors-15/+4
early linting: avoid redundant calls to `check_id` An attempt to address the regression at https://github.com/rust-lang/rust/pull/142240#issuecomment-2964425460 r? `@oli-obk` cc `@nnethercote` who might have a better understanding of the performance implications
2025-06-15use `if let` guards where possibleDeadbeef-20/+12
2025-06-15Auto merge of #142388 - cjgillot:span-hash, r=davidtwcobors-10/+10
Do not clone Arc when hashing span. Tiny improvement I was when trying to profile span hashing.
2025-06-15Move the place in `&pin mut $place` when `!Unpin` to ensure soundnessFrank King-7/+31
2025-06-15Auto merge of #142355 - lcnr:fast_reject-reject, r=BoxyUwUbors-3/+4
move fast reject into inner to also fast reject inside of the folder r? `@BoxyUwU`
2025-06-15Implement pinned borrows, part of `pin_ergonomics`Frank King-8/+56
2025-06-15Implement `simd_round_ties_even` for miri, cg_clif and cg_gccsayantn-1/+6
2025-06-15Add `simd_funnel_sh{l,r}` and `simd_round_ties_even`sayantn-2/+21
2025-06-14Auto merge of #142289 - fmease:maybe-perf-gen-args, r=compiler-errorsbors-6/+5
[perf] `GenericArgs`-related: Change asserts to debug asserts & use more slice interning over iterable interning 1. The 1st commit yields the following perf gains: [#142289 (comment)](https://github.com/rust-lang/rust/pull/142289#issuecomment-2964041303). 2. The 2nd commit might also have a minor positive perf impact, however that one wasn't tested in isolation. For reference, the initial approach https://github.com/rust-lang/rust/commit/c7e6accd79d91fe5dec01a81499a08f9db280440 (results: https://github.com/rust-lang/rust/pull/142289#issuecomment-2961076587) had a lot more changes (apart from what's now contained in commit 1 and 2) which seemed to be perf irrelevant (cf. the partial countercheck in https://github.com/rust-lang/rust/commit/6f82bf1cfece61d32714fbfeecf8c5cf1356b3ae (results: https://github.com/rust-lang/rust/pull/142289#issuecomment-2968393647).
2025-06-14Auto merge of #142259 - sayantn:simplify-intrinsics, r=workingjubileebors-829/+479
Simplify implementation of Rust intrinsics by using type parameters in the cache The current implementation of intrinsics have a lot of duplication to handle different overloads of overloaded LLVM intrinsic. This PR uses the **base name and the type parameters** in the cache instead of the full, overloaded name. This has the benefit that `call_intrinsic` doesn't need to provide the full name, rather the type parameters (which is most of the time more available). This uses `LLVMIntrinsicCopyOverloadedName2` to get the overloaded name from the base name and the type parameters, and only uses it to declare the function. (originally was part of rust-lang/rust#140763, split off later) `@rustbot` label A-codegen A-LLVM r? codegen
2025-06-14Prepare `rustc-dev` component un-remapping in the compilerUrgau-82/+112
2025-06-14Auto merge of #142129 - ↵bors-7/+33
shepmaster:mismatched-syntaxes-in-function-like-places, r=jieyouxu Apply `mismatched-lifetime-syntaxes` to trait and extern functions r? `@jieyouxu`
2025-06-14Remove all support for wasm's legacy ABIbjorn3-307/+28
2025-06-14Rollup merge of #142477 - JonathanBrouwer:associated-type-suggestion, ↵Matthias Krüger-1/+1
r=WaffleLapkin Fix incorrect suggestion when calling an associated type with a type anchor `sugg_span` here is the span of the call expression. That span here is the `<Self>::Assoc`, which is exactly what we need here (even though I would expect it to include the arguments, but I guess it doesn't) r? ``@WaffleLapkin`` One commit with failing tests and one that fixes it for reviewability closes rust-lang/rust#142473