- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.9k
 
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Description
If I use document comment that doesn't document anything in function,
fn test(){
    println!("Hello world");
    ///
}it will raise error:
error[E0585]: found a documentation comment that doesn't document anything.
But if I use this in trait, the error confuses me.
trait User{
    fn test();
    ///
}
fn main() {
    println!("Hello world");
}error: expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe`, found `}`
 --> src/main.rs:4:1
  |
3 |     ///
  |        - expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe` here
4 | }
  | ^ unexpected token
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.