aboutsummaryrefslogtreecommitdiff
path: root/src/boot/driver/session.ml
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-07-20 13:55:56 -0700
committerGraydon Hoare <[email protected]>2010-07-20 13:55:56 -0700
commit62522def7409a233f5316546cd6bee91e812a039 (patch)
tree5ac4085ee755b9c83bdd378d6460d4a57ebb0846 /src/boot/driver/session.ml
parentRe-XFAIL stuff that is definitely still unsupported in LLVM-land (like, throw... (diff)
downloadrust-62522def7409a233f5316546cd6bee91e812a039.tar.xz
rust-62522def7409a233f5316546cd6bee91e812a039.zip
Tidy up handling of unimplemented features. These are expected (if undesirable) sorts of error, we should handle better than "backtrace and exit 2".
Diffstat (limited to 'src/boot/driver/session.ml')
-rw-r--r--src/boot/driver/session.ml13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/boot/driver/session.ml b/src/boot/driver/session.ml
index 80253f44..210dd7be 100644
--- a/src/boot/driver/session.ml
+++ b/src/boot/driver/session.ml
@@ -101,6 +101,19 @@ let filename_of (fo:filename option) : filename =
| Some f -> f
;;
+let report_err sess ido str =
+ let spano = match ido with
+ None -> None
+ | Some id -> get_span sess id
+ in
+ match spano with
+ None ->
+ fail sess "Error: %s\n%!" str
+ | Some span ->
+ fail sess "%s:E:Error: %s\n%!"
+ (string_of_span span) str
+;;
+
(*
* Local Variables:
* fill-column: 78;