Skip to content

target_pointer_width in proc-macro crates provides build-time width, but some clients want runtime width #42587

Open
@liranringel

Description

@liranringel

I'm trying to add cross compilation (to compile 32bit) to my crate, and target_pointer_width is 64 in the proc-macro crate (like the host), and 32 in the root crate (like the target):

How can I get the real target_pointer_width in a proc-macro crate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions