Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustc should warn, not fail on bad doc comments #18444

Closed
Manishearth opened this issue Oct 30, 2014 · 2 comments
Closed

Rustc should warn, not fail on bad doc comments #18444

Manishearth opened this issue Oct 30, 2014 · 2 comments

Comments

@Manishearth
Copy link
Member

source

The following MWE fails to compile with error: expected item after doc comment

fn main(){
}

/// Hi

this one fails to compile with a generic unexpected token: /// some input

fn main(){

}

fn foo(
  /// some input
  x: u8
  ) {

}

Comments should be ignored by the compiler, even doc comments. It makes sense to sanity-check comments during compilation, but can this be a warning instead of an error? In general, the /// token should be treated as a comment after perhaps linting for doc comment correctness.

@lifthrasiir
Copy link
Contributor

Related to #2789.

@steveklabnik
Copy link
Member

This is a language semantic and so would need an RFC to change. Please persue one if you still feel strongly abou tthis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants