about summary refs log tree commit diff
path: root/compiler/rustc_symbol_mangling/src
AgeCommit message (Collapse)AuthorLines
2025-10-02Auto merge of #147138 - jackh726:split-canonical-bound, r=lcnrbors-1/+4
Split Bound index into Canonical and Bound See [#t-types/trait-system-refactor > perf `async-closures/post-mono-higher-ranked-hang.rs`](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run. r? lcnr
2025-09-30Split Bound into Canonical and Boundjackh726-1/+4
2025-09-23Add proper name mangling for pattern typesOli Scherer-8/+6
2025-09-17Remove `DynKind`León Orell Valerian Liehr-5/+3
2025-09-09Add assertionBoxy-1/+1
2025-09-09erase_regions to erase_and_anonymize_regionsBoxy-4/+10
2025-09-05Add __isOSVersionAtLeast and __isPlatformVersionAtLeast symbolsMads Marquart-2/+6
Allows users to link to Objective-C code using `@available(...)`.
2025-08-19Rollup merge of #145429 - bjorn3:codegen_fn_attrs_improvements, r=jdonszelmann许杰友 Jieyou Xu (Joe)-33/+17
Couple of codegen_fn_attrs improvements As noted in https://github.com/rust-lang/rust/pull/144678#discussion_r2245060329 here is no need to keep link_name and export_name separate, which the third commit fixes by merging them. The second commit removes some dead code and the first commit merges two ifs with equivalent conditions. The last commit is an unrelated change which removes an unused `feature(autodiff)`.
2025-08-15Merge link_name and export_namebjorn3-22/+11
2025-08-15Combining no_mangle and rustc_std_internal_symbol is not allowedbjorn3-11/+6
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-29/+32
More `Printer` cleanups A sequel to rust-lang/rust#144776. r? ```@davidtwco```
2025-08-12make no_mangle explicit on foreign itemsJana Dönszelmann-26/+29
2025-08-09remove some unused private trait implsDeadbeef-8/+1
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-15/+18
I find these name clearer, and starting them all with `print_` makes things more consistent.
2025-08-05Rename most of the printers.Nicholas Nethercote-11/+11
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-2/+0
None of the impls use it.
2025-08-03Simplify `SymbolMangler::print_type`.Nicholas Nethercote-7/+4
`Bound`/`Placeholder`/`Infer`/`Error` shouldn't occur, so we can handle them in the second exhaustive `match`, and ignore them in the first non-exhaustive `match`.
2025-08-03Rename `Printer` variables.Nicholas Nethercote-68/+66
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-07-16use `codegen_instance_attrs` where an instance is (easily) availableFolkert de Vries-1/+1
2025-07-01Remove support for dyn*Michael Goulet-2/+0
2025-06-16Change __rust_no_alloc_shim_is_unstable to be a functionDaniel Paoliello-4/+0
2025-05-27Rename unpack to kindMichael Goulet-6/+6
2025-05-22Rename `kw::Empty` as `sym::empty`.Nicholas Nethercote-2/+2
Because the empty string is not a keyword.
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-05-07Add `DefPathData::OpaqueLifetime` to avoid conflicts for remapped opaque ↵John Kåre Alsaker-0/+1
lifetimes
2025-05-05Rollup merge of #140374 - compiler-errors:global_asm-bug, r=lcnrGuillaume Gomez-1/+1
Resolve instance for SymFn in global/naked asm `Instance::expect_resolve` ensures that we're actually going from trait item -> impl item. Fixes #140373
2025-05-05Rename Instance::new to Instance::new_raw and add a note that it is rawMichael Goulet-1/+1
2025-05-05Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obkbors-1/+2
Remove global `next_disambiguator` state and handle it with a `DisambiguatorState` type This removes `Definitions.next_disambiguator` as it doesn't guarantee deterministic def paths when `create_def` is called in parallel. Instead a new `DisambiguatorState` type is passed as a mutable reference to `create_def` to help create unique def paths. `create_def` calls with distinct `DisambiguatorState` instances must ensure that that the def paths are unique without its help. Anon associated types did rely on this global state for uniqueness and are changed to use (method they're defined in + their position in the method return type) as the `DefPathData` to ensure uniqueness. This also means that the method they're defined in appears in error messages, which is nicer. `DefPathData::NestedStatic` is added to use for nested data inside statics instead of reusing `DefPathData::AnonConst` to avoid conflicts with those. cc `@oli-obk`
2025-05-04Initial support for dynamically linked cratesBryanskiy-9/+215
2025-05-02Add `DefPathData::NestedStatic` instead of reusing `DefPathData::AnonConst`John Kåre Alsaker-0/+1
2025-04-29Rollup merge of #139909 - oli-obk:or-patterns, r=BoxyUwUTrevor Gross-14/+24
implement or-patterns for pattern types These are necessary to represent `NonZeroI32`, as the range for that is `..0 | 1..`. The `rustc_scalar_layout_range_*` attributes avoided this by just implementing wraparound and having a single `1..=-1` range effectively. See https://rust-lang.zulipchat.com/#narrow/channel/481660-t-lang.2Fpattern-types/topic/.60or.20pattern.60.20representation.20in.20type.20system/with/504217694 for some background discussion cc https://github.com/rust-lang/rust/issues/123646 r? `@BoxyUwU`
2025-04-29Remove global `next_disambiguator` state and handle it with a ↵John Kåre Alsaker-1/+1
`DisambiguatorState` type
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-3/+20
async_drop_in_place::{closure}, scoped async drop added.
2025-04-28Add or-patterns to pattern typesOli Scherer-0/+5
2025-04-28Split out various pattern type matches into their own functionOli Scherer-14/+19
2025-04-23Make #![feature(let_chains)] bootstrap conditional in compiler/est31-1/+1
2025-04-15Rollup merge of #139848 - nnethercote:kw-Empty-5, r=compiler-errorsMatthias Krüger-1/+1
Reduce kw::Empty usage, part 5 Another step towards https://github.com/rust-lang/rust/issues/137978. r? `@davidtwco`
2025-04-15Remove a `kw::Empty` usage in symbol mangling.Nicholas Nethercote-1/+1
Field names are never empty, so the unwrap is unnecessary.
2025-04-15Rollup merge of #139669 - nnethercote:overhaul-AssocItem, r=oli-obkStuart Cook-1/+1
Overhaul `AssocItem` `AssocItem` has multiple fields that only make sense some of the time. E.g. the `name` can be empty if it's an RPITIT associated type. It's clearer and less error prone if these fields are moved to the relevant `kind` variants. r? ``@fee1-dead``
2025-04-15Move `name` field from `AssocItem` to `AssocKind` variants.Nicholas Nethercote-1/+1
To accurately reflect that RPITIT assoc items don't have a name. This avoids the use of `kw::Empty` to mean "no name", which is error prone. Helps with #137978.
2025-04-14Auto merge of #124141 - ↵bors-1/+0
nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov Remove `Nonterminal` and `TokenKind::Interpolated` A third attempt at this; the first attempt was #96724 and the second was #114647. r? `@ghost`
2025-04-11Introduce `DefPathData::AnonAssocTy`.Nicholas Nethercote-1/+2
PR #137977 changed `DefPathData::TypeNs` to contain `Option<Symbol>` to account for RPITIT assoc types being anonymous. This commit changes it back to `Symbol` and gives anonymous assoc types their own variant. It makes things a bit nicer overall.
2025-04-08clean code: remove Deref<Target=RegionKind> impl for Region and use `.kind()`xizheyin-1/+1
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-04-02Remove `recursion_limit` increases.Nicholas Nethercote-1/+0
These are no longer needed now that `Nonterminal` is gone.
2025-03-30Encode synthetic by-move coroutine body with a different DefPathDataMichael Goulet-1/+5