Skip to content

Commit 0a2c8b2

Browse files
Apply suggestions from code review
Co-authored-by: Travis Cross <[email protected]>
1 parent d30124a commit 0a2c8b2

File tree

1 file changed

+11
-9
lines changed
  • compiler/rustc_builtin_macros/src

1 file changed

+11
-9
lines changed

compiler/rustc_builtin_macros/src/asm.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ fn parse_asm_operand<'a>(
144144
}))
145145
}
146146

147-
// Public for rustfmt
147+
// Public for rustfmt.
148148
pub fn parse_raw_asm_args<'a>(
149149
p: &mut Parser<'a>,
150150
sp: Span,
@@ -176,13 +176,15 @@ pub fn parse_raw_asm_args<'a>(
176176
return Err(p.expect(exp!(Comma)).err().unwrap());
177177
}
178178
}
179+
180+
// Accept trailing commas.
179181
if p.token == token::Eof {
180182
break;
181-
} // accept trailing commas
183+
}
182184

183185
let span_start = p.token.span;
184186

185-
// Parse clobber_abi
187+
// Parse `clobber_abi`.
186188
if p.eat_keyword(exp!(ClobberAbi)) {
187189
allow_templates = false;
188190

@@ -194,7 +196,7 @@ pub fn parse_raw_asm_args<'a>(
194196
continue;
195197
}
196198

197-
// Parse options
199+
// Parse `options`.
198200
if p.eat_keyword(exp!(Options)) {
199201
allow_templates = false;
200202

@@ -206,7 +208,7 @@ pub fn parse_raw_asm_args<'a>(
206208
continue;
207209
}
208210

209-
// Parse operand names
211+
// Parse operand names.
210212
let name = if p.token.is_ident() && p.look_ahead(1, |t| *t == token::Eq) {
211213
let (ident, _) = p.token.ident().unwrap();
212214
p.bump();
@@ -347,7 +349,7 @@ fn validate_raw_asm_args<'a>(
347349
if !asm_macro.is_supported_option(option) {
348350
// Currently handled during parsing.
349351
} else if args.options.contains(option) {
350-
// Tool-only output
352+
// Tool-only output.
351353
dcx.emit_err(errors::AsmOptAlreadyprovided { span, symbol, full_span });
352354
} else {
353355
args.options |= option;
@@ -360,7 +362,7 @@ fn validate_raw_asm_args<'a>(
360362
allow_templates = false;
361363

362364
match &new_abis[..] {
363-
// should have errored above during parsing
365+
// This should have errored above during parsing.
364366
[] => unreachable!(),
365367
[(abi, _span)] => args.clobber_abis.push((*abi, arg.span)),
366368
_ => args.clobber_abis.extend(new_abis),
@@ -492,7 +494,7 @@ fn parse_options<'a>(
492494

493495
// NOTE: should this be handled during validation instead?
494496
if !asm_macro.is_supported_option(option) {
495-
// Tool-only output
497+
// Tool-only output.
496498
p.dcx().emit_err(errors::AsmUnsupportedOption {
497499
span,
498500
symbol: exp.kw,
@@ -509,7 +511,7 @@ fn parse_options<'a>(
509511
return p.unexpected_any();
510512
}
511513

512-
// Allow trailing commas
514+
// Allow trailing commas.
513515
if p.eat(exp!(CloseParen)) {
514516
break;
515517
}

0 commit comments

Comments
 (0)