Skip to content

Commit 90a86a7

Browse files
Suppress must_use on eat calls in rustfmt
1 parent 163d26e commit 90a86a7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/parse/macros/lazy_static.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,17 @@ pub(crate) fn parse_lazy_static(
3333
}
3434
while parser.token.kind != TokenKind::Eof {
3535
// Parse a `lazy_static!` item.
36+
// FIXME: These `eat_*` calls should be converted to `parse_or` to avoid
37+
// silently formatting malformed lazy-statics.
3638
let vis = parse_or!(parse_visibility, rustc_parse::parser::FollowedByType::No);
37-
parser.eat_keyword(kw::Static);
38-
parser.eat_keyword(kw::Ref);
39+
let _ = parser.eat_keyword(kw::Static);
40+
let _ = parser.eat_keyword(kw::Ref);
3941
let id = parse_or!(parse_ident);
40-
parser.eat(&TokenKind::Colon);
42+
let _ = parser.eat(&TokenKind::Colon);
4143
let ty = parse_or!(parse_ty);
42-
parser.eat(&TokenKind::Eq);
44+
let _ = parser.eat(&TokenKind::Eq);
4345
let expr = parse_or!(parse_expr);
44-
parser.eat(&TokenKind::Semi);
46+
let _ = parser.eat(&TokenKind::Semi);
4547
result.push((vis, id, ty, expr));
4648
}
4749

0 commit comments

Comments
 (0)