From a8b4394093e61b050406ca952a6d017ad1c737e4 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Thu, 14 Mar 2019 16:14:45 -0400 Subject: Add constr_fail and constr_fail_with Rather than taking the convention that failures during constr construction emit a type error from `I : I` with the actual error message `idtac`d above them (because Coq has no way to emit multiple things on stderr), we instead factor everything through a new `constr_fail` or `constr_fail_with msg_tac`, which emit more helpful messages instructing the user to look in `*coq*` or to use `Fail`/`try` to see the more informative error message. When we can make our own version that does both `idtac` and `fail` (c.f. https://github.com/coq/coq/issues/3913), then we can do something a bit more sane, hopefully. --- src/Util/Tactics/DebugPrint.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Util/Tactics/DebugPrint.v') diff --git a/src/Util/Tactics/DebugPrint.v b/src/Util/Tactics/DebugPrint.v index 3ced23331..97edd0ad9 100644 --- a/src/Util/Tactics/DebugPrint.v +++ b/src/Util/Tactics/DebugPrint.v @@ -1,3 +1,5 @@ +Require Import Crypto.Util.Tactics.ConstrFail. + Ltac debuglevel := constr:(0%nat). Ltac solve_debugfail tac := @@ -36,7 +38,7 @@ Ltac constr_run_tac_fail tac := let dummy := match goal with | _ => tac () end in - constr:(I : I). + constr_fail. Ltac cidtac msg := constr_run_tac ltac:(fun _ => idtac msg). -- cgit v1.2.3