Skip to content

Commit b2afa10

Browse files
committed
Support trailing comma in add_lint_group!
1 parent 552a959 commit b2afa10

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
@@ -266,7 +266,7 @@ pub fn new_lint_store(internal_lints: bool) -> LintStore {
266266
/// `rustc_session::lint::builtin`).
267267
fn register_builtins(store: &mut LintStore) {
268268
macro_rules! add_lint_group {
269-
($name:expr, $($lint:ident),*) => (
269+
($name:expr, $($lint:ident),* $(,)?) => (
270270
store.register_group(false, $name, None, vec![$(LintId::of($lint)),*]);
271271
)
272272
}
@@ -281,7 +281,7 @@ fn register_builtins(store: &mut LintStore) {
281281
"nonstandard_style",
282282
NON_CAMEL_CASE_TYPES,
283283
NON_SNAKE_CASE,
284-
NON_UPPER_CASE_GLOBALS
284+
NON_UPPER_CASE_GLOBALS,
285285
);
286286

287287
add_lint_group!(
@@ -307,7 +307,7 @@ fn register_builtins(store: &mut LintStore) {
307307
UNUSED_PARENS,
308308
UNUSED_BRACES,
309309
REDUNDANT_SEMICOLONS,
310-
MAP_UNIT_FN
310+
MAP_UNIT_FN,
311311
);
312312

313313
add_lint_group!("let_underscore", LET_UNDERSCORE_DROP, LET_UNDERSCORE_LOCK);
@@ -318,13 +318,13 @@ fn register_builtins(store: &mut LintStore) {
318318
UNUSED_EXTERN_CRATES,
319319
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS,
320320
ELIDED_LIFETIMES_IN_PATHS,
321-
EXPLICIT_OUTLIVES_REQUIREMENTS // FIXME(#52665, #47816) not always applicable and not all
322-
// macros are ready for this yet.
323-
// UNREACHABLE_PUB,
324-
325-
// FIXME macro crates are not up for this yet, too much
326-
// breakage is seen if we try to encourage this lint.
327-
// MACRO_USE_EXTERN_CRATE
321+
EXPLICIT_OUTLIVES_REQUIREMENTS,
322+
// FIXME(#52665, #47816) not always applicable and not all
323+
// macros are ready for this yet.
324+
// UNREACHABLE_PUB,
325+
// FIXME macro crates are not up for this yet, too much
326+
// breakage is seen if we try to encourage this lint.
327+
// MACRO_USE_EXTERN_CRATE
328328
);
329329

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

0 commit comments

Comments
 (0)