Skip to content

Commit 79aae68

Browse files
committed
Support trailing comma in add_lint_group!
1 parent e2a018e commit 79aae68

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

compiler/rustc_lint/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ pub fn new_lint_store(internal_lints: bool) -> LintStore {
269269
/// `rustc_session::lint::builtin`).
270270
fn register_builtins(store: &mut LintStore) {
271271
macro_rules! add_lint_group {
272-
($name:expr, $($lint:ident),*) => (
272+
($name:expr, $($lint:ident),* $(,)?) => (
273273
store.register_group(false, $name, None, vec![$(LintId::of($lint)),*]);
274274
)
275275
}
@@ -284,7 +284,7 @@ fn register_builtins(store: &mut LintStore) {
284284
"nonstandard_style",
285285
NON_CAMEL_CASE_TYPES,
286286
NON_SNAKE_CASE,
287-
NON_UPPER_CASE_GLOBALS
287+
NON_UPPER_CASE_GLOBALS,
288288
);
289289

290290
add_lint_group!(
@@ -310,7 +310,7 @@ fn register_builtins(store: &mut LintStore) {
310310
UNUSED_PARENS,
311311
UNUSED_BRACES,
312312
REDUNDANT_SEMICOLONS,
313-
MAP_UNIT_FN
313+
MAP_UNIT_FN,
314314
);
315315

316316
add_lint_group!("let_underscore", LET_UNDERSCORE_DROP, LET_UNDERSCORE_LOCK);
@@ -321,13 +321,13 @@ fn register_builtins(store: &mut LintStore) {
321321
UNUSED_EXTERN_CRATES,
322322
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS,
323323
ELIDED_LIFETIMES_IN_PATHS,
324-
EXPLICIT_OUTLIVES_REQUIREMENTS // FIXME(#52665, #47816) not always applicable and not all
325-
// macros are ready for this yet.
326-
// UNREACHABLE_PUB,
327-
328-
// FIXME macro crates are not up for this yet, too much
329-
// breakage is seen if we try to encourage this lint.
330-
// MACRO_USE_EXTERN_CRATE
324+
EXPLICIT_OUTLIVES_REQUIREMENTS,
325+
// FIXME(#52665, #47816) not always applicable and not all
326+
// macros are ready for this yet.
327+
// UNREACHABLE_PUB,
328+
// FIXME macro crates are not up for this yet, too much
329+
// breakage is seen if we try to encourage this lint.
330+
// MACRO_USE_EXTERN_CRATE
331331
);
332332

333333
add_lint_group!("keyword_idents", KEYWORD_IDENTS_2018, KEYWORD_IDENTS_2024);

0 commit comments

Comments
 (0)