about summary refs log tree commit diff
path: root/compiler/rustc_symbol_mangling/src/legacy.rs
AgeCommit message (Collapse)AuthorLines
2025-09-09erase_regions to erase_and_anonymize_regionsBoxy-2/+5
2025-08-14Print regions in `type_name`.Nicholas Nethercote-3/+3
Currently they are skipped, which is a bit weird, and it sometimes causes malformed output like `Foo<>` and `dyn Bar<, A = u32>`. Most regions are erased by the time `type_name` does its work. So all regions are now printed as `'_` in non-optional places. Not perfect, but better than the status quo. `c_name` is updated to trim lifetimes from MIR pass names, so that the `PASS_NAMES` sanity check still works. It is also renamed as `simplify_pass_type_name` and made non-const, because it doesn't need to be const and the non-const implementation is much shorter. The commit also renames `should_print_region` as `should_print_optional_region`, which makes it clearer that it only applies to some regions. Fixes #145168.
2025-08-13Rollup merge of #144949 - nnethercote:more-Printer-cleanups, r=davidtwcoGuillaume Gomez-15/+18
More `Printer` cleanups A sequel to rust-lang/rust#144776. r? ```@davidtwco```
2025-08-07Reimplement `print_region` in `type_name.rs`.Nicholas Nethercote-1/+3
Broken by #144776; this is reachable after all. Fixes #144994. The commit also adds a lot more cases to the `type-name-basic.rs`, because it's currently very anaemic. This includes some cases where region omission does very badly; these are marked with FIXME.
2025-08-06Rename some `PrettyPrinter` methods.Nicholas Nethercote-3/+3
More consistency.
2025-08-06Rename some `Printer` methods.Nicholas Nethercote-7/+10
I find these name clearer, and starting them all with `print_` makes things more consistent.
2025-08-05Rename most of the printers.Nicholas Nethercote-5/+5
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-03Remove unused arg from `path_append_impl`.Nicholas Nethercote-1/+0
None of the impls use it.
2025-08-03Rename `Printer` variables.Nicholas Nethercote-31/+29
Currently they are mostly named `cx`, which is a terrible name for a type that impls `Printer`/`PrettyPrinter`, and is easy to confuse with other types like `TyCtxt`. This commit changes them to `p`. A couple of existing `p` variables had to be renamed to make way.
2025-08-03Remove `type_name::AbsolutePathPrinter::comma_sep`.Nicholas Nethercote-0/+2
It's equivalent to the default `PrettyPrinter::comma_sep`.
2025-08-03Mark `Printer` methods as unreachable where appropriate.Nicholas Nethercote-1/+1
This helps me understand the structure of the code a lot. If any of these are actually reachable, we can put the old code back, add a new test case, and we will have improved our test coverage.
2025-05-27Rename unpack to kindMichael Goulet-1/+1
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-1/+12
async_drop_in_place::{closure}, scoped async drop added.
2025-03-30Encode synthetic by-move coroutine body with a different DefPathDataMichael Goulet-1/+4
2025-02-16Move hashes from rustc_data_structure to rustc_hashes so they can be shared ↵Ben Kimock-1/+2
with rust-analyzer
2025-01-30introduce `ty::Value`Lukas Markeffsky-3/+4
Co-authored-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
2025-01-14Fix legacy symbol mangling of closuresMichael Goulet-4/+4
2025-01-09Account for identity substituted items in symbol manglingMichael Goulet-18/+38
2025-01-06Use a post-monomorphization typing env when mangling components that come ↵Michael Goulet-8/+21
from impls
2024-12-10Try to evaluate constants in legacy manglingOli Scherer-1/+28
2024-08-26Stop using a special inner body for the coroutine by-move body for async ↵Michael Goulet-3/+0
closures
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+6
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-29Fix FnMut/Fn shim for coroutine-closures that capture referencesMichael Goulet-3/+7
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-7/+7
2024-06-05Add `Ty` to `ConstKind::Value`Boxy-9/+4
2024-06-05Basic removal of `Ty` from places (boring)Boxy-3/+8
2024-04-30Remove `extern crate tracing` from numerous crates.Nicholas Nethercote-1/+1
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-0/+1
2024-04-16Add simple async drop glue generationzetanumbers-1/+3
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2024-04-02Track reason for creating a `ReifyShim`Matthew Maurer-3/+9
KCFI needs to be able to tell which kind of `ReifyShim` it is examining in order to decide whether to use a concrete type (`FnPtr` case) or an abstract case (`Vtable` case). You can *almost* tell this from context, but there is one case where you can't - if a trait has a method which is *not* `#[track_caller]`, with an impl that *is* `#[track_caller]`, both the vtable and a function pointer created from that method will be `ReifyShim(def_id)`. Currently, the reason is optional to ensure no additional unique `ReifyShim`s are added without KCFI on. However, the case in which an extra `ReifyShim` is created is sufficiently rare that this may be worth revisiting to reduce complexity.
2024-03-19Only split by-ref/by-move futures for async closuresMichael Goulet-10/+4
2024-02-12Dejargnonize substShoyu Vanilla-1/+1
2024-02-06Fix drop shim for AsyncFnOnce closure, AsyncFnMut shim for AsyncFn closureMichael Goulet-10/+23
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-1/+6
2023-12-28Remove movability from TyKind::CoroutineMichael Goulet-1/+1
2023-12-19rename to verbose-internalsjyn-2/+2
2023-12-10Revert "Don't print host effect param in pretty path_generic_args"Deadbeef-1/+0
This reverts commit f1bf874fb13703d706fc8184407c6df12555d8e9.
2023-12-09Don't print host effect param in pretty path_generic_argsMichael Goulet-0/+1
2023-11-13Remove `-Zperf-stats`.Nicholas Nethercote-32/+29
The included measurements have varied over the years. At one point there were quite a few more, but #49558 deleted a lot that were no longer used. Today there's just four, and it's a motley collection that doesn't seem particularly valuable. I think it has been well and truly subsumed by self-profiling, which collects way more data.
2023-10-21Make `ty::print::Printer` take `&mut self` instead of `self`Nilstrieb-44/+44
This simplifies the code by removing all the `self` assignments and makes the flow of data clearer - always into the printer. Especially in v0 mangling, which already used `&mut self` in some places, it gets a lot more uniform.
2023-10-20s/Generator/Coroutine/Oli Scherer-2/+2
2023-10-17Remove `Print::Error`Nilstrieb-1/+1
All printing goes through `fmt::Error` now.
2023-10-17Remove `Printer::Error`Nilstrieb-19/+17
It's always a `fmt::Error` except in some cases where it was `!`, but we're not really winning anything in that case.
2023-10-17Remove `Print::Output`Nilstrieb-1/+1
Now that `Printer` doesn't have subprinters anymore, the output of a printing operation is always the same.
2023-10-17Remove "subprinter" types from `Printer`Nilstrieb-18/+12
These are `Self` in almost all printers except one, which can just store the state as a field instead. This simplifies the printer and allows for further simplifications, for example using `&mut self` instead of passing around the printer.
2023-09-13make the set of methods between our two Const types more consistentRalf Jung-1/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-10/+10
2023-07-05Deal with falloutBoxy-1/+1
2023-05-22properly pretty-print inherent projectionsLeón Orell Valerian Liehr-1/+3
2023-04-27rename `needs_subst` to `has_param`Boxy-1/+1