rustc: Lower case error messages
This commit is contained in:
parent
13a07ce1d4
commit
0ee96de4ee
@ -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);
|
||||
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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}) &&
|
||||
|
@ -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),
|
||||
|
@ -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;
|
||||
|
@ -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"); }
|
||||
};
|
||||
|
@ -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");
|
||||
}
|
||||
};
|
||||
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
}
|
||||
_ { }
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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};
|
||||
|
@ -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); }); }
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Unsatisfied precondition
|
||||
// error-pattern:unsatisfied precondition
|
||||
|
||||
fn foo() -> int {
|
||||
let x: int;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Unsatisfied precondition
|
||||
// error-pattern:unsatisfied precondition
|
||||
|
||||
fn foo() -> int {
|
||||
let x: int;
|
||||
|
@ -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 };
|
||||
|
@ -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 };
|
||||
|
@ -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 };
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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); }
|
||||
|
||||
|
@ -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.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Unsatisfied precondition
|
||||
// error-pattern:unsatisfied precondition
|
||||
|
||||
fn main() {
|
||||
let j = fn@() -> int { let i: int; ret i; }();
|
||||
|
@ -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;
|
||||
|
@ -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() { }
|
||||
|
@ -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() { }
|
||||
|
@ -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); }
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Declaration of thpppt shadows
|
||||
// error-pattern:declaration of `thpppt` shadows
|
||||
enum ack { thpppt, ffff, }
|
||||
|
||||
fn main() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Declaration of none shadows
|
||||
// error-pattern:declaration of `none` shadows
|
||||
import option::*;
|
||||
|
||||
fn main() {
|
||||
|
@ -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) {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// -*- rust -*-
|
||||
// error-pattern: Impure function as operator
|
||||
// error-pattern:impure function as operator
|
||||
|
||||
fn f(q: int) -> bool { ret true; }
|
||||
|
||||
|
@ -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; }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -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) { }
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
// error-pattern:Unsatisfied precondition
|
||||
// error-pattern:unsatisfied precondition
|
||||
|
||||
fn main() { let x = 3; let y; x <-> y; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern: Wrong number of type arguments
|
||||
// error-pattern:wrong number of type arguments
|
||||
|
||||
enum quux<T> { bar }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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) { }
|
||||
|
@ -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); }
|
||||
|
@ -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);
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Unsatisfied precondition
|
||||
// error-pattern:unsatisfied precondition
|
||||
|
||||
fn foo(x: int) { log(debug, x); }
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Unsatisfied precondition
|
||||
// error-pattern:unsatisfied precondition
|
||||
|
||||
fn foo(x: int) { log(debug, x); }
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern:Unsatisfied precondition
|
||||
// error-pattern:unsatisfied precondition
|
||||
|
||||
fn foo(x: int) { log(debug, x); }
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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); }
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern: Unsatisfied precondition constraint
|
||||
// error-pattern:unsatisfied precondition constraint
|
||||
|
||||
fn test() { let w: [int]; w[5] = 0; }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user