rustc: Rename session.span_err -> span_fatal, err -> fatal

Issue #440
This commit is contained in:
Brian Anderson 2011-06-18 22:41:20 -07:00
parent 514813148b
commit c394a7f49a
16 changed files with 136 additions and 130 deletions

View file

@ -92,7 +92,7 @@ fn visit_expr(@ctx cx, &@ast::expr ex, &scope sc, &vt[scope] v) {
case (some(?ex)) {
auto root = expr_root(*cx, ex, false);
if (mut_field(root.ds)) {
cx.tcx.sess.span_err(ex.span,
cx.tcx.sess.span_fatal(ex.span,
"result of put must be" +
" immutably rooted");
}
@ -148,7 +148,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
auto m =
"passing a temporary value or \
immutable field by mutable alias";
cx.tcx.sess.span_err(arg.span, m);
cx.tcx.sess.span_fatal(arg.span, m);
}
}
}
@ -171,7 +171,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
alt (f.node) {
case (ast::expr_path(_, ?ann)) {
if (def_is_local(cx.tcx.def_map.get(ann.id), true)) {
cx.tcx.sess.span_err(f.span,
cx.tcx.sess.span_fatal(f.span,
#fmt("function may alias with \
argument %u, which is not immutably rooted",
unsafe_t_offsets.(0)));
@ -190,7 +190,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
if (i != offset &&
ty_can_unsafely_include(cx, unsafe, arg_t.ty, mut_alias))
{
cx.tcx.sess.span_err(args.(i).span,
cx.tcx.sess.span_fatal(args.(i).span,
#fmt("argument %u may alias with \
argument %u, which is not immutably rooted",
i, offset));
@ -208,7 +208,7 @@ fn check_call(&ctx cx, &@ast::expr f, &vec[@ast::expr] args, &scope sc) ->
}
}
if (mut_alias_to_root) {
cx.tcx.sess.span_err(args.(root._0).span,
cx.tcx.sess.span_fatal(args.(root._0).span,
"passing a mutable alias to a \
variable that roots another alias");
}
@ -377,10 +377,10 @@ fn check_assign(&@ctx cx, &@ast::expr dest, &@ast::expr src, &scope sc,
case (ast::expr_path(?p, ?ann)) {
auto dnum = ast::def_id_of_def(cx.tcx.def_map.get(ann.id))._1;
if (is_immutable_alias(cx, sc, dnum)) {
cx.tcx.sess.span_err(dest.span,
cx.tcx.sess.span_fatal(dest.span,
"assigning to immutable alias");
} else if (is_immutable_objfield(cx, dnum)) {
cx.tcx.sess.span_err(dest.span,
cx.tcx.sess.span_fatal(dest.span,
"assigning to immutable obj field");
}
auto var_t = ty::expr_ty(*cx.tcx, dest);
@ -394,7 +394,7 @@ fn check_assign(&@ctx cx, &@ast::expr dest, &@ast::expr src, &scope sc,
case (_) {
auto root = expr_root(*cx, dest, false);
if (vec::len(root.ds) == 0u) {
cx.tcx.sess.span_err(dest.span, "assignment to non-lvalue");
cx.tcx.sess.span_fatal(dest.span, "assignment to non-lvalue");
} else if (!root.ds.(0).mut) {
auto name =
alt (root.ds.(0).kind) {
@ -402,7 +402,7 @@ fn check_assign(&@ctx cx, &@ast::expr dest, &@ast::expr src, &scope sc,
case (field) { "field" }
case (index) { "vec content" }
};
cx.tcx.sess.span_err(dest.span,
cx.tcx.sess.span_fatal(dest.span,
"assignment to immutable " + name);
}
visit_expr(cx, dest, sc, v);
@ -441,7 +441,7 @@ fn test_scope(&ctx cx, &scope sc, &restrict r, &ast::path p) {
tup(sp, "taking the value of " + ast::path_name(vpt))
}
};
cx.tcx.sess.span_err(msg._0,
cx.tcx.sess.span_fatal(msg._0,
msg._1 + " will invalidate alias " +
ast::path_name(p) + ", which is still used");
}

View file

@ -307,7 +307,7 @@ fn resolve_names(&@env e, &@ast::crate c) {
e.def_map.insert(a.id, fnd);
}
case (_) {
e.sess.span_err(p.span,
e.sess.span_fatal(p.span,
"not a tag variant: " +
ast::path_name(p));
}
@ -380,7 +380,7 @@ fn follow_import(&env e, &scopes sc, vec[ident] path, &span sp) -> def {
case (ast::def_mod(?def_id)) { ret dcur; }
case (ast::def_native_mod(?def_id)) { ret dcur; }
case (_) {
e.sess.span_err(sp,
e.sess.span_fatal(sp,
str::connect(path, "::") +
" does not name a module.");
}
@ -399,7 +399,7 @@ fn resolve_constr(@env e, &def_id d_id, &@ast::constr c, &scopes sc,
add_constr(e, d_id, new_constr);
}
case (_) {
e.sess.span_err(c.span,
e.sess.span_fatal(c.span,
"Non-predicate in constraint: " +
ty::path_to_str(c.node.path));
}
@ -478,7 +478,7 @@ fn ns_name(namespace ns) -> str {
}
fn unresolved(&env e, &span sp, &ident id, &str kind) -> ! {
e.sess.span_err(sp, "unresolved " + kind + ": " + id);
e.sess.span_fatal(sp, "unresolved " + kind + ": " + id);
}
@ -599,7 +599,7 @@ fn lookup_in_scope(&env e, scopes sc, &span sp, &ident id, namespace ns) ->
auto df = option::get(fnd);
if (left_fn && def_is_local(df) ||
left_fn_level2 && def_is_obj_field(df)) {
e.sess.span_err(sp,
e.sess.span_fatal(sp,
"attempted dynamic \
environment-capture");
}
@ -806,7 +806,7 @@ fn lookup_import(&env e, def_id defid, namespace ns) -> option::t[def] {
resolve_import(e, item, sc);
ret lookup_import(e, defid, ns);
}
case (resolving(?sp)) { e.sess.span_err(sp, "cyclic import"); }
case (resolving(?sp)) { e.sess.span_fatal(sp, "cyclic import"); }
case (resolved(?val, ?typ, ?md)) {
ret alt (ns) {
case (ns_value) { val }
@ -881,7 +881,7 @@ fn lookup_glob_in_mod(&env e, @indexed_mod info, &span sp, &ident id,
}
}
}
e.sess.span_err(sp,
e.sess.span_fatal(sp,
"'" + id + "' is glob-imported from" +
" multiple different modules.");
}
@ -1086,7 +1086,7 @@ fn check_mod_name(&env e, &ident name, list[mod_index_entry] entries) {
auto saw_type = false;
auto saw_value = false;
fn dup(&env e, &span sp, &str word, &ident name) {
e.sess.span_err(sp, "duplicate definition of " + word + name);
e.sess.span_fatal(sp, "duplicate definition of " + word + name);
}
while (true) {
alt (entries) {
@ -1222,7 +1222,7 @@ fn checker(&env e, str kind) -> checker {
fn add_name(&checker ch, &span sp, &ident id) {
for (ident s in ch.seen) {
if (str::eq(s, id)) {
ch.sess.span_err(sp, "duplicate " + ch.kind + " name: " + id);
ch.sess.span_fatal(sp, "duplicate " + ch.kind + " name: " + id);
}
}
vec::push(ch.seen, id);

View file

@ -677,7 +677,7 @@ fn T_opaque_chan_ptr() -> TypeRef { ret T_ptr(T_i8()); }
// TODO: Enforce via a predicate.
fn type_of(&@crate_ctxt cx, &span sp, &ty::t t) -> TypeRef {
if (ty::type_has_dynamic_size(cx.tcx, t)) {
cx.sess.span_err(sp,
cx.sess.span_fatal(sp,
"type_of() called on a type with dynamic size: " +
ty_to_str(cx.tcx, t));
}
@ -881,7 +881,7 @@ fn type_of_inner(&@crate_ctxt cx, &span sp, &ty::t t) -> TypeRef {
llty = abs_pair;
}
case (ty::ty_var(_)) {
cx.tcx.sess.span_err(sp, "trans::type_of called on ty_var");
cx.tcx.sess.span_fatal(sp, "trans::type_of called on ty_var");
}
case (ty::ty_param(_)) { llty = T_i8(); }
case (ty::ty_type) { llty = T_ptr(T_tydesc(cx.tn)); }
@ -1226,7 +1226,7 @@ fn simplify_type(&@crate_ctxt ccx, &ty::t typ) -> ty::t {
// Computes the size of the data part of a non-dynamically-sized tag.
fn static_size_of_tag(&@crate_ctxt cx, &span sp, &ty::t t) -> uint {
if (ty::type_has_dynamic_size(cx.tcx, t)) {
cx.tcx.sess.span_err(sp,
cx.tcx.sess.span_fatal(sp,
"dynamically sized type passed to " +
"static_size_of_tag()");
}
@ -1236,7 +1236,7 @@ fn static_size_of_tag(&@crate_ctxt cx, &span sp, &ty::t t) -> uint {
alt (ty::struct(cx.tcx, t)) {
case (ty::ty_tag(?tid_, ?subtys_)) { tid = tid_; subtys = subtys_; }
case (_) {
cx.tcx.sess.span_err(sp,
cx.tcx.sess.span_fatal(sp,
"non-tag passed to " +
"static_size_of_tag()");
}
@ -5983,7 +5983,7 @@ fn trans_log(int lvl, &@block_ctxt cx, &@ast::expr e) -> result {
case (_) {
// FIXME: Support these types.
cx.fcx.lcx.ccx.sess.span_err(e.span,
cx.fcx.lcx.ccx.sess.span_fatal(e.span,
"log called on unsupported type "
+
ty_to_str(cx.fcx.lcx.ccx.tcx,
@ -6088,7 +6088,7 @@ fn trans_break_cont(&span sp, &@block_ctxt cx, bool to_end) -> result {
alt ({ cleanup_cx.parent }) {
case (parent_some(?cx)) { cleanup_cx = cx; }
case (parent_none) {
cx.fcx.lcx.ccx.sess.span_err(sp,
cx.fcx.lcx.ccx.sess.span_fatal(sp,
if (to_end) {
"Break"
} else { "Cont" } +
@ -7621,7 +7621,7 @@ fn decl_fn_and_pair(&@crate_ctxt ccx, &span sp, vec[str] path, str flav,
register_fn_pair(ccx, ps, llfty, llfn, id);
if (is_main) {
if (ccx.main_fn != none[ValueRef]) {
ccx.sess.span_err(sp, "multiple 'main' functions");
ccx.sess.span_fatal(sp, "multiple 'main' functions");
}
llvm::LLVMSetLinkage(llfn,
lib::llvm::LLVMExternalLinkage as llvm::Linkage);

View file

@ -560,7 +560,7 @@ fn expr_to_constr_arg(ty::ctxt tcx, &@expr e) -> @constr_arg_use {
}
case (expr_lit(?l, _)) { ret @respan(e.span, carg_lit(l)); }
case (_) {
tcx.sess.span_err(e.span,
tcx.sess.span_fatal(e.span,
"Arguments to constrained functions must be "
+ "literals or local variables");
}
@ -587,7 +587,7 @@ fn expr_to_constr(ty::ctxt tcx, &@expr e) -> constr {
exprs_to_constr_args(tcx, args))));
}
case (_) {
tcx.sess.span_err(operator.span,
tcx.sess.span_fatal(operator.span,
"Internal error: " +
" ill-formed operator \
in predicate");
@ -595,7 +595,7 @@ fn expr_to_constr(ty::ctxt tcx, &@expr e) -> constr {
}
}
case (_) {
tcx.sess.span_err(e.span,
tcx.sess.span_fatal(e.span,
"Internal error: " + " ill-formed predicate");
}
}
@ -626,7 +626,8 @@ fn substitute_arg(&ty::ctxt cx, &vec[@expr] actuals, @ast::constr_arg a) ->
if (i < num_actuals) {
ret expr_to_constr_arg(cx, actuals.(i));
} else {
cx.sess.span_err(a.span, "Constraint argument out of bounds");
cx.sess.span_fatal(a.span,
"Constraint argument out of bounds");
}
}
case (carg_base) { ret @respan(a.span, carg_base); }
@ -636,7 +637,7 @@ fn substitute_arg(&ty::ctxt cx, &vec[@expr] actuals, @ast::constr_arg a) ->
fn path_to_ident(&ty::ctxt cx, &path p) -> ident {
alt (vec::last(p.node.idents)) {
case (none) { cx.sess.span_err(p.span, "Malformed path"); }
case (none) { cx.sess.span_fatal(p.span, "Malformed path"); }
case (some(?i)) { ret i; }
}
}

View file

@ -85,7 +85,7 @@ fn check_states_expr(&fn_ctxt fcx, &@expr e) {
s += bitv_to_str(fcx, prec);
s += "\nPrestate:\n";
s += bitv_to_str(fcx, pres);
fcx.ccx.tcx.sess.span_err(e.span, s);
fcx.ccx.tcx.sess.span_fatal(e.span, s);
}
}
@ -114,7 +114,7 @@ fn check_states_stmt(&fn_ctxt fcx, &@stmt s) {
ss += bitv_to_str(fcx, prec);
ss += "\nPrestate: \n";
ss += bitv_to_str(fcx, pres);
fcx.ccx.tcx.sess.span_err(s.span, ss);
fcx.ccx.tcx.sess.span_fatal(s.span, ss);
}
}
@ -153,7 +153,7 @@ fn check_states_against_conditions(&fn_ctxt fcx, &_fn f, &ann a,
"In function " + fcx.name +
", not all control paths \
return a value");
fcx.ccx.tcx.sess.span_err(f.decl.output.span,
fcx.ccx.tcx.sess.span_fatal(f.decl.output.span,
"see declared return type of '" +
ty_to_str(*f.decl.output) + "'");
} else if (f.decl.cf == noreturn) {
@ -162,7 +162,7 @@ fn check_states_against_conditions(&fn_ctxt fcx, &_fn f, &ann a,
// the fcx.id bit means "returns" for a returning fn,
// "diverges" for a non-returning fn
if (!promises(fcx, post, ret_c)) {
fcx.ccx.tcx.sess.span_err(f.body.span,
fcx.ccx.tcx.sess.span_fatal(f.body.span,
"In non-returning function " + fcx.name
+
", some control paths may \

View file

@ -1679,7 +1679,7 @@ fn field_num(&session::session sess, &span sp, &ast::ident id) -> uint {
for (u8 c in id) {
if (i == 0u) {
if (c != '_' as u8) {
sess.span_err(sp,
sess.span_fatal(sp,
"bad numeric field on tuple: " +
"missing leading underscore");
}
@ -1690,7 +1690,7 @@ fn field_num(&session::session sess, &span sp, &ast::ident id) -> uint {
} else {
auto s = "";
s += str::unsafe_from_byte(c);
sess.span_err(sp,
sess.span_fatal(sp,
"bad numeric field on tuple: " +
" non-digit character: " + s);
}
@ -1704,14 +1704,14 @@ fn field_idx(&session::session sess, &span sp, &ast::ident id,
&vec[field] fields) -> uint {
let uint i = 0u;
for (field f in fields) { if (str::eq(f.ident, id)) { ret i; } i += 1u; }
sess.span_err(sp, "unknown field '" + id + "' of record");
sess.span_fatal(sp, "unknown field '" + id + "' of record");
}
fn method_idx(&session::session sess, &span sp, &ast::ident id,
&vec[method] meths) -> uint {
let uint i = 0u;
for (method m in meths) { if (str::eq(m.ident, id)) { ret i; } i += 1u; }
sess.span_err(sp, "unknown method '" + id + "' of obj");
sess.span_fatal(sp, "unknown method '" + id + "' of obj");
}
fn sort_methods(&vec[method] meths) -> vec[method] {

View file

@ -114,7 +114,7 @@ fn ty_param_count_and_ty_for_def(&@fn_ctxt fcx, &span sp, &ast::def defn) ->
ret tup(0u, ty::mk_nil(fcx.ccx.tcx));
}
case (ast::def_ty(_)) {
fcx.ccx.tcx.sess.span_err(sp, "expected value but found type");
fcx.ccx.tcx.sess.span_fatal(sp, "expected value but found type");
}
case (_) {
// FIXME: handle other names.
@ -152,7 +152,7 @@ fn instantiate_path(&@fn_ctxt fcx, &ast::path pth, &ty_param_count_and_ty tpt,
}
ty_substs_opt = some[vec[ty::t]](ty_substs);
if (ty_param_count == 0u) {
fcx.ccx.tcx.sess.span_err(sp,
fcx.ccx.tcx.sess.span_fatal(sp,
"this item does not take type " +
"parameters");
fail;
@ -188,7 +188,7 @@ fn structurally_resolved_type(&@fn_ctxt fcx, &span sp, ty::t typ) -> ty::t {
alt (r) {
case (fix_ok(?typ_s)) { ret typ_s; }
case (fix_err(_)) {
fcx.ccx.tcx.sess.span_err(sp,
fcx.ccx.tcx.sess.span_fatal(sp,
"the type of this value must be " +
"known in this context");
}
@ -219,7 +219,7 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
alt (tcx.ast_ty_to_ty_cache.find(ast_ty)) {
case (some[option::t[ty::t]](some[ty::t](?ty))) { ret ty; }
case (some[option::t[ty::t]](none)) {
tcx.sess.span_err(ast_ty.span,
tcx.sess.span_fatal(ast_ty.span,
"illegal recursive type " +
"(insert a tag in the cycle, " +
"if this is desired)");
@ -252,7 +252,7 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
}
if (vec::len(param_bindings) !=
ty::count_ty_params(tcx, params_opt_and_ty._1)) {
tcx.sess.span_err(sp,
tcx.sess.span_fatal(sp,
"Wrong number of type arguments for a" +
" polymorphic tag");
}
@ -333,7 +333,7 @@ fn ast_ty_to_ty(&ty::ctxt tcx, &ty_getter getter, &@ast::ty ast_ty) -> ty::t {
}
case (ast::def_ty_arg(?id)) { typ = ty::mk_param(tcx, id); }
case (_) {
tcx.sess.span_err(ast_ty.span,
tcx.sess.span_fatal(ast_ty.span,
"found type name used as a variable");
}
}
@ -508,7 +508,7 @@ mod collect {
if (ty::type_has_dynamic_size(cx.tcx, tt)) {
alt (ty_mode) {
case (mo_val) {
cx.tcx.sess.span_err(a.ty.span,
cx.tcx.sess.span_fatal(a.ty.span,
"Dynamically sized arguments \
must be passed by alias");
}
@ -916,7 +916,7 @@ mod demand {
case (ures_err(?err)) {
auto e_err = resolve_type_vars_if_possible(fcx, expected_1);
auto a_err = resolve_type_vars_if_possible(fcx, actual_1);
fcx.ccx.tcx.sess.span_err(sp,
fcx.ccx.tcx.sess.span_fatal(sp,
"mismatched types: expected " +
ty_to_str(fcx.ccx.tcx, e_err) +
" but found " +
@ -982,7 +982,7 @@ mod writeback {
alt (ty::unify::fixup_vars(fcx.ccx.tcx, fcx.var_bindings, typ)) {
case (fix_ok(?new_type)) { ret new_type; }
case (fix_err(?vid)) {
fcx.ccx.tcx.sess.span_err(sp,
fcx.ccx.tcx.sess.span_fatal(sp,
"cannot determine a type \
for this expression");
}
@ -1026,7 +1026,7 @@ mod writeback {
write::ty_only(fcx.ccx.tcx, l.node.ann.id, lty);
}
case (fix_err(_)) {
fcx.ccx.tcx.sess.span_err(l.span,
fcx.ccx.tcx.sess.span_fatal(l.span,
"cannot determine a type \
for this local variable");
}
@ -1232,7 +1232,7 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat, ty::t expected) {
// FIXME: Switch expected and actual in this message? I
// can never tell.
fcx.ccx.tcx.sess.span_err(pat.span,
fcx.ccx.tcx.sess.span_fatal(pat.span,
#fmt("mismatched types: \
expected tag, found %s",
ty_to_str(fcx.ccx.tcx,
@ -1271,7 +1271,7 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat, ty::t expected) {
if (arg_len == 1u) {
""
} else { "s" });
fcx.ccx.tcx.sess.span_err(pat.span, s);
fcx.ccx.tcx.sess.span_fatal(pat.span, s);
}
// TODO: vec::iter2
@ -1285,7 +1285,7 @@ fn check_pat(&@fn_ctxt fcx, &@ast::pat pat, ty::t expected) {
// TODO (issue #448): Wrap a #fmt string over multiple
// lines...
fcx.ccx.tcx.sess.span_err(pat.span,
fcx.ccx.tcx.sess.span_fatal(pat.span,
#fmt("this pattern has %u field%s, \
but the corresponding \
variant has no fields",
@ -1303,7 +1303,7 @@ fn require_impure(&session::session sess, &ast::purity f_purity, &span sp) {
alt (f_purity) {
case (ast::impure_fn) { ret; }
case (ast::pure_fn) {
sess.span_err(sp,
sess.span_fatal(sp,
"Found impure expression in pure function decl");
}
}
@ -1328,14 +1328,14 @@ fn require_pure_call(@crate_ctxt ccx, &ast::purity caller_purity,
alt (get_function_purity(ccx, d_id)) {
case (ast::pure_fn) { ret; }
case (_) {
ccx.tcx.sess.span_err(sp,
ccx.tcx.sess.span_fatal(sp,
"Pure function calls \
impure function");
}
}
}
case (_) {
ccx.tcx.sess.span_err(sp,
ccx.tcx.sess.span_fatal(sp,
"Pure function calls \
unknown function");
}
@ -1347,7 +1347,7 @@ fn require_pure_call(@crate_ctxt ccx, &ast::purity caller_purity,
fn require_pure_function(@crate_ctxt ccx, &ast::def_id d_id, &span sp) {
alt (get_function_purity(ccx, d_id)) {
case (ast::impure_fn) {
ccx.tcx.sess.span_err(sp,
ccx.tcx.sess.span_fatal(sp,
"Found non-predicate in check expression");
}
case (_) { ret; }
@ -1376,7 +1376,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
case (ty::ty_fn(_, ?arg_tys_0, _, _, _)) { arg_tys = arg_tys_0; }
case (ty::ty_native_fn(_, ?arg_tys_0, _)) { arg_tys = arg_tys_0; }
case (_) {
fcx.ccx.tcx.sess.span_err(f.span,
fcx.ccx.tcx.sess.span_fatal(f.span,
"mismatched types: \
expected function or native \
function but found "
@ -1388,7 +1388,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
auto expected_arg_count = vec::len[ty::arg](arg_tys);
auto supplied_arg_count = vec::len[option::t[@ast::expr]](args);
if (expected_arg_count != supplied_arg_count) {
fcx.ccx.tcx.sess.span_err(sp,
fcx.ccx.tcx.sess.span_fatal(sp,
#fmt("this function takes %u \
parameter%s but %u parameter%s \
supplied",
@ -1474,7 +1474,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
if (!ast::is_constraint_arg(operand)) {
auto s = "Constraint args must be \
slot variables or literals";
fcx.ccx.tcx.sess.span_err(e.span, s);
fcx.ccx.tcx.sess.span_fatal(e.span, s);
}
}
require_pure_function(fcx.ccx, d_id, e.span);
@ -1482,12 +1482,12 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
case (_) {
auto s = "In a constraint, expected the \
constraint name to be an explicit name";
fcx.ccx.tcx.sess.span_err(e.span,s);
fcx.ccx.tcx.sess.span_fatal(e.span,s);
}
}
}
case (_) {
fcx.ccx.tcx.sess.span_err(e.span,
fcx.ccx.tcx.sess.span_fatal(e.span,
"check on non-predicate");
}
}
@ -1555,7 +1555,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
case (_) {
auto s = "dereferencing non-box type: " +
ty_to_str(fcx.ccx.tcx, oper_t);
fcx.ccx.tcx.sess.span_err(expr.span, s);
fcx.ccx.tcx.sess.span_fatal(expr.span, s);
}
}
}
@ -1563,7 +1563,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
if (!type_is_integral(fcx, oper.span, oper_t) &&
structure_of(fcx, oper.span, oper_t) !=
ty::ty_bool) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
#fmt("mismatched types: \
expected bool or \
integer but found %s",
@ -1588,7 +1588,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
// supplied some, that's an error.
if (vec::len[@ast::ty](pth.node.types) > 0u) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"this kind of value does not \
take type parameters");
}
@ -1607,7 +1607,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
case (none) {
auto nil = ty::mk_nil(fcx.ccx.tcx);
if (!are_compatible(fcx, fcx.ret_ty, nil)) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"ret; in function \
returning non-nil");
}
@ -1627,7 +1627,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
case (none) {
auto nil = ty::mk_nil(fcx.ccx.tcx);
if (!are_compatible(fcx, fcx.ret_ty, nil)) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"put; in iterator \
yielding non-nil");
}
@ -1696,7 +1696,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
but found %s",
ty_to_str(fcx.ccx.tcx,
lhs_t));
fcx.ccx.tcx.sess.span_err(expr.span,s);
fcx.ccx.tcx.sess.span_fatal(expr.span,s);
}
}
write::ty_only_fixup(fcx, a.id, chan_t);
@ -1726,7 +1726,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
elt_ty = ty::mk_mach(fcx.ccx.tcx, util::common::ty_u8);
}
case (_) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"type of for loop iterator \
is not a vector or string");
}
@ -1916,7 +1916,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
if (!(type_is_scalar(fcx, expr.span, expr_ty(fcx.ccx.tcx, e)) &&
type_is_scalar(fcx, expr.span, t_1))) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"non-scalar cast: " +
ty_to_str(fcx.ccx.tcx,
expr_ty(fcx.ccx.tcx,
@ -1984,7 +1984,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
alt (structure_of(fcx, expr.span, bexpr_t)) {
case (ty::ty_rec(?flds)) { base_fields = flds; }
case (_) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"record update \
non-record base");
}
@ -2000,7 +2000,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
}
}
if (!found) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"unknown field in \
record update: "
+ f.ident);
@ -2018,7 +2018,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
let uint ix =
ty::field_num(fcx.ccx.tcx.sess, expr.span, field);
if (ix >= vec::len[ty::mt](args)) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"bad index on tuple");
}
write::ty_only_fixup(fcx, a.id, args.(ix).ty);
@ -2028,7 +2028,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
ty::field_idx(fcx.ccx.tcx.sess, expr.span, field,
fields);
if (ix >= vec::len[ty::field](fields)) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"bad index on record");
}
write::ty_only_fixup(fcx, a.id, fields.(ix).mt.ty);
@ -2038,7 +2038,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
ty::method_idx(fcx.ccx.tcx.sess, expr.span, field,
methods);
if (ix >= vec::len[ty::method](methods)) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"bad index on obj");
}
auto meth = methods.(ix);
@ -2063,7 +2063,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
check_expr(fcx, idx);
auto idx_t = expr_ty(fcx.ccx.tcx, idx);
if (!type_is_integral(fcx, idx.span, idx_t)) {
fcx.ccx.tcx.sess.span_err(idx.span,
fcx.ccx.tcx.sess.span_fatal(idx.span,
"mismatched types: expected \
integer but found "
+ ty_to_str(fcx.ccx.tcx, idx_t));
@ -2084,7 +2084,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
write::ty_only_fixup(fcx, a.id, typ);
}
case (_) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"vector-indexing bad type: " +
ty_to_str(fcx.ccx.tcx,
base_t));
@ -2105,7 +2105,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
write::ty_only_fixup(fcx, a.id, ct);
}
case (_) {
fcx.ccx.tcx.sess.span_err(expr.span,
fcx.ccx.tcx.sess.span_fatal(expr.span,
"bad port type: " +
ty_to_str(fcx.ccx.tcx,
port_t));
@ -2218,7 +2218,7 @@ fn ast_constr_to_constr(ty::ctxt tcx, &@ast::constr c)
id=pred_id));
}
case (_) {
tcx.sess.span_err(c.span, "Predicate "
tcx.sess.span_fatal(c.span, "Predicate "
+ path_to_str(c.node.path)
+ " is unbound or bound to a non-function");
}
@ -2339,7 +2339,7 @@ fn check_fn(&@crate_ctxt ccx, &ast::fn_decl decl, ast::proto proto,
// per the previous comment, this just checks that the declared
// type is bool, and trusts that that's the actual return type.
if (!ty::type_is_bool(ccx.tcx, fcx.ret_ty)) {
ccx.tcx.sess.span_err(body.span,
ccx.tcx.sess.span_fatal(body.span,
"Non-boolean return type in pred");
}
}