Skip to content

Commit

Permalink
Remove Command.Args.Fail (#8928)
Browse files Browse the repository at this point in the history
This has not been used for a while.

Signed-off-by: Etienne Millon <[email protected]>
  • Loading branch information
emillon authored Oct 13, 2023
1 parent b0ea7de commit 5a0fbc4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/dune_rules/command.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module Args0 = struct

type expand = dir:Path.t -> string list Action_builder.t

(* Debugging tip: if you changed this file and Dune got broken in a weird way
it's probably because of the [Fail] constructor. *)
type _ t =
| A : string -> _ t
| As : string list -> _ t
Expand All @@ -25,7 +23,6 @@ module Args0 = struct
| Hidden_deps : Dep.Set.t -> _ t
| Hidden_targets : Path.Build.t list -> [> `Targets ] t
| Dyn : without_targets t Action_builder.t -> _ t
| Fail : Action_builder.fail -> _ t
| Expand : expand -> _ t

let dyn args = Dyn (Action_builder.map args ~f:(fun x -> As x))
Expand All @@ -42,7 +39,6 @@ module Args0 = struct
| Paths _ as x -> (x :> any t)
| Hidden_deps _ as x -> (x :> any t)
| Dyn _ as x -> (x :> any t)
| Fail _ as x -> (x :> any t)
| Expand _ as x -> (x :> any t)
;;
end
Expand Down Expand Up @@ -79,7 +75,6 @@ let rec expand : type a. dir:Path.t -> a t -> string list Action_builder.With_ta
| Dyn dyn ->
Action_builder.with_no_targets
(Action_builder.bind dyn ~f:(fun t -> expand_no_targets ~dir t))
| Fail f -> Action_builder.with_no_targets (Action_builder.fail f)
| Hidden_deps deps ->
Action_builder.with_no_targets
(Action_builder.map (Action_builder.deps deps) ~f:(fun () -> []))
Expand Down Expand Up @@ -128,8 +123,6 @@ let quote_args =
fun quote args -> As (loop quote args)
;;

let fail e = Fail { fail = (fun _ -> raise e) }

module Args = struct
include Args0

Expand Down
3 changes: 0 additions & 3 deletions src/dune_rules/command.mli
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ module Args : sig
| Hidden_deps : Dep.Set.t -> _ t
| Hidden_targets : Path.Build.t list -> [> `Targets ] t
| Dyn : without_targets t Action_builder.t -> _ t
| Fail : Action_builder.fail -> _ t
| Expand : expand -> _ t

(** Create dynamic command line arguments. *)
Expand Down Expand Up @@ -92,8 +91,6 @@ val run'
(** [quote_args quote args] is [As [quote; arg1; quote; arg2; ...]] *)
val quote_args : string -> string list -> _ Args.t

val fail : exn -> _ Args.t

module Ml_kind : sig
val flag : Ml_kind.t -> _ Args.t
val ppx_driver_flag : Ml_kind.t -> _ Args.t
Expand Down

0 comments on commit 5a0fbc4

Please sign in to comment.