Limit style lint to non-synthetic generic params

This commit is contained in:
Taylor Cramer 2018-01-02 09:08:49 -08:00
parent a37126b90c
commit b86a65d39b
2 changed files with 23 additions and 1 deletions

View file

@ -128,7 +128,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCamelCaseTypes {
fn check_generic_param(&mut self, cx: &LateContext, param: &hir::GenericParam) {
if let hir::GenericParam::Type(ref gen) = *param {
self.check_case(cx, "type parameter", gen.name, gen.span);
if gen.synthetic.is_none() {
self.check_case(cx, "type parameter", gen.name, gen.span);
}
}
}
}

View file

@ -0,0 +1,20 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
#![feature(conservative_impl_trait)]
#![deny(non_camel_case_types)]
#[allow(dead_code)]
fn qqq(lol: impl Iterator<Item=u32>) -> impl Iterator<Item=u64> {
lol.map(|x|x as u64)
}
fn main() {}