Skip to content

Commit 0b095a6

Browse files
committed
allow host param to be lowercase
1 parent 8eb3e0b commit 0b095a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_lint/src/nonstandard_style.rs

+4
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ impl<'tcx> LateLintPass<'tcx> for NonUpperCaseGlobals {
533533

534534
fn check_generic_param(&mut self, cx: &LateContext<'_>, param: &hir::GenericParam<'_>) {
535535
if let GenericParamKind::Const { .. } = param.kind {
536+
// `rustc_host` params are explicitly allowed to be lowercase.
537+
if cx.tcx.has_attr(param.def_id, sym::rustc_host) {
538+
return;
539+
}
536540
NonUpperCaseGlobals::check_upper_case(cx, "const parameter", &param.name.ident());
537541
}
538542
}

0 commit comments

Comments
 (0)