Skip to content

Stabilize proc_macro Span::source_text #101991

Closed
@jam1garner

Description

In the interest of improving error/diagnostic quality for macros I'd like to try and get some of the proc_macro_span feature stabilized.

While some of these APIs don't seem to have consensus on their effect on IDE/language server support, the source_text API seems both well-tested and to have consensus that its result only being invalidated by edits to the contents of the macro makes it a non-issue for IDE support (as noted by niko in #54725).

API

impl Span {
    pub fn source_text(&self) -> Option<String>;
}

@rustbot label +T-libs-api +A-macros +A-proc-macros

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions