Skip to content

Commit 7cd1e7f

Browse files
committed
---
yaml --- r: 64765 b: refs/heads/snap-stage3 c: c519474 h: refs/heads/master i: 64763: 5469f59 v: v3
1 parent 9dc2563 commit 7cd1e7f

31 files changed

+447
-445
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: c32b26be1000673e06ef2e5d114e39a28a5d6cd5
4+
refs/heads/snap-stage3: c5194740a78ec113cb6cbc937e7263e2548f62f6
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/metadata/tydecode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn parse_trait_store(st: &mut PState) -> ty::TraitStore {
186186
}
187187

188188
fn parse_substs(st: &mut PState, conv: conv_did) -> ty::substs {
189-
let regions = parse_region_substs(st, |x,y| conv(x,y));
189+
let regions = parse_region_substs(st);
190190

191191
let self_ty = parse_opt(st, |st| parse_ty(st, |x,y| conv(x,y)) );
192192

@@ -202,7 +202,7 @@ fn parse_substs(st: &mut PState, conv: conv_did) -> ty::substs {
202202
};
203203
}
204204

205-
fn parse_region_substs(st: &mut PState, conv: conv_did) -> ty::RegionSubsts {
205+
fn parse_region_substs(st: &mut PState) -> ty::RegionSubsts {
206206
match next(st) {
207207
'e' => ty::ErasedRegions,
208208
'n' => {

branches/snap-stage3/src/librustc/middle/lint.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -827,23 +827,26 @@ fn check_item_non_camel_case_types(cx: &Context, it: &ast::item) {
827827
!ident.contains_char('_')
828828
}
829829

830-
fn check_case(cx: &Context, ident: ast::ident, span: span) {
830+
fn check_case(cx: &Context, sort: &str, ident: ast::ident, span: span) {
831831
if !is_camel_case(cx.tcx, ident) {
832-
cx.span_lint(non_camel_case_types, span,
833-
"type, variant, or trait should have \
834-
a camel case identifier");
832+
cx.span_lint(
833+
non_camel_case_types, span,
834+
fmt!("%s `%s` should have a camel case identifier",
835+
sort, cx.tcx.sess.str_of(ident)));
835836
}
836837
}
837838

838839
match it.node {
839-
ast::item_ty(*) | ast::item_struct(*) |
840+
ast::item_ty(*) | ast::item_struct(*) => {
841+
check_case(cx, "type", it.ident, it.span)
842+
}
840843
ast::item_trait(*) => {
841-
check_case(cx, it.ident, it.span)
844+
check_case(cx, "trait", it.ident, it.span)
842845
}
843846
ast::item_enum(ref enum_definition, _) => {
844-
check_case(cx, it.ident, it.span);
847+
check_case(cx, "type", it.ident, it.span);
845848
for enum_definition.variants.iter().advance |variant| {
846-
check_case(cx, variant.node.name, variant.span);
849+
check_case(cx, "variant", variant.node.name, variant.span);
847850
}
848851
}
849852
_ => ()

0 commit comments

Comments
 (0)