Skip to content

Commit f074caa

Browse files
committed
auto merge of #8050 : msullivan/rust/cleanup, r=thestinger
And a couple other things. Fix up some unused variable warnings, and improve the camel case lint message a little.
2 parents 0012b50 + 3ba8ceb commit f074caa

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

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' => {

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
_ => ()

src/librustc/middle/typeck/coherence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl CoherenceChecker {
439439
-> UniversalQuantificationResult {
440440
let regions = match polytype.generics.region_param {
441441
None => opt_vec::Empty,
442-
Some(r) => {
442+
Some(_) => {
443443
opt_vec::with(
444444
self.inference_context.next_region_var(
445445
infer::BoundRegionInCoherence))

src/snapshots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2013-07-25 4cf3072
2+
macos-i386 463ecd040e107a986c085f45c23674fe76f43692
3+
macos-x86_64 8b2ca84391c39856d764ccde9472d78c787db52c
4+
winnt-i386 6360e61fb5c432ad1511cb28af8e44cc0106f1aa
5+
freebsd-x86_64 5e76c40a64b76e0a065d5b8d51c85dfe38ea833a
6+
linux-i386 46961cef9d4efccf5df23a8389d63cf35d35c1d6
7+
linux-x86_64 b416ca2644b14403818f0219673f6f8fe189e8b4
8+
19
S 2013-07-21 e336cbf
210
macos-i386 d9666dccc1040ebe298a54acb378902a7472ad0f
311
macos-x86_64 808f68916444e3857ef2aab20f8db9db8f4b0b4a

0 commit comments

Comments
 (0)