allow host param to be lowercase

This commit is contained in:
Deadbeef 2023-06-30 15:50:48 +00:00
parent 8eb3e0bf30
commit 0b095a60d2

View File

@ -533,6 +533,10 @@ fn check_pat(&mut self, cx: &LateContext<'_>, p: &hir::Pat<'_>) {
fn check_generic_param(&mut self, cx: &LateContext<'_>, param: &hir::GenericParam<'_>) { fn check_generic_param(&mut self, cx: &LateContext<'_>, param: &hir::GenericParam<'_>) {
if let GenericParamKind::Const { .. } = param.kind { if let GenericParamKind::Const { .. } = param.kind {
// `rustc_host` params are explicitly allowed to be lowercase.
if cx.tcx.has_attr(param.def_id, sym::rustc_host) {
return;
}
NonUpperCaseGlobals::check_upper_case(cx, "const parameter", &param.name.ident()); NonUpperCaseGlobals::check_upper_case(cx, "const parameter", &param.name.ident());
} }
} }