Fixed error starting with uppercase

Error messages cleaned in librustc/middle

Error messages cleaned in libsyntax

Error messages cleaned in libsyntax more agressively

Error messages cleaned in librustc more aggressively

Fixed affected tests

Fixed other failing tests

Last failing tests fixed
This commit is contained in:
mr.Shu 2014-02-06 10:38:08 +01:00
parent 35518514c4
commit ee3fa68fed
74 changed files with 167 additions and 167 deletions

View file

@ -323,7 +323,7 @@ fn cannot_combine(n: Abi, m: Abi) {
(m == a && n == b));
}
None => {
fail!("Invalid match not detected");
fail!("invalid match not detected");
}
}
}
@ -335,7 +335,7 @@ fn can_combine(n: Abi, m: Abi) {
set.add(m);
match set.check_valid() {
Some((_, _)) => {
fail!("Valid match declared invalid");
fail!("valid match declared invalid");
}
None => {}
}

View file

@ -40,7 +40,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
// u8 literal, push to vector expression
ast::LitUint(v, ast::TyU8) => {
if v > 0xFF {
cx.span_err(expr.span, "Too large u8 literal in bytes!")
cx.span_err(expr.span, "too large u8 literal in bytes!")
} else {
bytes.push(cx.expr_u8(expr.span, v as u8));
}
@ -49,9 +49,9 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
// integer literal, push to vector expression
ast::LitIntUnsuffixed(v) => {
if v > 0xFF {
cx.span_err(expr.span, "Too large integer literal in bytes!")
cx.span_err(expr.span, "too large integer literal in bytes!")
} else if v < 0 {
cx.span_err(expr.span, "Negative integer literal in bytes!")
cx.span_err(expr.span, "negative integer literal in bytes!")
} else {
bytes.push(cx.expr_u8(expr.span, v as u8));
}
@ -62,14 +62,14 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
if char::from_u32(v).unwrap().is_ascii() {
bytes.push(cx.expr_u8(expr.span, v as u8));
} else {
cx.span_err(expr.span, "Non-ascii char literal in bytes!")
cx.span_err(expr.span, "non-ascii char literal in bytes!")
}
}
_ => cx.span_err(expr.span, "Unsupported literal in bytes!")
_ => cx.span_err(expr.span, "unsupported literal in bytes!")
},
_ => cx.span_err(expr.span, "Non-literal in bytes!")
_ => cx.span_err(expr.span, "non-literal in bytes!")
}
}

View file

@ -92,10 +92,10 @@ fn cs_clone(
all_fields = af;
},
EnumNonMatching(..) => cx.span_bug(trait_span,
format!("Non-matching enum variants in `deriving({})`",
format!("non-matching enum variants in `deriving({})`",
name)),
StaticEnum(..) | StaticStruct(..) => cx.span_bug(trait_span,
format!("Static method in `deriving({})`",
format!("static method in `deriving({})`",
name))
}

View file

@ -75,7 +75,7 @@ fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt, span: Span, substr: &Substru
*/
let other_f = match other_fs {
[o_f] => o_f,
_ => cx.span_bug(span, "Not exactly 2 arguments in `deriving(Ord)`")
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(Ord)`")
};
let cmp = cx.expr_binary(span, op, self_f, other_f);
@ -99,7 +99,7 @@ fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt, span: Span, substr: &Substru
} else {
self_var > other_var
}),
_ => cx.span_bug(span, "Not exactly 2 arguments in `deriving(Ord)`")
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(Ord)`")
}
},
cx, span, substr)

View file

@ -110,7 +110,7 @@ pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,
let order = ordering_const(cx, span, self_var.cmp(&other_var));
cx.expr_path(order)
}
_ => cx.span_bug(span, "Not exactly 2 arguments in `deriving(TotalOrd)`")
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(TotalOrd)`")
}
},
cx, span, substr)

View file

@ -656,7 +656,7 @@ impl<'a> MethodDef<'a> {
}).collect()
}
[] => { trait_.cx.span_bug(trait_.span,
"No self arguments to non-static method \
"no self arguments to non-static method \
in generic `deriving`") }
};
@ -840,7 +840,7 @@ impl<'a> MethodDef<'a> {
let index = match matching {
Some(i) => i,
None => cx.span_bug(trait_.span,
"Non-matching variants when required to \
"non-matching variants when required to \
be matching in generic `deriving`")
};
@ -965,7 +965,7 @@ impl<'a> TraitDef<'a> {
match (just_spans.is_empty(), named_idents.is_empty()) {
(false, false) => self.cx.span_bug(self.span,
"A struct with named and unnamed \
"a struct with named and unnamed \
fields in generic `deriving`"),
// named fields
(_, false) => Named(named_idents),
@ -1019,7 +1019,7 @@ impl<'a> TraitDef<'a> {
None
}
_ => {
cx.span_bug(sp, "A struct with named and unnamed fields in `deriving`");
cx.span_bug(sp, "a struct with named and unnamed fields in `deriving`");
}
};
let path = cx.path_ident(sp, cx.ident_of(format!("{}_{}", prefix, i)));
@ -1116,7 +1116,7 @@ pub fn cs_fold(use_foldl: bool,
*all_enums,
substructure.nonself_args),
StaticEnum(..) | StaticStruct(..) => {
cx.span_bug(trait_span, "Static function in `deriving`")
cx.span_bug(trait_span, "static function in `deriving`")
}
}
}
@ -1154,7 +1154,7 @@ pub fn cs_same_method(f: |&mut ExtCtxt, Span, ~[@Expr]| -> @Expr,
*all_enums,
substructure.nonself_args),
StaticEnum(..) | StaticStruct(..) => {
cx.span_bug(trait_span, "Static function in `deriving`")
cx.span_bug(trait_span, "static function in `deriving`")
}
}
}

View file

@ -48,7 +48,7 @@ pub fn expand_deriving_iter_bytes(cx: &mut ExtCtxt,
fn iter_bytes_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
let (lsb0, f)= match substr.nonself_args {
[l, f] => (l, f),
_ => cx.span_bug(trait_span, "Incorrect number of arguments in `deriving(IterBytes)`")
_ => cx.span_bug(trait_span, "incorrect number of arguments in `deriving(IterBytes)`")
};
// Build the "explicitly borrowed" stack closure, "|_buf| f(_buf)".
let blk_arg = cx.ident_of("_buf");
@ -82,7 +82,7 @@ fn iter_bytes_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substruc
fields = fs;
}
_ => cx.span_bug(trait_span, "Impossible substructure in `deriving(IterBytes)`")
_ => cx.span_bug(trait_span, "impossible substructure in `deriving(IterBytes)`")
}
for &FieldInfo { self_, span, .. } in fields.iter() {

View file

@ -68,7 +68,7 @@ pub fn expand_deriving_from_primitive(cx: &mut ExtCtxt,
fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
let n = match substr.nonself_args {
[n] => n,
_ => cx.span_bug(trait_span, "Incorrect number of arguments in `deriving(FromPrimitive)`")
_ => cx.span_bug(trait_span, "incorrect number of arguments in `deriving(FromPrimitive)`")
};
match *substr.fields {

View file

@ -178,8 +178,8 @@ impl<'a> Ty<'a> {
Literal(ref p) => {
p.to_path(cx, span, self_ty, self_generics)
}
Ptr(..) => { cx.span_bug(span, "Pointer in a path in generic `deriving`") }
Tuple(..) => { cx.span_bug(span, "Tuple in a path in generic `deriving`") }
Ptr(..) => { cx.span_bug(span, "pointer in a path in generic `deriving`") }
Tuple(..) => { cx.span_bug(span, "tuple in a path in generic `deriving`") }
}
}
}

View file

@ -257,7 +257,7 @@ pub mod rt {
match res {
Some(ast) => ast,
None => {
error!("Parse error");
error!("parse error");
fail!()
}
}
@ -589,7 +589,7 @@ fn expand_tts(cx: &ExtCtxt, sp: Span, tts: &[ast::TokenTree])
let cx_expr = p.parse_expr();
if !p.eat(&token::COMMA) {
p.fatal("Expected token `,`");
p.fatal("expected token `,`");
}
let tts = p.parse_all_token_trees();

View file

@ -49,7 +49,7 @@ pub fn find_macro_registrar(diagnostic: @diagnostic::SpanHandler,
})
},
_ => {
diagnostic.handler().err("Multiple macro registration functions found");
diagnostic.handler().err("multiple macro registration functions found");
for &(_, span) in ctx.registrars.iter() {
diagnostic.span_note(span, "one is here");
}

View file

@ -185,7 +185,7 @@ pub fn nameize(p_s: @ParseSess, ms: &[Matcher], res: &[@NamedMatch])
if ret_val.contains_key(bind_name) {
let string = token::get_ident(bind_name.name);
p_s.span_diagnostic
.span_fatal(sp, "Duplicated bind name: " + string.get())
.span_fatal(sp, "duplicated bind name: " + string.get())
}
ret_val.insert(*bind_name, res[idx]);
}
@ -441,6 +441,6 @@ pub fn parse_nt(p: &mut Parser, name: &str) -> Nonterminal {
res
}
"matchers" => token::NtMatchers(p.parse_matchers()),
_ => p.fatal(~"Unsupported builtin nonterminal parser: " + name)
_ => p.fatal(~"unsupported builtin nonterminal parser: " + name)
}
}

View file

@ -148,7 +148,7 @@ fn lis_merge(lhs: LockstepIterSize, rhs: LockstepIterSize) -> LockstepIterSize {
LisConstraint(r_len, ref r_id) => {
let l_n = token::get_ident(l_id.name);
let r_n = token::get_ident(r_id.name);
LisContradiction(format!("Inconsistent lockstep iteration: \
LisContradiction(format!("inconsistent lockstep iteration: \
'{}' has {} items, but '{}' has {}",
l_n.get(), l_len, r_n.get(), r_len))
}

View file

@ -85,7 +85,7 @@ impl<T> OptVec<T> {
pub fn get<'a>(&'a self, i: uint) -> &'a T {
match *self {
Empty => fail!("Invalid index {}", i),
Empty => fail!("invalid index {}", i),
Vec(ref v) => &v[i]
}
}
@ -103,7 +103,7 @@ impl<T> OptVec<T> {
pub fn swap_remove(&mut self, index: uint) {
match *self {
Empty => { fail!("Index out of bounds"); }
Empty => { fail!("index out of bounds"); }
Vec(ref mut v) => {
assert!(index < v.len());
v.swap_remove(index);

View file

@ -76,7 +76,7 @@ impl ParserObsoleteMethods for Parser {
let (kind_str, desc) = match kind {
ObsoleteSwap => (
"swap",
"Use std::util::{swap, replace} instead"
"use std::util::{swap, replace} instead"
),
ObsoleteUnsafeBlock => (
"non-standalone unsafe block",

View file

@ -431,7 +431,7 @@ impl Parser {
&& self.look_ahead(1, |t| *t == token::RBRACE) {
// matched; signal non-fatal error and recover.
self.span_err(self.span,
"Unit-like struct construction is written with no trailing `{ }`");
"unit-like struct construction is written with no trailing `{ }`");
self.eat(&token::LBRACE);
self.eat(&token::RBRACE);
true
@ -1601,7 +1601,7 @@ impl Parser {
};
}
_ => {
self.fatal(format!("Expected a lifetime name"));
self.fatal(format!("expected a lifetime name"));
}
}
}
@ -2137,7 +2137,7 @@ impl Parser {
}
// There shouldn't really be a span, but it's easier for the test runner
// if we give it one
self.fatal("This file contains an un-closed delimiter ");
self.fatal("this file contains an un-closed delimiter ");
}
token::LPAREN | token::LBRACE | token::LBRACKET => {
let close_delim = token::flip_delimiter(&self.token);
@ -3957,7 +3957,7 @@ impl Parser {
}
if fields.len() == 0 {
let string = get_ident_interner().get(class_name.name);
self.fatal(format!("Unit-like struct definition should be written as `struct {};`",
self.fatal(format!("unit-like struct definition should be written as `struct {};`",
string.as_slice()));
}
self.bump();

View file

@ -68,7 +68,7 @@ impl<T> SmallVector<T> {
match *self {
One(ref v) if idx == 0 => v,
Many(ref vs) => &vs[idx],
_ => fail!("Out of bounds access")
_ => fail!("out of bounds access")
}
}