Skip to content

Mitigate binary size impact of implicit caller location #70580

Closed
@anp

Description

Once we've measured the size impact of implicit caller location, we need to decide what (if any) knobs to offer users to mitigate that impact.

The RFC originally proposed a -Zlocation-detail-control flag for rustc which would allow users to control which fields of Location were preserved.

On the tracking issue I also proposed an all-or-nothing flag like -Zredact-caller-location which would either preserve Locations or rewrite them all to be the same.

Note that both of these options are limited to controlling the locations reported by user code -- unless a user recompiles std with whatever flag we offer, there will always be "unredacted" locations in their binary.

I'm fond of ideas that would allow us to replace Locations with something smaller that can be "symbolized" similarly to the way a debugger for an embedded device can identify the source location for a program counter value in a stacktrace. I think most options in this direction require help from the linker that isn't available, but I'd love to be wrong.

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.F-track_caller`#![feature(track_caller)]`I-heavyIssue: Problems and improvements with respect to binary size of generated code.T-compilerRelevant to the compiler team, 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