Skip to content

Commit 89a3a44

Browse files
committed
mbe: macro_check: Fix function comments referencing non-existent parameters
Several functions had comments referencing a non-existent `valid` parameter. Remove those. The `guar` parameter that handles errors is already documented. In the process, remove another duplicate reference to an already-documented parameter (`binders`).
1 parent 7cfd7d3 commit 89a3a44

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

compiler/rustc_expand/src/mbe/macro_check.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ pub(super) fn check_meta_variables(
210210
guar.map_or(Ok(()), Err)
211211
}
212212

213-
/// Checks `lhs` as part of the LHS of a macro definition, extends `binders` with new binders, and
214-
/// sets `valid` to false in case of errors.
213+
/// Checks `lhs` as part of the LHS of a macro definition.
215214
///
216215
/// Arguments:
217216
/// - `psess` is used to emit diagnostics and lints
@@ -306,8 +305,7 @@ fn get_binder_info<'a>(
306305
binders.get(&name).or_else(|| macros.find_map(|state| state.binders.get(&name)))
307306
}
308307

309-
/// Checks `rhs` as part of the RHS of a macro definition and sets `valid` to false in case of
310-
/// errors.
308+
/// Checks `rhs` as part of the RHS of a macro definition.
311309
///
312310
/// Arguments:
313311
/// - `psess` is used to emit diagnostics and lints
@@ -372,7 +370,7 @@ enum NestedMacroState {
372370
}
373371

374372
/// Checks `tts` as part of the RHS of a macro definition, tries to recognize nested macro
375-
/// definitions, and sets `valid` to false in case of errors.
373+
/// definitions.
376374
///
377375
/// Arguments:
378376
/// - `psess` is used to emit diagnostics and lints
@@ -491,8 +489,7 @@ fn check_nested_occurrences(
491489
}
492490
}
493491

494-
/// Checks the body of nested macro, returns where the check stopped, and sets `valid` to false in
495-
/// case of errors.
492+
/// Checks the body of nested macro, returns where the check stopped.
496493
///
497494
/// The token trees are checked as long as they look like a list of (LHS) => {RHS} token trees. This
498495
/// check is a best-effort to detect a macro definition. It returns the position in `tts` where we

0 commit comments

Comments
 (0)