Skip to content

Align definition export names with resolved call target names #184

Closed

Description

@niklebedenko

Problem

Definition-side export names and call-side names can diverge because they choose between raw FQDNs and rustc mangled names using different facts. Concrete trait impl and concrete inherent impl calls are especially sensitive: the raw FnDef operand can differ from the resolved monomorphic instance that the collector exports.

Why this matters

A device call that names one symbol while the collector exports another produces unresolved calls or duplicate symbol policy bugs. Naming must be a single rule shared by collection and MIR call lowering.

Expected behavior

Both paths should use the resolved rustc instance as the authority. Generic resolved instances should use rustc's mangled symbol name. Non-generic resolved instances should keep the raw resolved FQDN and rely on the shared legalizer to produce the final LLVM/PTX identifier.

Acceptance criteria

  • Call-side naming resolves FnDef operands before deciding FQDN versus mangled name.
  • Definition-side naming uses the same resolved-instance rule.
  • Invalid FQDN characters alone do not force mangling.
  • Foreign items keep using their external link symbols.
  • A focused example covers concrete trait impl and concrete inherent impl calls.

Activity

  1. added
    codegen
    bug
    on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcodegen

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions