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

@ -59,7 +59,7 @@ fn parse_input(session::session sess, parser::parser p, str input) ->
parser::parse_crate_from_crate_file(p)
} else if (str::ends_with(input, ".rs")) {
parser::parse_crate_from_source_file(p)
} else { sess.err("unknown input file type: " + input); fail };
} else { sess.fatal("unknown input file type: " + input); fail };
}
fn time[T](bool do_it, str what, fn() -> T thunk) -> T {
@ -282,7 +282,7 @@ fn parse_pretty(session::session sess, &str name) -> pp_mode {
} else if (str::eq(name, "typed")) {
ret ppm_typed;
} else if (str::eq(name, "identified")) { ret ppm_identified; }
sess.err("argument to `pretty` must be one of `normal`, `typed`, or " +
sess.fatal("argument to `pretty` must be one of `normal`, `typed`, or " +
"`identified`");
}
@ -321,16 +321,16 @@ fn main(vec[str] args) {
auto glue = opt_present(match, "glue");
if (glue) {
if (n_inputs > 0u) {
sess.err("No input files allowed with --glue.");
sess.fatal("No input files allowed with --glue.");
}
auto out = option::from_maybe[str]("glue.bc", output_file);
middle::trans::make_common_glue(sess, out);
ret;
}
if (n_inputs == 0u) {
sess.err("No input filename given.");
sess.fatal("No input filename given.");
} else if (n_inputs > 1u) {
sess.err("Multiple input filenames provided.");
sess.fatal("Multiple input filenames provided.");
}
auto ifile = match.free.(0);
let str saved_out_filename = "";

View file

@ -70,13 +70,13 @@ obj session(ast::crate_num cnum,
fn get_targ_cfg() -> @config { ret targ_cfg; }
fn get_opts() -> @options { ret opts; }
fn get_targ_crate_num() -> ast::crate_num { ret cnum; }
fn span_err(span sp, str msg) -> ! {
fn span_fatal(span sp, str msg) -> ! {
// FIXME: Use constants, but rustboot doesn't know how to export them.
emit_diagnostic(some(sp), msg, "error", 9u8, cm);
fail;
}
fn err(str msg) -> ! {
fn fatal(str msg) -> ! {
emit_diagnostic(none[span], msg, "error", 9u8, cm);
fail;
}
@ -94,10 +94,10 @@ obj session(ast::crate_num cnum,
emit_diagnostic(some(sp), msg, "note", 10u8, cm);
}
fn span_bug(span sp, str msg) -> ! {
self.span_err(sp, #fmt("internal compiler error %s", msg));
self.span_fatal(sp, #fmt("internal compiler error %s", msg));
}
fn bug(str msg) -> ! {
self.err(#fmt("internal compiler error %s", msg));
self.fatal(#fmt("internal compiler error %s", msg));
}
fn span_unimpl(span sp, str msg) -> ! {
self.span_bug(sp, "unimplemented " + msg);