Skip to content

Do not convert doc comments into #[doc = "..."] form unless necessary for macros #60935

Closed
@petrochenkov

Description

@petrochenkov

Keep them as tokens in AST, this may partially mitigate the perf impact from turning normal comments into doc comments (#60930).

pub struct Attribute {
    pub id: AttrId,
    pub style: AttrStyle,
    pub path: Path,
    pub tokens: TokenStream,
    pub is_sugared_doc: bool,
    pub span: Span,
}

=>

pub struct Attribute {
    pub kind: AttrKind,
    pub span: Span,
    pub id: AttrId,
}

pub enum AttrKind {
    Normal(Path, TokenStream, AttrStyle),
    Doc(Symbol),
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.I-compiletimeIssue: Problems and improvements with respect to compile times.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