Skip to content

#[track_caller] should inherit through specialization ancestors, too? #70293

Description

@anp

The current implementation of #[track_caller] allows trait methods to have the annotation, including at their definition site. When applied in a trait definition, the attribute has effect on all impls. @eddyb raised the question in code review of whether you should also be able to add the attribute without adding an implementation as part of a specialization chain.

To me this seems like the correct semantics given what we'd like the non-specialized behavior to be. It's probably a little complicated to implement.

Activity

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

    A-specializationArea: Trait impl specializationF-specialization`#![feature(specialization)]`F-track_caller`#![feature(track_caller)]`T-compilerRelevant to the compiler team, 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