Skip to content

pub/async/doc comment parse error #52790

Description

@benbrittain

When the async and pub identifiers are swapped next to a doc comment:

/// Build the ControlImpl to interact with fidl messages
/// State is stored in the HostDispatcher object
async pub fn make_control_service(hd: Arc<RwLock<HostDispatcher>>, chan: fasync::Channel) -> impl Future<Item = (), Error = Never> {

a confusing error is returned:

error: expected item after doc comment
  --> src/control_service.rs:23:1
   |
23 | /// State is stored in the HostDispatcher object
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

instead of making it clear pub should be first

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-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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