Suppress must_use on eat calls in rustfmt

This commit is contained in:
Michael Goulet 2024-07-30 10:10:36 -04:00
parent e4076e34f8
commit 4776ac0f88

View File

@ -33,15 +33,17 @@ macro_rules! parse_or {
} }
while parser.token.kind != TokenKind::Eof { while parser.token.kind != TokenKind::Eof {
// Parse a `lazy_static!` item. // Parse a `lazy_static!` item.
// FIXME: These `eat_*` calls should be converted to `parse_or` to avoid
// silently formatting malformed lazy-statics.
let vis = parse_or!(parse_visibility, rustc_parse::parser::FollowedByType::No); let vis = parse_or!(parse_visibility, rustc_parse::parser::FollowedByType::No);
parser.eat_keyword(kw::Static); let _ = parser.eat_keyword(kw::Static);
parser.eat_keyword(kw::Ref); let _ = parser.eat_keyword(kw::Ref);
let id = parse_or!(parse_ident); let id = parse_or!(parse_ident);
parser.eat(&TokenKind::Colon); let _ = parser.eat(&TokenKind::Colon);
let ty = parse_or!(parse_ty); let ty = parse_or!(parse_ty);
parser.eat(&TokenKind::Eq); let _ = parser.eat(&TokenKind::Eq);
let expr = parse_or!(parse_expr); let expr = parse_or!(parse_expr);
parser.eat(&TokenKind::Semi); let _ = parser.eat(&TokenKind::Semi);
result.push((vis, id, ty, expr)); result.push((vis, id, ty, expr));
} }