aboutsummaryrefslogtreecommitdiff
path: root/src/boot/fe
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/fe
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/fe')
-rw-r--r--src/boot/fe/ast.ml12
-rw-r--r--src/boot/fe/cexp.ml9
2 files changed, 13 insertions, 8 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml
index b70b2b88..76e6e306 100644
--- a/src/boot/fe/ast.ml
+++ b/src/boot/fe/ast.ml
@@ -457,6 +457,18 @@ and crate' =
and crate = crate' identified
;;
+let empty_crate' =
+ { crate_items = ({ view_imports = Hashtbl.create 0;
+ view_exports = Hashtbl.create 0 },
+ Hashtbl.create 0);
+ crate_meta = [||];
+ crate_auth = Hashtbl.create 0;
+ crate_required = Hashtbl.create 0;
+ crate_required_syms = Hashtbl.create 0;
+ crate_main = None;
+ crate_files = Hashtbl.create 0 }
+;;
+
(*
* NB: names can only be type-parametric in their *last* path-entry.
* All path-entries before that must be ident or idx (non-parametric).
diff --git a/src/boot/fe/cexp.ml b/src/boot/fe/cexp.ml
index 59904a45..5d3a99ef 100644
--- a/src/boot/fe/cexp.ml
+++ b/src/boot/fe/cexp.ml
@@ -605,14 +605,7 @@ let with_err_handling sess thunk =
(Session.string_of_pos pos) cx)
ps.pstate_ctxt;
let apos = lexpos ps in
- span ps apos apos
- { Ast.crate_items = (Item.empty_view, Hashtbl.create 0);
- Ast.crate_meta = [||];
- Ast.crate_auth = Hashtbl.create 0;
- Ast.crate_required = Hashtbl.create 0;
- Ast.crate_required_syms = Hashtbl.create 0;
- Ast.crate_main = None;
- Ast.crate_files = Hashtbl.create 0 }
+ span ps apos apos Ast.empty_crate'
;;