Skip to content

Commit 1fff46d

Browse files
SkySkimmerMathisBD
authored andcommitted
Remove bugged option MetaCoq Template Monad Debug.
It causes rocq-prover/vsrocq#892 because `optwrite` is not supposed to be able to add persistent objects (libobject) to Coq's state but `set_option_value` does add one. It's also bugged as `set_option_value ~stage:Interp (fun _ v -> v) key i` sets the option to its current value not a new value. In other words `Set MetaCoq Template Monad Debug.` has no effect but its existence causes bugs. Since nobody complained about it not working it's not worth fixing it instead of deleting it (also I'm not sure it can be fixed with the currently available APIs).
1 parent 5672294 commit 1fff46d

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

template-coq/src/tm_util.ml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,6 @@ end = struct
2626
| None ->
2727
match declare_int_option_and_ref ~key ~value:0 () with { get } -> get
2828

29-
let set_template_monad_verbose =
30-
let open Goptions in
31-
match get_option_value key with
32-
| Some get ->
33-
let set = fun i ->
34-
set_option_value ~stage:Interp (fun _ v -> v) key i
35-
in set
36-
| None -> assert false
37-
38-
let set_template_monad_debug d =
39-
set_template_monad_verbose (if d then 1 else 0)
40-
let get_template_monad_debug () =
41-
if get_template_monad_verbose () > 0 then true else false
42-
43-
let _ =
44-
let open Goptions in
45-
let key = ["MetaCoq"; "Template"; "Monad"; "Debug"] in
46-
match get_option_value key with
47-
| Some get -> ()
48-
| None ->
49-
declare_bool_option
50-
{ optdepr = None;
51-
optstage = Interp;
52-
optkey = key;
53-
optread = get_template_monad_debug;
54-
optwrite = set_template_monad_debug; }
55-
5629
let ppdebug lvl pp =
5730
if get_template_monad_verbose () > lvl then Feedback.msg_debug (pp ())
5831
end

0 commit comments

Comments
 (0)