Refactor take_for_recovery
call sites.
To make them more concise and similar to each other.
This commit is contained in:
parent
62b4e55112
commit
a8a486c846
2 changed files with 14 additions and 18 deletions
|
@ -230,8 +230,7 @@ impl<'a> Parser<'a> {
|
|||
/// Also error if the previous token was a doc comment.
|
||||
fn error_outer_attrs(&self, attrs: AttrWrapper) {
|
||||
if !attrs.is_empty()
|
||||
&& let attrs = attrs.take_for_recovery(self.sess)
|
||||
&& let attrs @ [.., last] = &*attrs
|
||||
&& let attrs @ [.., last] = &*attrs.take_for_recovery(self.sess)
|
||||
{
|
||||
if last.is_doc_comment() {
|
||||
self.dcx().emit_err(errors::DocCommentDoesNotDocumentAnything {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue