diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-05 16:27:27 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-05 17:05:20 -0800 |
| commit | 0ee96de4ee21643546908065fbf3bc7a3f436a3f (patch) | |
| tree | c59e98ddc8504c23aa2eea3b11801475e9186cb6 | |
| parent | 13a07ce1d4df500d18ce393a7b46775174560d01 (diff) | |
| download | rust-0ee96de4ee21643546908065fbf3bc7a3f436a3f.tar.gz rust-0ee96de4ee21643546908065fbf3bc7a3f436a3f.zip | |
rustc: Lower case error messages
56 files changed, 107 insertions, 108 deletions
diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index c2cc106b3e2..4e54a57a1f7 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -439,7 +439,7 @@ fn build_link_meta(sess: session, c: ast::crate, output: str, { let os = str::split_char(fs::basename(output), '.'); if (vec::len(os) < 2u) { - sess.fatal(#fmt("Output file name %s doesn't\ + sess.fatal(#fmt("output file name %s doesn't\ appear to have an extension", output)); } vec::pop(os); diff --git a/src/rustc/driver/driver.rs b/src/rustc/driver/driver.rs index b45d95fef27..acc2e201e97 100644 --- a/src/rustc/driver/driver.rs +++ b/src/rustc/driver/driver.rs @@ -309,12 +309,12 @@ fn build_target_config(sopts: @session::options, demitter: diagnostic::emitter) -> @session::config { let os = alt get_os(sopts.target_triple) { some(os) { os } - none { early_error(demitter, "Unknown operating system!") } + none { early_error(demitter, "unknown operating system") } }; let arch = alt get_arch(sopts.target_triple) { some(arch) { arch } none { early_error(demitter, - "Unknown architecture! " + sopts.target_triple) } + "unknown architecture: " + sopts.target_triple) } }; let (int_type, uint_type, float_type) = alt arch { session::arch_x86 {(ast::ty_i32, ast::ty_u32, ast::ty_f64)} @@ -607,7 +607,7 @@ fn build_output_filenames(ifile: str, } if odir != none { - sess.warn("Ignoring --out-dir flag due to -o flag."); + sess.warn("ignoring --out-dir flag due to -o flag."); } } } diff --git a/src/rustc/driver/rustc.rs b/src/rustc/driver/rustc.rs index 8d0b8549062..a6351f824b4 100644 --- a/src/rustc/driver/rustc.rs +++ b/src/rustc/driver/rustc.rs @@ -93,9 +93,9 @@ fn run_compiler(args: [str], demitter: diagnostic::emitter) { ret; } let ifile = alt vec::len(match.free) { - 0u { early_error(demitter, "No input filename given.") } + 0u { early_error(demitter, "o input filename given") } 1u { match.free[0] } - _ { early_error(demitter, "Multiple input filenames provided.") } + _ { early_error(demitter, "multiple input filenames provided") } }; let sopts = build_session_options(match, demitter); diff --git a/src/rustc/metadata/astencode.rs b/src/rustc/metadata/astencode.rs index bd1309c7c86..87e2138a247 100644 --- a/src/rustc/metadata/astencode.rs +++ b/src/rustc/metadata/astencode.rs @@ -823,7 +823,7 @@ fn decode_side_tables(xcx: extended_decode_ctxt, val_dsr.read_dict_res(xcx)); } else { xcx.dcx.tcx.sess.bug( - #fmt["Unknown tag found in side tables: %x", tag]); + #fmt["unknown tag found in side tables: %x", tag]); } } diff --git a/src/rustc/metadata/creader.rs b/src/rustc/metadata/creader.rs index 6222fc91e2c..cfa16a38b4f 100644 --- a/src/rustc/metadata/creader.rs +++ b/src/rustc/metadata/creader.rs @@ -96,7 +96,7 @@ fn list_file_metadata(sess: session::session, path: str, out: io::writer) { alt get_metadata_section(sess, path) { option::some(bytes) { decoder::list_crate_metadata(bytes, out); } option::none { - out.write_str("Could not find metadata in " + path + ".\n"); + out.write_str("could not find metadata in " + path + ".\n"); } } } diff --git a/src/rustc/middle/capture.rs b/src/rustc/middle/capture.rs index c32623b30b1..3ec56c62077 100644 --- a/src/rustc/middle/capture.rs +++ b/src/rustc/middle/capture.rs @@ -40,7 +40,7 @@ fn check_capture_clause(tcx: ty::ctxt, if !vec::any(*freevars, {|fv| fv.def == cap_def}) { tcx.sess.span_warn( cap_item.span, - #fmt("Captured variable '%s' not used in closure", + #fmt("captured variable '%s' not used in closure", cap_item.name)); } @@ -48,7 +48,7 @@ fn check_capture_clause(tcx: ty::ctxt, if !seen_defs.insert(cap_def_id, ()) { tcx.sess.span_err( cap_item.span, - #fmt("Variable '%s' captured more than once", + #fmt("variable '%s' captured more than once", cap_item.name)); } }; @@ -58,7 +58,7 @@ fn check_capture_clause(tcx: ty::ctxt, ast::def_upvar(_, _, _) { tcx.sess.span_err( cap_item.span, - #fmt("Upvars (like '%s') cannot be moved into a closure", + #fmt("upvars (like '%s') cannot be moved into a closure", cap_item.name)); } _ {} @@ -70,7 +70,7 @@ fn check_capture_clause(tcx: ty::ctxt, let cap_item0 = vec::head(v); tcx.sess.span_err( cap_item0.span, - "Cannot capture values explicitly with a block closure"); + "cannot capture values explicitly with a block closure"); } }; diff --git a/src/rustc/middle/kind.rs b/src/rustc/middle/kind.rs index ffe2873a3b7..e7999f04cad 100644 --- a/src/rustc/middle/kind.rs +++ b/src/rustc/middle/kind.rs @@ -150,7 +150,7 @@ fn check_expr(e: @expr, cx: ctx, v: visit::vt<ctx>) { let t = ty::expr_ty(cx.tcx, ex); let ty_fields = alt ty::get(t).struct { ty::ty_rec(f) { f } - _ { cx.tcx.sess.span_bug(ex.span, "Bad expr type in record"); } + _ { cx.tcx.sess.span_bug(ex.span, "bad expr type in record"); } }; for tf in ty_fields { if !vec::any(fields, {|f| f.node.ident == tf.ident}) && diff --git a/src/rustc/middle/mutbl.rs b/src/rustc/middle/mutbl.rs index 836b2631427..bf51f7d3764 100644 --- a/src/rustc/middle/mutbl.rs +++ b/src/rustc/middle/mutbl.rs @@ -98,7 +98,7 @@ fn expr_root(tcx: ty::ctxt, ex: @expr, autoderef: bool) -> is_mutbl = mt.mutbl == m_mutbl; ptr = true; } - _ { tcx.sess.span_bug(base.span, "Ill-typed base \ + _ { tcx.sess.span_bug(base.span, "ill-typed base \ expression in deref"); } } ds += [@{mutbl: is_mutbl, kind: unbox(ptr && is_mutbl), diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs index 1f5e110b63e..28d9414beb4 100644 --- a/src/rustc/middle/resolve.rs +++ b/src/rustc/middle/resolve.rs @@ -329,7 +329,7 @@ fn map_crate(e: @env, c: @ast::crate) { e.mod_map.get(ast::crate_node_id).glob_imports += [glob]; } - _ { e.sess.span_bug(vi.span, "Unexpected scope in a \ + _ { e.sess.span_bug(vi.span, "unexpected scope in a \ glob import"); } } } @@ -376,7 +376,7 @@ fn resolve_imports(e: env) { resolve_import(e, local_def(node_id), name, *path, span, scopes); } resolved(_, _, _, _, _, _) | is_glob(_, _, _) { } - _ { e.sess.bug("Shouldn't see a resolving in resolve_imports"); } + _ { e.sess.bug("shouldn't see a resolving in resolve_imports"); } } }; e.used_imports.track = false; @@ -658,7 +658,7 @@ fn visit_local_with_scope(e: @env, loc: @local, sc:scopes, v:vt<scopes>) { // Declaration shadows a enum that's in scope. // That's an error. e.sess.span_err(loc.span, - #fmt("Declaration of %s shadows a enum that's in scope", + #fmt("declaration of `%s` shadows a enum that's in scope", path_to_ident(an_ident))); } _ {} @@ -1324,7 +1324,7 @@ fn lookup_in_block(e: env, name: ident, sp: span, b: ast::blk_, pos: uint, } } } - _ { e.sess.span_bug(vi.span, "Unexpected view_item in block"); } + _ { e.sess.span_bug(vi.span, "unexpected view_item in block"); } } } ret none; diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs index 29200a47287..cebc2954332 100644 --- a/src/rustc/middle/trans/alt.rs +++ b/src/rustc/middle/trans/alt.rs @@ -428,7 +428,7 @@ fn compile_submatch(bcx: block, m: match, vals: [ValueRef], f: mk_fail, let tup_ty = node_id_type(bcx, pat_id); let n_tup_elts = alt ty::get(tup_ty).struct { ty::ty_tup(elts) { elts.len() } - _ { ccx.sess.bug("Non-tuple type in tuple pattern"); } + _ { ccx.sess.bug("non-tuple type in tuple pattern"); } }; let tup_vals = [], i = 0u; while i < n_tup_elts { @@ -588,7 +588,7 @@ fn make_phi_bindings(bcx: block, map: [exit_node], if bcx.ccx().maps.copy_map.contains_key(node_id) { let local = alt bcx.fcx.lllocals.find(node_id) { some(local_mem(x)) { x } - _ { bcx.tcx().sess.bug("Someone \ + _ { bcx.tcx().sess.bug("someone \ forgot to document an invariant in \ make_phi_bindings"); } }; diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index c0e9847aba3..9baae720f47 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -1957,7 +1957,7 @@ fn trans_if(cx: block, cond: @ast::expr, thn: ast::blk, trans_block(else_cx, blk, else_dest) } // would be nice to have a constraint on ifs - _ { cx.tcx().sess.bug("Strange alternative in if"); } + _ { cx.tcx().sess.bug("strange alternative in if"); } } } _ { else_cx } @@ -2119,7 +2119,7 @@ fn monomorphic_fn(ccx: crate_ctxt, fn_id: ast::def_id, substs: [ty::t], ast_map::node_method(m, _, pt) { (pt, m.ident) } // We can't monomorphize native functions ast_map::node_native_item(_, _) { ret none; } - _ { fail "Unexpected node type"; } + _ { fail "unexpected node type"; } }; let pt = *pt + [path_name(ccx.names(name))]; let s = mangle_exported_name(ccx, pt, mono_ty); @@ -2614,10 +2614,10 @@ fn trans_cast(cx: block, e: @ast::expr, id: ast::node_id, integral {int_cast(e_res.bcx, ll_t_out, val_ty(lldiscrim_a), lldiscrim_a, true)} float {SIToFP(e_res.bcx, lldiscrim_a, ll_t_out)} - _ { ccx.sess.bug("Translating unsupported cast.") } + _ { ccx.sess.bug("translating unsupported cast.") } } } - _ { ccx.sess.bug("Translating unsupported cast.") } + _ { ccx.sess.bug("translating unsupported cast.") } }; ret store_in_dest(e_res.bcx, newval, dest); } @@ -3139,7 +3139,7 @@ fn trans_expr(bcx: block, e: @ast::expr, dest: dest) -> block { bcx, proto, decl, body, e.span, e.id, cap_clause, dest); } _ { - fail "Type of fn block is not a function!"; + fail "type of fn block is not a function!"; } } } @@ -3993,7 +3993,7 @@ fn copy_args_to_allocas(fcx: fn_ctxt, bcx: block, args: [ast::arg], let tcx = bcx.tcx(); let arg_n: uint = 0u, bcx = bcx; let epic_fail = fn@() -> ! { - tcx.sess.bug("Someone forgot\ + tcx.sess.bug("someone forgot\ to document an invariant in copy_args_to_allocas!"); }; for arg in arg_tys { @@ -4306,7 +4306,7 @@ fn trans_const(cx: crate_ctxt, e: @ast::expr, id: ast::node_id) { llvm::LLVMSetInitializer(g, v); llvm::LLVMSetGlobalConstant(g, True); } - _ { cx.sess.span_fatal(e.span, "Unbound const in trans_const"); } + _ { cx.sess.span_bug(e.span, "unbound const in trans_const"); } } } @@ -4319,7 +4319,7 @@ fn trans_item(ccx: crate_ctxt, item: ast::item) { let llfndecl = alt ccx.item_ids.find(item.id) { some(llfndecl) { llfndecl } _ { - ccx.sess.span_fatal(item.span, + ccx.sess.span_bug(item.span, "unbound function item in trans_item"); } }; diff --git a/src/rustc/middle/trans/closure.rs b/src/rustc/middle/trans/closure.rs index 6f85204ffe0..f11dbae04b8 100644 --- a/src/rustc/middle/trans/closure.rs +++ b/src/rustc/middle/trans/closure.rs @@ -325,7 +325,7 @@ fn store_environment( bcx = base::copy_val(bcx, INIT, bound_data, val, ty); } env_copy(_, _, temporary) { - fail "Cannot capture temporary upvar"; + fail "cannot capture temporary upvar"; } env_move(val, ty, kind) { let src = {bcx:bcx, val:val, kind:kind}; @@ -339,7 +339,7 @@ fn store_environment( Store(bcx, addr, bound_data); } env_ref(_, _, temporary) { - fail "Cannot capture temporary upvar"; + fail "cannot capture temporary upvar"; } } } diff --git a/src/rustc/middle/trans/impl.rs b/src/rustc/middle/trans/impl.rs index e713a9979e4..e4e1859e87d 100644 --- a/src/rustc/middle/trans/impl.rs +++ b/src/rustc/middle/trans/impl.rs @@ -55,7 +55,7 @@ fn trans_impl(ccx: crate_ctxt, path: path, name: ast::ident, m_bounds, none, m.id, none); } _ { - ccx.sess.bug("Unbound id in trans_impl"); + ccx.sess.bug("unbound id in trans_impl"); } } } @@ -347,7 +347,7 @@ fn trans_impl_vtable(ccx: crate_ctxt, pt: path, extra_tps, target) } _ { - ccx.sess.span_bug(it.span, "No matching method \ + ccx.sess.span_bug(it.span, "no matching method \ in trans_impl_vtable"); } } @@ -459,7 +459,7 @@ fn dict_id(tcx: ty::ctxt, origin: typeck::dict_origin) -> dict_id { @{def: did, params: []} } _ { - tcx.sess.bug("Unexpected dict_param in dict_id"); + tcx.sess.bug("unexpected dict_param in dict_id"); } } } @@ -523,7 +523,7 @@ fn get_dict_ptrs(bcx: block, origin: typeck::dict_origin) {bcx: bcx, ptrs: [get_vtable(ccx, did)]} } _ { - bcx.tcx().sess.bug("Unexpected dict_param in get_dict_ptrs"); + bcx.tcx().sess.bug("unexpected dict_param in get_dict_ptrs"); } } } diff --git a/src/rustc/middle/tstate/auxiliary.rs b/src/rustc/middle/tstate/auxiliary.rs index df358a86004..89fce0ddb70 100644 --- a/src/rustc/middle/tstate/auxiliary.rs +++ b/src/rustc/middle/tstate/auxiliary.rs @@ -596,7 +596,7 @@ fn expr_to_constr_arg(tcx: ty::ctxt, e: @expr) -> @constr_arg_use { expr_lit(l) { ret @respan(e.span, carg_lit(l)); } _ { tcx.sess.span_fatal(e.span, - "Arguments to constrained functions must be " + + "arguments to constrained functions must be " + "literals or local variables"); } } @@ -619,16 +619,13 @@ fn expr_to_constr(tcx: ty::ctxt, e: @expr) -> sp_constr { exprs_to_constr_args(tcx, args))); } _ { - tcx.sess.span_fatal(operator.span, - "Internal error: " + - " ill-formed operator \ - in predicate"); + tcx.sess.span_bug(operator.span, + "ill-formed operator in predicate"); } } } _ { - tcx.sess.span_fatal(e.span, - "Internal error: " + " ill-formed predicate"); + tcx.sess.span_bug(e.span, "ill-formed predicate"); } } } @@ -656,7 +653,7 @@ fn substitute_arg(cx: ty::ctxt, actuals: [@expr], a: @constr_arg) -> if i < num_actuals { ret expr_to_constr_arg(cx, actuals[i]); } else { - cx.sess.span_fatal(a.span, "Constraint argument out of bounds"); + cx.sess.span_fatal(a.span, "constraint argument out of bounds"); } } carg_base { ret @respan(a.span, carg_base); } @@ -1029,7 +1026,7 @@ fn args_to_constr_args(tcx: ty::ctxt, args: [arg], node: args[i].id}) } else { tcx.sess.span_bug(a.span, - "Index out of bounds in \ + "index out of bounds in \ constraint arg"); } } diff --git a/src/rustc/middle/tstate/ck.rs b/src/rustc/middle/tstate/ck.rs index 08415119e4a..357d43edc8e 100644 --- a/src/rustc/middle/tstate/ck.rs +++ b/src/rustc/middle/tstate/ck.rs @@ -51,12 +51,12 @@ fn check_states_expr(e: @expr, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) { let s = ""; let diff = first_difference_string(fcx, prec, pres); s += - "Unsatisfied precondition constraint (for example, " + diff + + "unsatisfied precondition constraint (for example, " + diff + ") for expression:\n"; s += syntax::print::pprust::expr_to_str(e); - s += "\nPrecondition:\n"; + s += "\nprecondition:\n"; s += tritv_to_str(fcx, prec); - s += "\nPrestate:\n"; + s += "\nprestate:\n"; s += tritv_to_str(fcx, pres); fcx.ccx.tcx.sess.span_fatal(e.span, s); } @@ -81,12 +81,12 @@ fn check_states_stmt(s: @stmt, fcx: fn_ctxt, v: visit::vt<fn_ctxt>) { let ss = ""; let diff = first_difference_string(fcx, prec, pres); ss += - "Unsatisfied precondition constraint (for example, " + diff + + "unsatisfied precondition constraint (for example, " + diff + ") for statement:\n"; ss += syntax::print::pprust::stmt_to_str(*s); - ss += "\nPrecondition:\n"; + ss += "\nprecondition:\n"; ss += tritv_to_str(fcx, prec); - ss += "\nPrestate: \n"; + ss += "\nprestate: \n"; ss += tritv_to_str(fcx, pres); fcx.ccx.tcx.sess.span_fatal(s.span, ss); } @@ -115,7 +115,7 @@ fn check_states_against_conditions(fcx: fn_ctxt, fcx.ccx.tcx, id))) && f_decl.cf == return_val { fcx.ccx.tcx.sess.span_err(f_body.span, - "In function " + fcx.name + + "in function " + fcx.name + ", not all control paths \ return a value"); fcx.ccx.tcx.sess.span_fatal(f_decl.output.span, @@ -129,7 +129,7 @@ fn check_states_against_conditions(fcx: fn_ctxt, if !promises(fcx, post, fcx.enclosing.i_diverge) { fcx.ccx.tcx.sess.span_fatal(f_body.span, - "In non-returning function " + + "in non-returning function " + fcx.name + ", some control paths may \ return to the caller"); diff --git a/src/rustc/middle/tstate/states.rs b/src/rustc/middle/tstate/states.rs index b90e39f2b23..adb86248047 100644 --- a/src/rustc/middle/tstate/states.rs +++ b/src/rustc/middle/tstate/states.rs @@ -17,7 +17,7 @@ fn forbid_upvar(fcx: fn_ctxt, rhs_id: node_id, sp: span, t: oper_type) { alt local_node_id_to_def(fcx, rhs_id) { some(def_upvar(_, _, _)) { fcx.ccx.tcx.sess.span_err(sp, - "Tried to deinitialize a variable \ + "tried to deinitialize a variable \ declared in a different scope"); } _ { } diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 6895630f879..f841b9e0ed3 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -608,7 +608,7 @@ fn fold_ty(cx: ctxt, fld: fold_mode, ty_0: t) -> t { ty = mk_constr(cx, fold_ty(cx, fld, subty), cs); } _ { - cx.sess.fatal("Unsupported sort of type in fold_ty"); + cx.sess.bug("unsupported sort of type in fold_ty"); } } alt tb.o_def_id { @@ -868,7 +868,7 @@ fn type_kind(cx: ctxt, ty: t) -> kind { param_bounds_to_kind(cx.ty_param_bounds.get(did.node)) } ty_constr(t, _) { type_kind(cx, t) } - _ { cx.sess.bug("Bad type in type_kind"); } + _ { cx.sess.bug("bad type in type_kind"); } }; cx.kind_cache.insert(ty, result); @@ -1408,11 +1408,11 @@ fn occurs_check_fails(tcx: ctxt, sp: option<span>, vid: int, rt: t) -> // assertion later on that the type doesn't contain // variables, so in this case we have to be sure to die. tcx.sess.span_fatal - (s, "Type inference failed because I \ + (s, "type inference failed because I \ could not find a type\n that's both of the form " + ty_to_str(tcx, mk_var(tcx, vid)) + " and of the form " + ty_to_str(tcx, rt) + - ". Such a type would have to be infinitely large."); + " - such a type would have to be infinitely large."); } _ { ret true; } } @@ -1533,7 +1533,7 @@ mod unify { variance: variance) -> union_result { let vb = alt cx.st { in_bindings(vb) { vb } - _ { cx.tcx.sess.bug("Someone forgot to document an invariant \ + _ { cx.tcx.sess.bug("someone forgot to document an invariant \ in union"); } }; ufind::grow(vb.sets, math::max(set_a, set_b) + 1u); @@ -2113,12 +2113,12 @@ fn type_err_to_str(err: type_err) -> str { mode_to_str(a_mode); } terr_constr_len(e_len, a_len) { - ret "Expected a type with " + uint::str(e_len) + + ret "expected a type with " + uint::str(e_len) + " constraints, but found one with " + uint::str(a_len) + " constraints"; } terr_constr_mismatch(e_constr, a_constr) { - ret "Expected a type with constraint " + ty_constr_to_str(e_constr) + + ret "expected a type with constraint " + ty_constr_to_str(e_constr) + " but found one with constraint " + ty_constr_to_str(a_constr); } @@ -2438,7 +2438,7 @@ fn ast_constr_to_constr<T>(tcx: ctxt, c: @ast::constr_general<T>) -> } _ { tcx.sess.span_fatal(c.span, - "Predicate " + path_to_str(c.node.path) + + "predicate " + path_to_str(c.node.path) + " is unbound or bound to a non-function or an \ impure function"); } diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index 57d8fc29560..3787328b5d9 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -262,7 +262,7 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t { ty_of_native_item(tcx, mode, native_item) } _ { - tcx.sess.bug("Unexpected sort of item in ast_ty_to_ty"); + tcx.sess.bug("unexpected sort of item in ast_ty_to_ty"); } } } @@ -293,7 +293,7 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t { // The typedef is type-parametric. Do the type substitution. let param_bindings: [ty::t] = []; if vec::len(args) != vec::len(*ty_param_bounds_and_ty.bounds) { - tcx.sess.span_fatal(sp, "Wrong number of type arguments for a \ + tcx.sess.span_fatal(sp, "wrong number of type arguments for a \ polymorphic type"); } for ast_ty: @ast::ty in args { @@ -1611,7 +1611,7 @@ fn require_impure(sess: session, f_purity: ast::purity, sp: span) { ast::unsafe_fn { ret; } ast::impure_fn | ast::crust_fn { ret; } ast::pure_fn { - sess.span_err(sp, "Found impure expression in pure function decl"); + sess.span_err(sp, "found impure expression in pure function decl"); } } } @@ -1847,7 +1847,7 @@ fn lookup_field_ty(cx: ty::ctxt, items:[@ast::class_item], ast::instance_var(declname, t, _, _) if declname == fieldname { alt item.node.privacy { ast::priv { - cx.sess.span_fatal(sp, "Accessed private field outside \ + cx.sess.span_fatal(sp, "accessed private field outside \ its enclosing class"); } ast::pub { @@ -1858,7 +1858,7 @@ fn lookup_field_ty(cx: ty::ctxt, items:[@ast::class_item], _ { /* do nothing */ } } } - cx.sess.span_fatal(sp, #fmt("Unbound field %s", fieldname)); + cx.sess.span_fatal(sp, #fmt("unbound field %s", fieldname)); } fn check_expr_fn_with_unifier(fcx: @fn_ctxt, @@ -2843,20 +2843,20 @@ fn check_pred_expr(fcx: @fn_ctxt, e: @ast::expr) -> bool { } _ { fcx.ccx.tcx.sess.span_err(operator.span, - "Impure function as operator \ + "impure function as operator \ in constraint"); } } for operand: @ast::expr in operands { if !ast_util::is_constraint_arg(operand) { let s = - "Constraint args must be slot variables or literals"; + "constraint args must be slot variables or literals"; fcx.ccx.tcx.sess.span_err(e.span, s); } } } _ { - let s = "In a constraint, expected the \ + let s = "in a constraint, expected the \ constraint name to be an explicit name"; fcx.ccx.tcx.sess.span_err(e.span, s); } diff --git a/src/rustc/syntax/parse/parser.rs b/src/rustc/syntax/parse/parser.rs index e8df2f86305..216c9bb9df9 100644 --- a/src/rustc/syntax/parse/parser.rs +++ b/src/rustc/syntax/parse/parser.rs @@ -312,7 +312,7 @@ fn parse_ty_field(p: parser) -> ast::ty_field { fn ident_index(p: parser, args: [ast::arg], i: ast::ident) -> uint { let j = 0u; for a: ast::arg in args { if a.ident == i { ret j; } j += 1u; } - p.fatal("Unbound variable " + i + " in constraint arg"); + p.fatal("unbound variable `" + i + "` in constraint arg"); } fn parse_type_constr_arg(p: parser) -> @ast::ty_constr_arg { @@ -918,7 +918,7 @@ fn parse_bottom_expr(p: parser) -> pexpr { if /*check*/ast_util::is_call_expr(e) { hi = e.span.hi; ex = ast::expr_be(e); - } else { p.fatal("Non-call expression in tail call"); } + } else { p.fatal("non-call expression in tail call"); } } else if eat_word(p, "copy") { let e = parse_expr(p); ex = ast::expr_copy(e); @@ -2008,7 +2008,9 @@ fn parse_item_class(p: parser, attrs: [ast::attribute]) -> @ast::item { /* Is it strange for the parser to check this? */ - none { /* parse error */ fail "Class with no ctor"; } + none { + p.fatal("class with no ctor"); + } } } diff --git a/src/test/compile-fail/and-init.rs b/src/test/compile-fail/and-init.rs index b0b4c0da5e3..c053180bf43 100644 --- a/src/test/compile-fail/and-init.rs +++ b/src/test/compile-fail/and-init.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint (for example, init(i +// error-pattern:unsatisfied precondition constraint (for example, init(i fn main() { let i: int; diff --git a/src/test/compile-fail/block-deinitializes-upvar.rs b/src/test/compile-fail/block-deinitializes-upvar.rs index 6de84a2a163..f8434dfd9f9 100644 --- a/src/test/compile-fail/block-deinitializes-upvar.rs +++ b/src/test/compile-fail/block-deinitializes-upvar.rs @@ -1,4 +1,4 @@ -// error-pattern:Tried to deinitialize a variable declared in a different +// error-pattern:tried to deinitialize a variable declared in a different fn force(f: fn()) { f(); } fn main() { let x = @{x: 17, y: 2}; diff --git a/src/test/compile-fail/block-uninit.rs b/src/test/compile-fail/block-uninit.rs index 94df3392bbb..99b8346166a 100644 --- a/src/test/compile-fail/block-uninit.rs +++ b/src/test/compile-fail/block-uninit.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint +// error-pattern:unsatisfied precondition constraint fn force(f: fn()) { f(); } fn main() { let x: int; force(fn&() { log(error, x); }); } diff --git a/src/test/compile-fail/break-uninit.rs b/src/test/compile-fail/break-uninit.rs index b5e8d2a909f..294b5133725 100644 --- a/src/test/compile-fail/break-uninit.rs +++ b/src/test/compile-fail/break-uninit.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn foo() -> int { let x: int; diff --git a/src/test/compile-fail/break-uninit2.rs b/src/test/compile-fail/break-uninit2.rs index 262e536b445..8c882fa0c84 100644 --- a/src/test/compile-fail/break-uninit2.rs +++ b/src/test/compile-fail/break-uninit2.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn foo() -> int { let x: int; diff --git a/src/test/compile-fail/cap-clause-both-copy-and-move.rs b/src/test/compile-fail/cap-clause-both-copy-and-move.rs index c44897df737..033f4e6230a 100644 --- a/src/test/compile-fail/cap-clause-both-copy-and-move.rs +++ b/src/test/compile-fail/cap-clause-both-copy-and-move.rs @@ -1,4 +1,4 @@ -// error-pattern:Variable 'x' captured more than once +// error-pattern:variable 'x' captured more than once fn main() { let x = 5; let y = fn~[move x; copy x]() -> int { x }; diff --git a/src/test/compile-fail/cap-clause-double-copy.rs b/src/test/compile-fail/cap-clause-double-copy.rs index f4135fec248..8c22a4381ea 100644 --- a/src/test/compile-fail/cap-clause-double-copy.rs +++ b/src/test/compile-fail/cap-clause-double-copy.rs @@ -1,4 +1,4 @@ -// error-pattern:Variable 'x' captured more than once +// error-pattern:variable 'x' captured more than once fn main() { let x = 5; let y = fn~[copy x, x]() -> int { x }; diff --git a/src/test/compile-fail/cap-clause-double-move.rs b/src/test/compile-fail/cap-clause-double-move.rs index 498eb8255af..bd00726c97b 100644 --- a/src/test/compile-fail/cap-clause-double-move.rs +++ b/src/test/compile-fail/cap-clause-double-move.rs @@ -1,4 +1,4 @@ -// error-pattern:Variable 'x' captured more than once +// error-pattern:variable 'x' captured more than once fn main() { let x = 5; let y = fn~[move x, x]() -> int { x }; diff --git a/src/test/compile-fail/cap-clause-move-upvar.rs b/src/test/compile-fail/cap-clause-move-upvar.rs index 3d8ab43cc77..bb0ddcd3cf7 100644 --- a/src/test/compile-fail/cap-clause-move-upvar.rs +++ b/src/test/compile-fail/cap-clause-move-upvar.rs @@ -1,4 +1,4 @@ -// error-pattern:Upvars (like 'x') cannot be moved into a closure +// error-pattern:upvars (like 'x') cannot be moved into a closure fn main() { let x = 5; let _y = fn~[move x]() -> int { diff --git a/src/test/compile-fail/do-while-constraints.rs b/src/test/compile-fail/do-while-constraints.rs index 20bd01fb2ac..5464738294f 100644 --- a/src/test/compile-fail/do-while-constraints.rs +++ b/src/test/compile-fail/do-while-constraints.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint (for example, init(y +// error-pattern:unsatisfied precondition constraint (for example, init(y fn main() { let y: int = 42; diff --git a/src/test/compile-fail/do-while-pred-constraints.rs b/src/test/compile-fail/do-while-pred-constraints.rs index b044d56944b..027574c024c 100644 --- a/src/test/compile-fail/do-while-pred-constraints.rs +++ b/src/test/compile-fail/do-while-pred-constraints.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint (for example, even(y +// error-pattern:unsatisfied precondition constraint (for example, even(y fn print_even(y: int) : even(y) { log(debug, y); } diff --git a/src/test/compile-fail/fn-expr-type-state.rs b/src/test/compile-fail/fn-expr-type-state.rs index 935adc16ded..ab3f1dd1087 100644 --- a/src/test/compile-fail/fn-expr-type-state.rs +++ b/src/test/compile-fail/fn-expr-type-state.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn main() { // Typestate should work even in a fn@. we should reject this program. diff --git a/src/test/compile-fail/fn-expr-typestate-2.rs b/src/test/compile-fail/fn-expr-typestate-2.rs index 816593e0875..75682c8ddf8 100644 --- a/src/test/compile-fail/fn-expr-typestate-2.rs +++ b/src/test/compile-fail/fn-expr-typestate-2.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn main() { let j = fn@() -> int { let i: int; ret i; }(); diff --git a/src/test/compile-fail/if-check-precond-fail.rs b/src/test/compile-fail/if-check-precond-fail.rs index cd6ebeb126b..4545277e18d 100644 --- a/src/test/compile-fail/if-check-precond-fail.rs +++ b/src/test/compile-fail/if-check-precond-fail.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition constraint +// error-pattern:unsatisfied precondition constraint pure fn even(x: uint) -> bool { if x < 2u { ret false; diff --git a/src/test/compile-fail/issue-897-2.rs b/src/test/compile-fail/issue-897-2.rs index ec1c88f81a5..b2b0c0d3597 100644 --- a/src/test/compile-fail/issue-897-2.rs +++ b/src/test/compile-fail/issue-897-2.rs @@ -1,4 +1,4 @@ -// error-pattern: In non-returning function f, some control paths may return +// error-pattern:in non-returning function f, some control paths may return fn g() -> ! { fail; } fn f() -> ! { ret 42; g(); } fn main() { } diff --git a/src/test/compile-fail/issue-897.rs b/src/test/compile-fail/issue-897.rs index 3341ce5f974..7a27b0e51fd 100644 --- a/src/test/compile-fail/issue-897.rs +++ b/src/test/compile-fail/issue-897.rs @@ -1,3 +1,3 @@ -// error-pattern: In non-returning function f, some control paths may return +// error-pattern:in non-returning function f, some control paths may return fn f() -> ! { ret 42; fail; } fn main() { } diff --git a/src/test/compile-fail/move-arg.rs b/src/test/compile-fail/move-arg.rs index 711e9a7095c..512cd44e206 100644 --- a/src/test/compile-fail/move-arg.rs +++ b/src/test/compile-fail/move-arg.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint +// error-pattern:unsatisfied precondition constraint fn test(-foo: int) { assert (foo == 10); } fn main() { let x = 10; test(x); log(debug, x); } diff --git a/src/test/compile-fail/name-clash-nullary-2.rs b/src/test/compile-fail/name-clash-nullary-2.rs index 06b5fbe7efa..7626c802871 100644 --- a/src/test/compile-fail/name-clash-nullary-2.rs +++ b/src/test/compile-fail/name-clash-nullary-2.rs @@ -1,4 +1,4 @@ -// error-pattern:Declaration of thpppt shadows +// error-pattern:declaration of `thpppt` shadows enum ack { thpppt, ffff, } fn main() { diff --git a/src/test/compile-fail/name-clash-nullary.rs b/src/test/compile-fail/name-clash-nullary.rs index 36c131cde4d..87af60ebcaa 100644 --- a/src/test/compile-fail/name-clash-nullary.rs +++ b/src/test/compile-fail/name-clash-nullary.rs @@ -1,4 +1,4 @@ -// error-pattern:Declaration of none shadows +// error-pattern:declaration of `none` shadows import option::*; fn main() { diff --git a/src/test/compile-fail/no-constraint-prop.rs b/src/test/compile-fail/no-constraint-prop.rs index 27bccac911e..ec7f8076892 100644 --- a/src/test/compile-fail/no-constraint-prop.rs +++ b/src/test/compile-fail/no-constraint-prop.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition constraint (for example, uint::le +// error-pattern:unsatisfied precondition constraint (for example, uint::le fn main() unsafe { fn foo(_a: uint, _b: uint) : uint::le(_a, _b) {} diff --git a/src/test/compile-fail/not-a-pred-check.rs b/src/test/compile-fail/not-a-pred-check.rs index 9891360af9e..24016a70b2d 100644 --- a/src/test/compile-fail/not-a-pred-check.rs +++ b/src/test/compile-fail/not-a-pred-check.rs @@ -1,5 +1,5 @@ // -*- rust -*- -// error-pattern: Impure function as operator +// error-pattern:impure function as operator fn f(q: int) -> bool { ret true; } diff --git a/src/test/compile-fail/not-pred-args.rs b/src/test/compile-fail/not-pred-args.rs index 7a90f1cfa99..6fb5273e1e7 100644 --- a/src/test/compile-fail/not-pred-args.rs +++ b/src/test/compile-fail/not-pred-args.rs @@ -1,6 +1,6 @@ // -*- rust -*- -// error-pattern: Constraint args must be +// error-pattern:constraint args must be pure fn f(q: int) -> bool { ret true; } diff --git a/src/test/compile-fail/or-init.rs b/src/test/compile-fail/or-init.rs index 778a9d8cb7b..0bc339904ba 100644 --- a/src/test/compile-fail/or-init.rs +++ b/src/test/compile-fail/or-init.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint (for example, init(i +// error-pattern:unsatisfied precondition constraint (for example, init(i fn main() { let i: int; diff --git a/src/test/compile-fail/pred-assign.rs b/src/test/compile-fail/pred-assign.rs index f8975bb1889..8a7810cabb0 100644 --- a/src/test/compile-fail/pred-assign.rs +++ b/src/test/compile-fail/pred-assign.rs @@ -1,6 +1,6 @@ // -*- rust -*- -// error-pattern: Unsatisfied precondition constraint (for example, lt(a, b) +// error-pattern:unsatisfied precondition constraint (for example, lt(a, b) fn f(a: int, b: int) : lt(a, b) { } diff --git a/src/test/compile-fail/pred-swap.rs b/src/test/compile-fail/pred-swap.rs index 26cca68c5e4..3f506edc8a6 100644 --- a/src/test/compile-fail/pred-swap.rs +++ b/src/test/compile-fail/pred-swap.rs @@ -1,6 +1,6 @@ // -*- rust -*- -// error-pattern: Unsatisfied precondition constraint (for example, lt(a, b) +// error-pattern:unsatisfied precondition constraint (for example, lt(a, b) fn f(a: int, b: int) : lt(a, b) { } diff --git a/src/test/compile-fail/swap-uninit.rs b/src/test/compile-fail/swap-uninit.rs index 27fdc611379..fbf400db08a 100644 --- a/src/test/compile-fail/swap-uninit.rs +++ b/src/test/compile-fail/swap-uninit.rs @@ -1,3 +1,3 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn main() { let x = 3; let y; x <-> y; } diff --git a/src/test/compile-fail/tag-type-args.rs b/src/test/compile-fail/tag-type-args.rs index 5c71dc4af07..fb434a1f437 100644 --- a/src/test/compile-fail/tag-type-args.rs +++ b/src/test/compile-fail/tag-type-args.rs @@ -1,4 +1,4 @@ -// error-pattern: Wrong number of type arguments +// error-pattern:wrong number of type arguments enum quux<T> { bar } diff --git a/src/test/compile-fail/tail-non-call.rs b/src/test/compile-fail/tail-non-call.rs index 559065a00f4..f2622bc4dfa 100644 --- a/src/test/compile-fail/tail-non-call.rs +++ b/src/test/compile-fail/tail-non-call.rs @@ -1,4 +1,4 @@ -// error-pattern: Non-call expression in tail call +// error-pattern:non-call expression in tail call fn f() -> int { let x = 1; diff --git a/src/test/compile-fail/uninit-after-item.rs b/src/test/compile-fail/uninit-after-item.rs index bf34c5175eb..560c855a7e6 100644 --- a/src/test/compile-fail/uninit-after-item.rs +++ b/src/test/compile-fail/uninit-after-item.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition constraint (for example, init(bar +// error-pattern:unsatisfied precondition constraint (for example, init(bar fn main() { let bar; fn baz(x: int) { } diff --git a/src/test/compile-fail/use-after-move.rs b/src/test/compile-fail/use-after-move.rs index d4d42b55538..177ad0010be 100644 --- a/src/test/compile-fail/use-after-move.rs +++ b/src/test/compile-fail/use-after-move.rs @@ -1,2 +1,2 @@ -// error-pattern: Unsatisfied precondition constraint (for example, init(x +// error-pattern:unsatisfied precondition constraint (for example, init(x fn main() { let x = @5; let y <- x; log(debug, *x); } diff --git a/src/test/compile-fail/use-after-send.rs b/src/test/compile-fail/use-after-send.rs index 858cc62a944..3f1c0ab41e6 100644 --- a/src/test/compile-fail/use-after-send.rs +++ b/src/test/compile-fail/use-after-send.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint +// error-pattern:unsatisfied precondition constraint fn send<T: send>(ch: _chan<T>, -data: T) { log(debug, ch); log(debug, data); diff --git a/src/test/compile-fail/use-uninit-2.rs b/src/test/compile-fail/use-uninit-2.rs index be949453699..82946cf022a 100644 --- a/src/test/compile-fail/use-uninit-2.rs +++ b/src/test/compile-fail/use-uninit-2.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn foo(x: int) { log(debug, x); } diff --git a/src/test/compile-fail/use-uninit-3.rs b/src/test/compile-fail/use-uninit-3.rs index b824567133a..2a6522ab407 100644 --- a/src/test/compile-fail/use-uninit-3.rs +++ b/src/test/compile-fail/use-uninit-3.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn foo(x: int) { log(debug, x); } diff --git a/src/test/compile-fail/use-uninit.rs b/src/test/compile-fail/use-uninit.rs index 5c3c9a3cda7..3ad93fe0a08 100644 --- a/src/test/compile-fail/use-uninit.rs +++ b/src/test/compile-fail/use-uninit.rs @@ -1,4 +1,4 @@ -// error-pattern:Unsatisfied precondition +// error-pattern:unsatisfied precondition fn foo(x: int) { log(debug, x); } diff --git a/src/test/compile-fail/while-loop-constraints.rs b/src/test/compile-fail/while-loop-constraints.rs index 287ee2d684c..58757c8bfdd 100644 --- a/src/test/compile-fail/while-loop-constraints.rs +++ b/src/test/compile-fail/while-loop-constraints.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint (for example, init(y +// error-pattern:unsatisfied precondition constraint (for example, init(y fn main() { let y: int = 42; diff --git a/src/test/compile-fail/while-loop-pred-constraints.rs b/src/test/compile-fail/while-loop-pred-constraints.rs index aa31a3857dc..ea58c8377e0 100644 --- a/src/test/compile-fail/while-loop-pred-constraints.rs +++ b/src/test/compile-fail/while-loop-pred-constraints.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint (for example, even(y +// error-pattern:unsatisfied precondition constraint (for example, even(y fn print_even(y: int) : even(y) { log(debug, y); } diff --git a/src/test/compile-fail/writing-through-uninit-vec.rs b/src/test/compile-fail/writing-through-uninit-vec.rs index 0462824c276..283e925e207 100644 --- a/src/test/compile-fail/writing-through-uninit-vec.rs +++ b/src/test/compile-fail/writing-through-uninit-vec.rs @@ -1,4 +1,4 @@ -// error-pattern: Unsatisfied precondition constraint +// error-pattern:unsatisfied precondition constraint fn test() { let w: [int]; w[5] = 0; } |
