aboutsummaryrefslogtreecommitdiff
path: root/src/boot/fe
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-07-08 15:13:25 -0700
committerRoy Frostig <[email protected]>2010-07-08 15:13:25 -0700
commit063f388534f84c12b46f2dc0dd632bcc86a805f5 (patch)
tree138313c42b4c3bc88433f921071b5b1a2d762f37 /src/boot/fe
parentFix typo in token.ml. (diff)
downloadrust-063f388534f84c12b46f2dc0dd632bcc86a805f5.tar.xz
rust-063f388534f84c12b46f2dc0dd632bcc86a805f5.zip
Err kindly instead of asserting on duplicate mod declarations in crates.
Diffstat (limited to 'src/boot/fe')
-rw-r--r--src/boot/fe/cexp.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/boot/fe/cexp.ml b/src/boot/fe/cexp.ml
index bf5e32b8..59904a45 100644
--- a/src/boot/fe/cexp.ml
+++ b/src/boot/fe/cexp.ml
@@ -678,7 +678,11 @@ let parse_crate_file
begin
fun d ->
match d with
- CDIR_mod (name, item) -> htab_put items name item
+ CDIR_mod (name, item) ->
+ if Hashtbl.mem items name
+ then raise
+ (err ("duplicate mod declaration: " ^ name) ps)
+ else Hashtbl.add items name item
| CDIR_meta metas ->
Array.iter (fun m -> Queue.add m meta) metas
| CDIR_auth (n,e) ->