From 2279907fd268b6e800c8e586f247f806003e81f5 Mon Sep 17 00:00:00 2001 From: varkor Date: Fri, 15 Feb 2019 22:26:29 +0000 Subject: [PATCH] Take Const into account with nonstandard style lint Co-Authored-By: Gabriel Smith --- src/librustc_lint/nonstandard_style.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/librustc_lint/nonstandard_style.rs b/src/librustc_lint/nonstandard_style.rs index c2dd9a3d1b84..ee5e715161ad 100644 --- a/src/librustc_lint/nonstandard_style.rs +++ b/src/librustc_lint/nonstandard_style.rs @@ -455,6 +455,16 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonUpperCaseGlobals { } } } + + fn check_generic_param(&mut self, cx: &LateContext, param: &hir::GenericParam) { + if let GenericParamKind::Const { .. } = param.kind { + NonUpperCaseGlobals::check_upper_case( + cx, + "const parameter", + ¶m.name.ident(), + ); + } + } } #[cfg(test)]