diff --git a/src/librustc/metadata/tydecode.rs b/src/librustc/metadata/tydecode.rs index b76743fc468f8..89b30e46ac06d 100644 --- a/src/librustc/metadata/tydecode.rs +++ b/src/librustc/metadata/tydecode.rs @@ -186,7 +186,7 @@ fn parse_trait_store(st: &mut PState) -> ty::TraitStore { } fn parse_substs(st: &mut PState, conv: conv_did) -> ty::substs { - let regions = parse_region_substs(st, |x,y| conv(x,y)); + let regions = parse_region_substs(st); let self_ty = parse_opt(st, |st| parse_ty(st, |x,y| conv(x,y)) ); @@ -202,7 +202,7 @@ fn parse_substs(st: &mut PState, conv: conv_did) -> ty::substs { }; } -fn parse_region_substs(st: &mut PState, conv: conv_did) -> ty::RegionSubsts { +fn parse_region_substs(st: &mut PState) -> ty::RegionSubsts { match next(st) { 'e' => ty::ErasedRegions, 'n' => { diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs index d6e6db8354a0f..aaf0460a4e1a3 100644 --- a/src/librustc/middle/lint.rs +++ b/src/librustc/middle/lint.rs @@ -827,23 +827,26 @@ fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) { !ident.contains_char('_') } - fn check_case(cx: &Context, ident: ast::ident, span: span) { + fn check_case(cx: &Context, sort: &str, ident: ast::ident, span: span) { if !is_camel_case(cx.tcx, ident) { - cx.span_lint(non_camel_case_types, span, - "type, variant, or trait should have \ - a camel case identifier"); + cx.span_lint( + non_camel_case_types, span, + fmt!("%s `%s` should have a camel case identifier", + sort, cx.tcx.sess.str_of(ident))); } } match it.node { - ast::item_ty(*) | ast::item_struct(*) | + ast::item_ty(*) | ast::item_struct(*) => { + check_case(cx, "type", it.ident, it.span) + } ast::item_trait(*) => { - check_case(cx, it.ident, it.span) + check_case(cx, "trait", it.ident, it.span) } ast::item_enum(ref enum_definition, _) => { - check_case(cx, it.ident, it.span); + check_case(cx, "type", it.ident, it.span); for enum_definition.variants.iter().advance |variant| { - check_case(cx, variant.node.name, variant.span); + check_case(cx, "variant", variant.node.name, variant.span); } } _ => () diff --git a/src/librustc/middle/typeck/coherence.rs b/src/librustc/middle/typeck/coherence.rs index ca3710e19a4c2..4298f043e935d 100644 --- a/src/librustc/middle/typeck/coherence.rs +++ b/src/librustc/middle/typeck/coherence.rs @@ -439,7 +439,7 @@ impl CoherenceChecker { -> UniversalQuantificationResult { let regions = match polytype.generics.region_param { None => opt_vec::Empty, - Some(r) => { + Some(_) => { opt_vec::with( self.inference_context.next_region_var( infer::BoundRegionInCoherence)) diff --git a/src/snapshots.txt b/src/snapshots.txt index a3297ef7f1d84..495d58f06f3d7 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,11 @@ +S 2013-07-25 4cf3072 + macos-i386 f682d6e9ca0d56768bd36a0c05b7e58e12694dff + macos-x86_64 2f4e85c9756ba31a04fa8dd1c999fbaf8e1d3d1a + winnt-i386 6360e61fb5c432ad1511cb28af8e44cc0106f1aa + freebsd-x86_64 5e76c40a64b76e0a065d5b8d51c85dfe38ea833a + linux-i386 46961cef9d4efccf5df23a8389d63cf35d35c1d6 + linux-x86_64 b416ca2644b14403818f0219673f6f8fe189e8b4 + S 2013-07-21 e336cbf macos-i386 d9666dccc1040ebe298a54acb378902a7472ad0f macos-x86_64 808f68916444e3857ef2aab20f8db9db8f4b0b4a diff --git a/src/test/compile-fail/lint-non-camel-case-types.rs b/src/test/compile-fail/lint-non-camel-case-types.rs index 27c9ca64a93c6..2cabdfe5bb098 100644 --- a/src/test/compile-fail/lint-non-camel-case-types.rs +++ b/src/test/compile-fail/lint-non-camel-case-types.rs @@ -10,25 +10,25 @@ #[forbid(non_camel_case_types)]; -struct foo { //~ ERROR type, variant, or trait should have a camel case identifier +struct foo { //~ ERROR type `foo` should have a camel case identifier bar: int, } -enum foo2 { //~ ERROR type, variant, or trait should have a camel case identifier +enum foo2 { //~ ERROR type `foo2` should have a camel case identifier Bar } -struct foo3 { //~ ERROR type, variant, or trait should have a camel case identifier +struct foo3 { //~ ERROR type `foo3` should have a camel case identifier bar: int } -type foo4 = int; //~ ERROR type, variant, or trait should have a camel case identifier +type foo4 = int; //~ ERROR type `foo4` should have a camel case identifier enum Foo5 { - bar //~ ERROR type, variant, or trait should have a camel case identifier + bar //~ ERROR variant `bar` should have a camel case identifier } -trait foo6 { //~ ERROR type, variant, or trait should have a camel case identifier +trait foo6 { //~ ERROR trait `foo6` should have a camel case identifier } fn main() { }