about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-06-23Rollup merge of #142784 - Kobzol:timings-codegen, r=nnethercoteJubilee-4/+50
Add codegen timing section And since we now start and end the sections also using separate functions, also add some light checking if we're generating the sections correctly. I'm integrating `--timings` into Cargo, and I realized that the codegen timings would be quite useful for that. Frontend can be computed simply as `[start of compilation, start of codegen]` for now. r? `@nnethercote`
2025-06-23[Arm64EC] Only decorate functions with `#`Daniel Paoliello-50/+142
2025-06-23Add `#[loop_match]` for improved DFA codegenbjorn3-45/+1002
Co-authored-by: Folkert de Vries <folkert@folkertdev.nl>
2025-06-23fix `-Zmin-function-alignment` without attributesFolkert de Vries-6/+4
the minimum function alignment was skipped on functions without attributes. That is because in our testing we generally apply `#[no_mangle]` to functions that are tested. I've added a test now that deliberately has no attributes
2025-06-23unsupported_calling_conventions: print which ABI this is aboutRalf Jung-1/+3
2025-06-23Clarify note in rustc_ast_lowering still appliesJubilee Young-2/+3
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-06-23compiler: Remove unsupported_fn_ptr_calling_conventions lintJubilee Young-31/+7
2025-06-23hir_analysis: Avoid repeating unsupported ABI errorsJubilee Young-8/+2
2025-06-23compiler: plug unsupported ABI leakage from the ASTJubilee Young-4/+24
We modify rustc_ast_lowering to prevent all unsupported ABIs from leaking through the HIR without being checked for target support. Previously ad-hoc checking on various HIR items required making sure we check every HIR item which could contain an `extern "{abi}"` string. This is a losing proposition compared to gating the lowering itself. As a consequence, unsupported ABI strings will now hard-error instead of triggering the FCW `unsupported_fn_ptr_calling_conventions`. This FCW was upgraded to warn in dependencies in Rust 1.87 which was released on 2025 May 17, and it is now 2025 June, so it has become active within a stable Rust version. As we already had errored on these ABIs in most other positions, and have warned for fn ptrs, this breakage has had reasonable foreshadowing. However, this does cause errors for usages of `extern "{abi}"` that were theoretically writeable within source but could not actually be applied in any useful way by Rust programmers without either warning or error. For instance, trait declarations without impls were never checked. These are the exact kinds of leakages that this new approach prevents. A deprecation cycle is not useful for these marginal cases as upon impl, even default impls within traits, different HIR objects would be used. Details of our HIR analysis meant that those objects did get checked. We choose to error twice if an ABI is also barred by a feature gate on the presumption that usage of a target-incorrect ABI is intentional. Co-authored-by: Ralf Jung <post@ralfj.de>
2025-06-23Skip `late_lint_mod_inner` if all built-in lints can be skippedJakub Beránek-3/+12
2025-06-23Fix doc commentJakub Beránek-1/+1
2025-06-23Improve code and documentationGuillaume Gomez-15/+24
2025-06-23Update tests to work with new DocFragment field and ↵Guillaume Gomez-2/+4
`redundant_explicit_links` new API
2025-06-23Do not emit `redundant_explicit_links` rustdoc lint if the doc comment comes ↵Guillaume Gomez-32/+50
from expansion
2025-06-23Rollup merge of #142892 - jdonszelmann:fix-142891, r=oli-obkJana Dönszelmann-1/+9
Fix ICE on debug builds where lints are delayed on the crate root r? ``@oli-obk`` Closes rust-lang/rust#142891 thanks to ``@JonathanBrouwer`` for finding it!
2025-06-23move naked checks out of check_attr.rsJana Dönszelmann-172/+189
2025-06-23make warnings methods on cx so it's easier to emit them elsewhere tooJana Dönszelmann-8/+28
2025-06-23rewrite #[naked] parserJana Dönszelmann-16/+44
2025-06-23fix 142891Jana Dönszelmann-1/+9
2025-06-23inspect: merge `[Canonical]GoalEvaluation`lcnr-97/+33
2025-06-23`evaluate_goal`: avoid unnecessary steplcnr-73/+47
2025-06-23Only store the LocalDefId instead of the whole instance.Camille GILLOT-6/+11
2025-06-23Add codegen timing sectionJakub Beránek-4/+50
2025-06-23update to literal-escaper 0.0.4 for better API without `unreachable` and ↵Marijn Schouten-76/+44
faster string parsing
2025-06-23Rollup merge of #142854 - folkertdev:centralize-min-function-alignment, ↵Matthias Krüger-17/+10
r=workingjubilee centralize `-Zmin-function-alignment` logic tracking issue: https://github.com/rust-lang/rust/issues/82232 discussed in: https://github.com/rust-lang/rust/pull/142824#discussion_r2160056244 Apply the `-Zmin-function-alignment` value to the alignment field of the function attributes when those are created, so that individual backends don't need to consider it. The one exception right now is cranelift, because it can't yet set the alignment for individual functions, but it can (and does) set the global minimum function alignment. cc ``@RalfJung`` I think this is an improvement regardless, is there anything else that should be done for miri?
2025-06-23Rollup merge of #142823 - JonathanBrouwer:no_mangle_parser, r=jdonszelmannMatthias Krüger-44/+86
Port `#[no_mangle]` to new attribute parsing infrastructure Ports `no_mangle` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? ``@jdonszelmann``
2025-06-22Stop collecting unmentioned constantsMark Rousskov-6/+8
This avoids generating useless dead LLVM IR.
2025-06-22Hash less while hashing def-ids.Camille GILLOT-3/+15
2025-06-22Only inherit local hash for paths.Camille GILLOT-3/+13
2025-06-22Port `#[no_mangle]` to new attribute parsing infrastructureJonathan Brouwer-44/+86
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-22Cache queries.Camille GILLOT-0/+1
2025-06-22Auto merge of #142508 - Mark-Simulacrum:skip-noop-drop-glue, r=fee1-deadbors-2/+10
Skip no-op drop glue Since rust-lang/rust#122662 this no longer gets used in vtables, so we're safe to fully drop generating functions from vtables. Those are eventually cleaned up by LLVM, but it's wasteful to produce them in the first place. This doesn't appear to be a significant win (and shows some slight regressions) but seems like the right thing to do. At minimum it reduces noise in the LLVM IR we generate, which seems like a good thing.
2025-06-22Only compute recursive callees once.Camille GILLOT-134/+152
2025-06-22add method to retrieve body of coroutineMakai-0/+6
2025-06-22Auto merge of #142878 - GuillaumeGomez:rollup-53dohob, r=GuillaumeGomezbors-133/+203
Rollup of 10 pull requests Successful merges: - rust-lang/rust#142458 (Merge unboxed trait object error suggestion into regular dyn incompat error) - rust-lang/rust#142593 (Add a warning to LateContext::get_def_path) - rust-lang/rust#142594 (Add DesugaringKind::FormatLiteral) - rust-lang/rust#142740 (Clean-up `FnCtxt::is_destruct_assignment_desugaring`) - rust-lang/rust#142780 (Port `#[must_use]` to new attribute parsing infrastructure) - rust-lang/rust#142798 (Don't fail to parse a struct if a semicolon is used to separate fields) - rust-lang/rust#142856 (Add a few inline directives in rustc_serialize.) - rust-lang/rust#142868 (remove few allow(dead_code)) - rust-lang/rust#142874 (cranelift: fix target feature name typo: "fxsr") - rust-lang/rust#142877 (Document why tidy checks if `eslint` is installed via `npm`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-22Init local_names lazily for borrowck diagnosticsKornel-44/+58
2025-06-22Avoid panic when debug info is missingKornel-3/+7
2025-06-22Remove dead instructions in terminate blocksMark Rousskov-5/+4
2025-06-22Rollup merge of #142874 - marxin:cranelift-typo-fix, r=bjorn3Guillaume Gomez-2/+2
cranelift: fix target feature name typo: "fxsr" Fix a typo introduced in 71b698c0b81c2e35c852ebcdf1f5cbe9e9162a50 CC: `@clubby789` `@bjorn3`
2025-06-22Rollup merge of #142868 - klensy:dc, r=oli-obkGuillaume Gomez-4/+0
remove few allow(dead_code) Few from serial/parallel compiler leftovers and few from bootstrap.
2025-06-22Rollup merge of #142856 - cjgillot:inline-serialize, r=petrochenkovGuillaume Gomez-0/+4
Add a few inline directives in rustc_serialize. I see `debug_strict_add` and `debug_strict_sub` appearing in callgrind output. This bothers me. This PR should make them disappear.
2025-06-22Rollup merge of #142798 - camsteffen:recover-semi, r=compiler-errorsGuillaume Gomez-30/+21
Don't fail to parse a struct if a semicolon is used to separate fields The first commit is a small refactor.
2025-06-22Rollup merge of #142780 - JonathanBrouwer:must_use_new_attr, r=jdonszelmannGuillaume Gomez-7/+73
Port `#[must_use]` to new attribute parsing infrastructure Ports `must_use` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? `@jdonszelmann`
2025-06-22Rollup merge of #142740 - ada4a:is-destruct-assignment-desugaring, r=fee1-deadGuillaume Gomez-13/+12
Clean-up `FnCtxt::is_destruct_assignment_desugaring` I noticed the docstring thing and fixed that; then I thought I'd rewrite the method using let-chains while I'm at it, since that seemed appropriate. But I don't feel too strongly about the second change, so let me know if I should remove it
2025-06-22Rollup merge of #142594 - mejrs:new_desugaring, r=chenyukangGuillaume Gomez-9/+59
Add DesugaringKind::FormatLiteral Implements `DesugaringKind::FormatLiteral` to mark the FormatArgs desugaring of format literals. The main use for this is to stop yapping about about formatting parameters if we're not anywhere near a format literal. The other use case is to fix suggestions such as https://github.com/rust-lang/rust/issues/141350. It might also be useful for new or existing diagnostics that check whether they're in a format-like macro. cc `@xizheyin` `@fmease`
2025-06-22Rollup merge of #142593 - blyxyas:improve-docs-itty-bitty-change, ↵Guillaume Gomez-0/+9
r=compiler-errors Add a warning to LateContext::get_def_path Preventing anyone from doing the same error as https://github.com/rust-lang/rust-clippy/pull/15043 fixed
2025-06-22Rollup merge of #142458 - oli-obk:dyn-incompat, r=compiler-errorsGuillaume Gomez-68/+23
Merge unboxed trait object error suggestion into regular dyn incompat error Another hir-walker removed from the well-formed queries. This error was always a duplicate of another, but it was able to provide more information because it could invoke `is_dyn_compatible` without worrying about cycle errors. That's also the reason we can't put the error directly into hir_ty_lowering when lowering a `dyn Trait` within an associated item signature. So instead I packed it into the error handling of wf obligation checking.
2025-06-22Don't suggest changing a method inside a expansionUrgau-1/+3
2025-06-22Address review commentsUrgau-9/+31
2025-06-22cranelift: fix target feature name type: "fxsr"Martin Liska-2/+2