Skip to content

Do not parse a line with only /s as a doc comment #4887

Closed
@lifthrasiir

Description

@lifthrasiir

A line filled with only /s is occasionally used as a separator in the code. Rust currently parses it as a doc comment which causes unwanted headaches, as shown below:

////////////////////////////////////////
// common macros

macro_rules! foo( ... ) // error: macro_rules! do not support #[doc = ...]
macro_rules! bar( ... )

While such separators should be avoided in favor of the module system, it is still useful for logically splitting large functions for instance. Also related to #4106.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The lexing & parsing of Rust source code to an ASTE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions