Skip to content

Change handling of doc comments to warn when mis-parsed, not error. #2789

Description

@brson

Now that we've implemented doc comments as attributes I am doubtful that it was the correct thing to do. There are a lot of positions where attributes aren't valid and now the parser rejects things like:

let x = y; //// xy

I was planning putting some smarts into the lexer to detect four slashes and not consider those doc attributes, but then patrick checked in some code like ///< comment which was rejected.

Comments not being treated as whitespace is weird.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions