Skip to content

Add intrinsic to force-monomorphize; or some other solution for Index #34528

@Manishearth

Description

@Manishearth

For gdb to be able to index things like hashmaps, we need to ensure that the index implementation is monomorphized correctly.

I would like to have an intrinsic, which when found in a monomorphized function, will force monomorphization of the provided argument. For example, in Vec::new(), we can include force_monomorphization(<Vec<T> as Index>::index).

Alternatively, we could specially mark methods (index and deref? all of std::ops? has to be parametric over self but not parametric over other non-Self args.) that are always monomorphized if the corresponding concrete self type already exists. Perhaps only in debug mode. This may bloat binary size, but eh, debug mode.

cc @rust-lang/compiler @tromey

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intrinsicsArea: IntrinsicsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions