Change:
I had this code: The actual error of course here, would be that there is a missing comma after the . However the error message given by the compiler was: error: expected , or , found -- | 16 | #[doc = "The id of the parent core"] | ^ | = help: struct fields should be separated by commas This isn't a particularly important issue, but as mentioned by someone I spoke to regarding this error, the error messages given by the compiler are usually very helpful, and I feel it is worth maintaining this standard.
to fix this, should emit the error for a useless doc comment and a missing comma / brace if it encounters both - right now doc comment errors override missing seperators completely. attributes work fine because they are not parsed as a single doc comment token.
Can I take this one if nobody is working on that?
go ahead! Feel free to ask for help if you need. If this is your first contribution, take a look at for setting up the environment.
, Now console output is coming like this Now I have three quick questions for you. 1) In the case when a is missing for middle fields of , should we avoid showing warning, because we have not parsed below fields yet? 2) Should I consider creating a new entry in enum to handle warning? 3) If we have decided to show both and warning, how important it is to show missing warning before warning?
I would elide the missing comma error. Create a PR with in its body so that I'm assigned as reviewer and we can discuss in the context of the code. It seems like you're in the right path. Depending on how the code is laid out, you might be able to try to consume a without failing if it isn't there depending on the success or failure of the previous field.
PR raised

Discussion:
vis: Visibility, attrs: Vec<Attribute> ) -> PResult<'a, StructField> { <ins> let mut seen_comma: bool = false; </ins> let a_var = self.parse_name_and_ty(lo, vis, attrs)?; <ins> if self.token == token::Comma { seen_comma = true; } </ins> match self.token { token::Comma => { self.bump(); } token::CloseDelim(token::Brace) => {} token::DocComment(_) => { <ins> let previous_span = self.prev_span; </ins> let mut err = self.span_fatal_err(self.span, Error::UselessDocComment); self.bump(); // consume the doc comment <del> if self.eat(&token::Comma) || self.token == token::CloseDelim(token::Brace) { </del> <ins> let comma_after_doc_seen = self.eat(&token::Comma); // `seen_comma` is always false, because we are inside doc block // condition is here to make code more readable if seen_comma == false && comma_after_doc_seen == true { seen_comma = true; } if comma_after_doc_seen || self.token == token::CloseDelim(token::Brace) { </ins> err.emit(); } else { <ins> if seen_comma == false { let sp = self.sess.codemap().next_point(previous_span); err.span_suggestion(sp, "missing comma here", ",".into()); } </ins> return Err(err); } }

<ins> // Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct S { x: u8 /// The id of the parent core y: u8, } //~^^^ ERROR found a documentation comment that doesn't document anything fn main() {} </ins>

<ins> error[E0585]: found a documentation comment that doesn't document anything --> $DIR/issue-48636.rs:13:5 | LL |     x: u8 |          - help: missing comma here: `,` LL |     /// The id of the parent core |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: doc comments must come before what they document, maybe a comment was intended with `//`? error: aborting due to previous error For more information about this error, try `rustc --explain E0585`. </ins>