about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2025-08-06Embed GDB pretty printers in rlibs and dylibsSebastian Poeplau-33/+20
Instead of collecting pretty printers transitively when building executables/staticlibs/cdylibs, let the debugger find each crate's pretty printers via its .debug_gdb_scripts section. This covers the case where libraries defining custom pretty printers are loaded dynamically.
2025-08-06Add annotations to the graphviz region graph on region originsAmanda Stjerna-1/+15
This adds - (ex) for regions whose origin is existential, - (p) for regoins whose origin is a placeholder, and - (p for <name>) if the originating placeholder is named. This has helped _my_ debugging and it doesn't create too bad clutter, I feel. The change is ridiculously small, but I turned it into a separate PR so we can bikeshed the format.
2025-08-06Rename some `PrettyPrinter` methods.Nicholas Nethercote-33/+33
More consistency.
2025-08-06Rename some `Printer` methods.Nicholas Nethercote-61/+71
I find these name clearer, and starting them all with `print_` makes things more consistent.
2025-08-06Move `should_truncate` from trait `Printer` to sub-trait `PrettyPrinter`.Nicholas Nethercote-8/+8
It's not used in `Printer`.
2025-08-06Add comments to `Printer`.Nicholas Nethercote-17/+39
These details took me some time to work out.
2025-08-06Fortify generic param default checksLeón Orell Valerian Liehr-99/+101
2025-08-05Add aarch64_be-unknown-none-softfloat targetJens Reidel-0/+44
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-08-05Auto merge of #144863 - cjgillot:live-or-dead, r=Urgaubors-274/+199
Simplify dead code lint This PR scratches a few itches I had when looking at that code. The perf improvement comes from keeping the `scanned` set through several marking phases. This pretty much divides by 2 the number of HIR traversals.
2025-08-05we only merge candidates for trait and normalizes-to goalslcnr-69/+48
2025-08-05Gate const trait syntaxLeón Orell Valerian Liehr-0/+3
2025-08-05Mark all deprecation lints in name resolution as deny-by-default and ↵Vadim Petrochenkov-4/+8
report-in-deps
2025-08-05Simplify multiple things.Nicholas Nethercote-14/+13
- `same_path` can just be a `bool`. - `expected` and `found` are only needed inside the block. - Neaten a comment.
2025-08-05Rename most of the printers.Nicholas Nethercote-22/+22
Three of them are named `AbsolutePathPrinter`, which is confusing, so give those names that better indicate how they are used. And then there is `SymbolPrinter` and `SymbolMangler`, which are renamed as `LegacySymbolMangler` and `V0SymbolMangler`, better indicating their similarity.
2025-08-05Clarify `value_path_str_with_args`.Nicholas Nethercote-4/+4
The use of `print_value_path` means the value namespace is always used and the `guess_def_namespace` call is unnecessary. This commit removes the `guess_def_namespace` call and hard-codes `ValueNS`. It also changes the `print_value_path` to `print_def_path` for consistency with `def_path_str_with_args`.
2025-08-05Preserve the .debug_gdb_scripts sectionSebastian Poeplau-45/+48
Make sure that compiler and linker don't optimize the section's contents away by adding the global holding the data to "llvm.used". The volatile load in the main shim is retained because "llvm.used", which translates to SHF_GNU_RETAIN on ELF targets, requires a reasonably recent linker; emitting the volatile load ensures compatibility with older linkers, at least when libstd is used. Pretty printers in dylib dependencies are now emitted by the main crate instead of the dylib; apart from matching how rlibs are handled, this approach has the advantage that `omit_gdb_pretty_printer_section` keeps working with dylib dependencies.
2025-08-04Let `RemoveUnneededDrops` also remove `drop_in_place`Scott McMurray-7/+24
2025-08-05Added checks for attribute in type caseKivooeo-7/+91
2025-08-05Rollup merge of #144920 - compiler-errors:span-arg, r=lqdSamuel Tardieu-3/+3
Dont print arg span in MIR dump for tail call r? WaffleLapkin This makes the MIR dump for tail call terminators consistent w/ regular calls.
2025-08-05Rollup merge of #144890 - WaffleLapkin:project_fields, r=lcnrSamuel Tardieu-33/+44
Add `InterpCx::project_fields` I was hoping for a much bigger improvement and this is lukewarm at best ^^' Still, I think this makes sense.
2025-08-05Rollup merge of #144877 - Zalathar:coverage-various, r=lcnrSamuel Tardieu-68/+76
coverage: Various small cleanups This PR is a collection of small coverage-related changes that I accumulated while working towards other coverage improvements. Each change should hopefully be fairly straightforward.
2025-08-05Rollup merge of #144866 - JonathanBrouwer:should_emit_fix, r=jdonszelmannSamuel Tardieu-4/+11
Remove `SHOULD_EMIT_LINTS` in favor of `should_emit` r? ``@jdonszelmann``
2025-08-05Rollup merge of #144817 - WaffleLapkin:reject-referety, r=UrgauSamuel Tardieu-3/+50
Properly reject tail calls to `&FnPtr` or `&FnDef` Fixes rust-lang/rust#144795
2025-08-05Rollup merge of #144776 - nnethercote:Printer-cleanups, r=cjgillotSamuel Tardieu-693/+649
`Printer` cleanups The trait `Printer` is implemented by six types, and the sub-trait `PrettyPrinter` is implemented by three of those types. The traits and the impls are complex and a bit of a mess. This PR starts to clean them up. r? ``@davidtwco``
2025-08-05Rollup merge of #144741 - ShoyuVanilla:tilde-const-in-block, r=fee1-deadSamuel Tardieu-16/+55
fix: Error on illegal `[const]`s inside blocks within legal positions Fixes rust-lang/rust#132067 I initially considered moving `[const]` validations to `rustc_ast_lowering`, but that approach would require adding constness information to `AssocCtxt`, which introduces significant changes - especially within `rustc_expand` - just to support a single use case here: https://github.com/rust-lang/rust/blob/3fb1b53a9dbfcdf37a4b67d35cde373316829930/compiler/rustc_ast_passes/src/ast_validation.rs#L1596-L1610 Instead, I believe it's sufficient to simply "reset" `[const]` allowness whenever we enter a new block.
2025-08-04Gate checking rustc attrs on the feature.Camille GILLOT-8/+19
2025-08-04Check for rustc_has_incoherent_inherent_impls in incoherent_impls query.Camille GILLOT-18/+10
2025-08-04Add doc-comment.Camille GILLOT-0/+1
2025-08-04Update doc-comment.Camille GILLOT-4/+3
2025-08-04Simplify maybe_record_as_seed.Camille GILLOT-3/+4
2025-08-04Drop `rust-version` from `rustc_thread_pool`Josh Stone-1/+0
The current `rust-version = "1.63"` was inherited from rayon, but it doesn't make sense to limit this in the compiler workspace. Having any setting at all has effects on tools like `cargo info` that try to infer the MSRV when the workspace itself doesn't specify it. Since we are the compiler, our only MSRV is whatever bootstrapping requires.
2025-08-04Dont print arg span in MIR dump for tail callMichael Goulet-3/+3
2025-08-04Include whitespace in "remove `|`" suggestion and make it hiddenEsteban Küber-13/+28
2025-08-04Don't actually pass BB to check_call_destMichael Goulet-60/+54
2025-08-04fix `#[loop_match]` on diverging loopFolkert de Vries-1/+1
this generated invalid MIR before
2025-08-04Tweak auto trait errorsEsteban Küber-11/+16
Make suggestions to remove params and super traits tool-only, and make the suggestion span more accurate. ``` error[E0567]: auto traits cannot have generic parameters --> $DIR/auto-trait-validation.rs:6:19 | LL | auto trait Generic<T> {} | -------^^^ | | | auto trait cannot have generic parameters error[E0568]: auto traits cannot have super traits or lifetime bounds --> $DIR/auto-trait-validation.rs:8:20 | LL | auto trait Bound : Copy {} | ----- ^^^^ | | | auto traits cannot have super traits or lifetime bounds ``` ``` error[E0380]: auto traits cannot have associated items --> $DIR/issue-23080.rs:5:8 | LL | unsafe auto trait Trait { | ----- auto traits cannot have associated items LL | fn method(&self) { | ^^^^^^ ```
2025-08-04Port `#[coroutine]` to the new attribute systemSasha Pourcelot-17/+33
Related to https://github.com/rust-lang/rust/issues/131229#issue-2565886367.
2025-08-04Enforce tail call type is related to body return type in borrowckMichael Goulet-3/+7
2025-08-04Suggest bounds in more cases, accounting for type parameters referenced in ↵Esteban Küber-10/+68
predicate
2025-08-04Anonymize binders in tail call sigMichael Goulet-1/+5
2025-08-04Print CGU reuse statistics when `-Zprint-mono-items` is enabledJakub Beránek-0/+9
2025-08-04add `project_fields` helper functionWaffle Lapkin-13/+22
2025-08-04Merge commit '482e8540a1b757ed7bccc2041c5400f051fdb01e' into ↵Guillaume Gomez-45/+275
subtree-update_cg_gcc_2025-08-04
2025-08-04small refactor of `InterpResult`Waffle Lapkin-20/+22
- don't need type alias to default type argument - `Residual` impl allows to use more std APIs (like `<[T; N]>::try_map`)
2025-08-04properly reject tail calls to `&FnPtr` or `&FnDef`Waffle Lapkin-2/+49
2025-08-04drive-by cleanup: fix outdated documentationWaffle Lapkin-1/+1
2025-08-04Rollup merge of #144694 - compiler-errors:with-self-ty, r=SparrowLiiStuart Cook-41/+52
Distinguish prepending and replacing self ty in predicates There are two kinds of functions called `with_self_ty`: 1. Prepends the `Self` type onto an `ExistentialPredicate` which lacks it in its internal representation. 2. Replaces the `Self` type of an existing predicate, either for diagnostics purposes or in the new trait solver when normalizing that self type. This PR distinguishes these two because I often want to only grep for one of them. Namely, let's call it `with_replaced_self_ty` when all we're doing is replacing the self type.
2025-08-04coverage: Represent `CovmapVersion` as an enumZalathar-15/+32
Using an enum here was historically not worth the extra hassle, but now we can lean on `#[derive(TryFromU32)]` to hide most of the boilerplate.
2025-08-04coverage: Simplify access to debug/testing `-Zcoverage-options` flagsZalathar-6/+9
2025-08-04coverage: Push async special case down into `extract_refined_covspans`Zalathar-14/+16