summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo White <lpw25@cl.cam.ac.uk>2015-11-04 11:00:21 +0000
committerLeo White <lpw25@cl.cam.ac.uk>2015-11-04 11:01:34 +0000
commit278efc9196daedc8c57781a05ad8e5742a77e888 (patch)
tree2b53862e207cc21d1965d1515423c83f426390e0
parente714e25a01141e6077ba651bb37f99ea32b246e7 (diff)
downloadocaml-278efc9196daedc8c57781a05ad8e5742a77e888.tar.gz
Use ignore because its less fragile than _
-rw-r--r--typing/env.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/typing/env.ml b/typing/env.ml
index 5c8315d2bd..ca5093a968 100644
--- a/typing/env.ml
+++ b/typing/env.ml
@@ -387,16 +387,17 @@ let find_pers_struct check name =
(* Emits a warning if there is no valid cmi for name *)
let check_pers_struct name =
- match find_pers_struct false name with
- | _ -> ()
- | exception Not_found ->
+ try
+ ignore (find_pers_struct false name)
+ with
+ | Not_found ->
let warn = Warnings.No_cmi_file(name, None) in
Location.prerr_warning Location.none warn
- | exception Cmi_format.Error err ->
+ | Cmi_format.Error err ->
let msg = Format.asprintf "%a" Cmi_format.report_error err in
let warn = Warnings.No_cmi_file(name, Some msg) in
Location.prerr_warning Location.none warn
- | exception Error err ->
+ | Error err ->
let msg =
match err with
| Illegal_renaming(name, ps_name, filename) ->