Skip to content

Commit bebf3f0

Browse files
committed
Support trailing comma in add_lint_group!
1 parent a165d5a commit bebf3f0

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

compiler/rustc_lint/src/lib.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ pub fn new_lint_store(internal_lints: bool) -> LintStore {
253253
/// `rustc_session::lint::builtin`).
254254
fn register_builtins(store: &mut LintStore) {
255255
macro_rules! add_lint_group {
256-
($name:expr, $($lint:ident),*) => (
256+
($name:expr, $($lint:ident),* $(,)?) => (
257257
store.register_group(false, $name, None, vec![$(LintId::of($lint)),*]);
258258
)
259259
}
@@ -267,7 +267,7 @@ fn register_builtins(store: &mut LintStore) {
267267
"nonstandard_style",
268268
NON_CAMEL_CASE_TYPES,
269269
NON_SNAKE_CASE,
270-
NON_UPPER_CASE_GLOBALS
270+
NON_UPPER_CASE_GLOBALS,
271271
);
272272

273273
add_lint_group!(
@@ -293,7 +293,7 @@ fn register_builtins(store: &mut LintStore) {
293293
UNUSED_PARENS,
294294
UNUSED_BRACES,
295295
REDUNDANT_SEMICOLONS,
296-
MAP_UNIT_FN
296+
MAP_UNIT_FN,
297297
);
298298

299299
add_lint_group!("let_underscore", LET_UNDERSCORE_DROP, LET_UNDERSCORE_LOCK);
@@ -304,13 +304,13 @@ fn register_builtins(store: &mut LintStore) {
304304
UNUSED_EXTERN_CRATES,
305305
ELLIPSIS_INCLUSIVE_RANGE_PATTERNS,
306306
ELIDED_LIFETIMES_IN_PATHS,
307-
EXPLICIT_OUTLIVES_REQUIREMENTS // FIXME(#52665, #47816) not always applicable and not all
308-
// macros are ready for this yet.
309-
// UNREACHABLE_PUB,
310-
311-
// FIXME macro crates are not up for this yet, too much
312-
// breakage is seen if we try to encourage this lint.
313-
// MACRO_USE_EXTERN_CRATE
307+
EXPLICIT_OUTLIVES_REQUIREMENTS,
308+
// FIXME(#52665, #47816) not always applicable and not all
309+
// macros are ready for this yet.
310+
// UNREACHABLE_PUB,
311+
// FIXME macro crates are not up for this yet, too much
312+
// breakage is seen if we try to encourage this lint.
313+
// MACRO_USE_EXTERN_CRATE
314314
);
315315

316316
// Register renamed and removed lints.

0 commit comments

Comments
 (0)