Skip to content

Commit db9d376

Browse files
committed
Add documentation
1 parent 8fe6710 commit db9d376

File tree

1 file changed

+9
-0
lines changed
  • src/librustc_builtin_macros

1 file changed

+9
-0
lines changed

src/librustc_builtin_macros/asm.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ fn parse_args<'a>(
283283
Ok(args)
284284
}
285285

286+
/// Report a duplicate option error.
287+
///
288+
/// This function must be called immediately after the option token is parsed.
289+
/// Otherwise, the suggestion will be incorrect.
286290
fn err_duplicate_option<'a>(p: &mut Parser<'a>, symbol: Symbol, span: Span) {
287291
let mut err = p
288292
.sess
@@ -305,6 +309,11 @@ fn err_duplicate_option<'a>(p: &mut Parser<'a>, symbol: Symbol, span: Span) {
305309
err.emit();
306310
}
307311

312+
/// Try to set the provided option in the provided `AsmArgs`.
313+
/// If it is already set, report a duplicate option error.
314+
///
315+
/// This function must be called immediately after the option token is parsed.
316+
/// Otherwise, the error will not point to the correct spot.
308317
fn try_set_option<'a>(
309318
p: &mut Parser<'a>,
310319
args: &mut AsmArgs,

0 commit comments

Comments
 (0)