From e201e517c9f46669bf79c84d399558b9fe1de8a9 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 26 Nov 2019 15:05:53 -0800 Subject: [PATCH] [sledge][NFC] Refactor to avoid an unused open warning Summary: OCaml 4.08 has a new warning (66) on unused `open!` statements. This has a suboptimal interaction with `ppx_let`'s `let%map_open` which leads to triggering the warning if any of a group of such let bindings does not need the open. In this case, the refactor is easy. But, warning 66 is very dubious, so also just switch it off. Reviewed By: jvillard Differential Revision: D18708466 fbshipit-source-id: 77618ab6e --- sledge/dune-common.in | 2 +- sledge/src/sledge_buck.ml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sledge/dune-common.in b/sledge/dune-common.in index 8de366914..920cff42a 100644 --- a/sledge/dune-common.in +++ b/sledge/dune-common.in @@ -7,7 +7,7 @@ *) let common_flags = - {|(-w +a-4-9-18-40-42-44-48@50 + {|(-w +a-4-9-18-40-42-44-48@50-66 -strict-formats -strict-sequence -short-paths -bin-annot -keep-docs -unboxed-types)|} diff --git a/sledge/src/sledge_buck.ml b/sledge/src/sledge_buck.ml index 25f0dc37e..26ed884e6 100644 --- a/sledge/src/sledge_buck.ml +++ b/sledge/src/sledge_buck.ml @@ -176,9 +176,8 @@ let abs_path_arg = Command.Param.(Arg_type.map string ~f:(make_absolute cwd)) let main ~(command : unit Command.basic_command) ~analyze = - let target_flag = Command.Param.(anon ("" %: string)) in let bitcode_inputs = - let%map_open target = target_flag + let%map_open target = anon ("" %: string) and modules = flag "modules" (optional string) ~doc: