diff options
Diffstat (limited to 'compiler/rustc_parse/src/parser/item.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 93f5d79c0db..20ca8a99ab7 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -439,9 +439,8 @@ impl<'a> Parser<'a> { /// Recover if we parsed attributes and expected an item but there was none. fn recover_attrs_no_item(&mut self, attrs: &[Attribute]) -> PResult<'a, ()> { - let (start, end) = match attrs { - [] => return Ok(()), - [x0 @ xn] | [x0, .., xn] => (x0, xn), + let ([start @ end] | [start, .., end]) = attrs else { + return Ok(()); }; let msg = if end.is_doc_comment() { "expected item after doc comment" |
