Skip to content

Commit 805fdc3

Browse files
committed
Remove low-value warning categories
1 parent 8fcbbb4 commit 805fdc3

32 files changed

+51
-91
lines changed

interp/implicit_quantifiers.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ let implicit_application env ty =
200200
CAst.make ?loc @@ CAppExpl ((id, inst), args), avoid
201201

202202
let warn_ignoring_implicit_status =
203-
CWarnings.create ~name:"ignoring_implicit_status" ~category:CWarnings.CoreCategories.implicits
203+
CWarnings.create ~name:"ignoring-implicit-status" ~category:CWarnings.CoreCategories.implicits
204204
(fun na ->
205205
strbrk "Ignoring implicit status of product binder " ++
206206
Name.print na ++ strbrk " and following binders")

interp/notation.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2475,12 +2475,12 @@ let toggle_notations_in_scope ~on found inscope ntn_pattern ntns =
24752475
data) ntns
24762476

24772477
let warn_abbreviation_not_bound_to_entry =
2478-
CWarnings.create ~name:"conflicting-abbreviation-entry" ~category:CWarnings.CoreCategories.query
2478+
CWarnings.create ~name:"conflicting-abbreviation-entry" ~category:CWarnings.CoreCategories.syntax
24792479
(fun () ->
24802480
strbrk "Activation of abbreviations does not expect mentioning a grammar entry.")
24812481

24822482
let warn_abbreviation_not_bound_to_scope =
2483-
CWarnings.create ~name:"conflicting-abbreviation-scope" ~category:CWarnings.CoreCategories.query
2483+
CWarnings.create ~name:"conflicting-abbreviation-scope" ~category:CWarnings.CoreCategories.syntax
24842484
(fun () ->
24852485
strbrk "Activation of abbreviations does not expect mentioning a scope.")
24862486

kernel/typeops.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type bad_relevance =
6363

6464
let warn_bad_relevance_name = "bad-relevance"
6565
let warn_bad_relevance =
66-
CWarnings.create ~name:warn_bad_relevance_name ~category:CWarnings.CoreCategories.debug ~default:CWarnings.AsError
66+
CWarnings.create ~name:warn_bad_relevance_name ~default:CWarnings.AsError
6767
Pp.(function
6868
| BadRelevanceCase _ -> str "Bad relevance in case annotation."
6969
| BadRelevanceBinder (_, na) -> str "Bad relevance for binder " ++ Name.print (RelDecl.get_name na) ++ str ".")

lib/cDebug.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ let get_flag flag = !flag
5252

5353
let set_flag flag v = flag := v
5454

55-
let warn_unknown_debug = CWarnings.create ~name:"unknown-debug-flag" ~category:CWarnings.CoreCategories.option
55+
let warn_unknown_debug = CWarnings.create ~name:"unknown-debug-flag"
5656
Pp.(fun name -> str "There is no debug flag \"" ++ str name ++ str "\".")
5757

5858
let get_flags () =

lib/cWarnings.ml

-15
Original file line numberDiff line numberDiff line change
@@ -377,38 +377,23 @@ module CoreCategories = struct
377377
let automation = make "automation"
378378
let bytecode_compiler = make "bytecode-compiler"
379379
let coercions = make "coercions"
380-
let debug = make "debug"
381380
let deprecated = make "deprecated"
382-
let dev = make "dev"
383381
let extraction = make "extraction"
384382
let filesystem = make "filesystem"
385383
let fixpoints = make "fixpoints"
386384
let fragile = make "fragile"
387385
let funind = make "funind"
388386
let implicits = make "implicits"
389-
let loadpath = make "loadpath"
390387
let ltac = make "ltac"
391388
let ltac2 = make "ltac2"
392-
let modules = make "modules"
393389
let native_compiler = make "native-compiler"
394-
let non_interactive = make "non-interactive"
395-
let notation = make "notation"
396390
let numbers = make "numbers"
397-
let option = make "option"
398391
let parsing = make "parsing"
399-
let pattern_matching = make "pattern-matching"
400392
let pedantic = make "pedantic"
401-
let query = make "query"
402393
let records = make "records"
403-
let require = make "require"
404-
let schemes = make "schemes"
405-
let scope = make "scope"
406394
let ssr = make "ssr"
407395
let syntax = make "syntax"
408396
let tactics = make "tactics"
409-
let typechecker = make "typechecker"
410-
let typeclasses = make "typeclasses"
411-
let universes = make "universes"
412397
let vernacular = make "vernacular"
413398

414399
end

lib/cWarnings.mli

-15
Original file line numberDiff line numberDiff line change
@@ -92,38 +92,23 @@ module CoreCategories : sig
9292
val automation : category
9393
val bytecode_compiler : category
9494
val coercions : category
95-
val debug : category
9695
val deprecated : category
97-
val dev : category
9896
val extraction : category
9997
val filesystem : category
10098
val fixpoints : category
10199
val fragile : category
102100
val funind : category
103101
val implicits : category
104-
val loadpath : category
105102
val ltac : category
106103
val ltac2 : category
107-
val modules : category
108104
val native_compiler : category
109-
val non_interactive : category
110-
val notation : category
111105
val numbers : category
112-
val option : category
113106
val parsing : category
114-
val pattern_matching : category
115107
val pedantic : category
116-
val query : category
117108
val records : category
118-
val require : category
119-
val schemes : category
120-
val scope : category
121109
val ssr : category
122110
val syntax : category
123111
val tactics : category
124-
val typechecker : category
125-
val typeclasses : category
126-
val universes : category
127112
val vernacular : category
128113

129114
end

lib/system.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ let is_in_path lpath filename =
207207
with Not_found -> false
208208

209209
let warn_path_not_found =
210-
CWarnings.create ~name:"path-not-found" ~category:CWarnings.CoreCategories.filesystem
211-
(fun () -> str "system variable PATH not found")
210+
CWarnings.create ~name:"PATH-not-found"
211+
(fun () -> str "Environment variable PATH not set")
212212

213213
let is_in_system_path filename =
214214
try

library/goptions.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ let declare_interpreted_string_option_and_ref ~stage ~depr ~key ~(value:'a) from
427427
428428
let warn_unknown_option =
429429
CWarnings.create
430-
~name:"unknown-option" ~category:CWarnings.CoreCategories.option
430+
~name:"unknown-option"
431431
Pp.(fun key -> strbrk "There is no flag or option with this name: \"" ++
432432
str (nickname key) ++ str "\".")
433433

library/summary.ml

+4-8
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,10 @@ let freeze_summaries ~marshallable sum_map =
8383
HMap.map map sum_map
8484

8585
let warn_summary_out_of_scope =
86-
let name = "summary-out-of-scope" in
87-
let category = CWarnings.CoreCategories.dev in
88-
let default = CWarnings.Disabled in
89-
CWarnings.create ~name ~category ~default (fun name ->
90-
Pp.str (Printf.sprintf
91-
"A Coq plugin was loaded inside a local scope (such as a Section). It is recommended to load plugins at the start of the file. Summary entry: %s"
92-
name)
93-
)
86+
CWarnings.create ~name:"summary-out-of-scope" ~default:Disabled Pp.(fun name ->
87+
str "A Coq plugin was loaded inside a local scope (such as a Section)." ++ spc() ++
88+
str "It is recommended to load plugins at the start of the file." ++ spc() ++
89+
str "Summary entry: " ++ str name)
9490

9591
let unfreeze_summaries ?(partial=false) sum_map summaries =
9692
(* We must be independent on the order of the map! *)

pretyping/cases.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ let set_pattern_catch_all_var ?loc eqn = function
561561
eqn
562562

563563
let warn_named_multi_catch_all =
564-
CWarnings.create ~name:"unused-pattern-matching-variable" ~category:CWarnings.CoreCategories.pattern_matching
564+
CWarnings.create ~name:"unused-pattern-matching-variable"
565565
(fun id ->
566566
strbrk "Unused variable " ++ Id.print id
567567
++ strbrk " might be a misspelled constructor. Use _ or _"

pretyping/coercionops.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ let install_path_comparator f = path_comparator := f
304304
let compare_path env sigma cl p q = !path_comparator env sigma cl p q
305305

306306
let warn_ambiguous_path =
307-
CWarnings.create ~name:"ambiguous-paths" ~category:CWarnings.CoreCategories.typechecker
307+
CWarnings.create ~name:"ambiguous-paths" ~category:CWarnings.CoreCategories.coercions
308308
(fun l -> prlist_with_sep fnl (fun (c,p,q) ->
309309
str"New coercion path " ++ print_path (c,p) ++
310310
if List.is_empty q then

pretyping/structures.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ let keep_true_projections projs =
195195
List.map_filter filter projs
196196

197197
let warn_projection_no_head_constant =
198-
CWarnings.create ~name:"projection-no-head-constant" ~category:CWarnings.CoreCategories.typechecker
198+
CWarnings.create ~name:"projection-no-head-constant" ~category:CWarnings.CoreCategories.records
199199
(fun (sign,env,t,ref,proji_sp) ->
200200
let env = Environ.push_rel_context sign env in
201201
let con_pp = Nametab.pr_global_env Id.Set.empty ref in
@@ -244,7 +244,7 @@ let compute_canonical_projections env ~warn (gref,ind) =
244244
) [] lpj projs
245245

246246
let warn_redundant_canonical_projection =
247-
CWarnings.create ~name:"redundant-canonical-projection" ~category:CWarnings.CoreCategories.typechecker
247+
CWarnings.create ~name:"redundant-canonical-projection" ~category:CWarnings.CoreCategories.records
248248
(fun (hd_val,prj,new_can_s,old_can_s) ->
249249
strbrk "Ignoring canonical projection to " ++ hd_val
250250
++ strbrk " by " ++ prj ++ strbrk " in "

stm/stm.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ end = struct (* {{{ *)
11111111
| Cont acc -> next acc
11121112

11131113
let undo_costly_in_batch_mode =
1114-
CWarnings.create ~name:"undo-batch-mode" ~category:CWarnings.CoreCategories.non_interactive Pp.(fun v ->
1114+
CWarnings.create ~name:"undo-batch-mode" Pp.(fun v ->
11151115
str "Command " ++ Ppvernac.pr_vernac v ++
11161116
str (" is not recommended in batch mode. In particular, going back in the document" ^
11171117
" is not efficient in batch mode due to Coq not caching previous states for memory optimization reasons." ^

tactics/redexpr.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let cbv_vm env sigma c =
3838
end
3939

4040
let warn_native_compute_disabled =
41-
CWarnings.create ~name:"native-compute-disabled" ~category:CWarnings.CoreCategories.native_compiler
41+
CWarnings.create_in Nativeconv.w_native_disabled
4242
(fun () ->
4343
strbrk "native_compute disabled at configure time; falling back to vm_compute.")
4444

test-suite/output/Cases.out

+4-8
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ end
193193
Arguments stray N
194194
File "./output/Cases.v", line 253, characters 4-5:
195195
Warning: Unused variable B might be a misspelled constructor. Use _ or _B to
196-
silence this warning.
197-
[unused-pattern-matching-variable,pattern-matching,default]
196+
silence this warning. [unused-pattern-matching-variable,default]
198197
File "./output/Cases.v", line 266, characters 33-40:
199198
The command has indeed failed with message:
200199
Application of arguments to a recursive notation not supported in patterns.
@@ -254,13 +253,10 @@ end
254253
: J' bool (true, true) -> nat * nat
255254
File "./output/Cases.v", line 313, characters 3-4:
256255
Warning: Unused variable x might be a misspelled constructor. Use _ or _x to
257-
silence this warning.
258-
[unused-pattern-matching-variable,pattern-matching,default]
256+
silence this warning. [unused-pattern-matching-variable,default]
259257
File "./output/Cases.v", line 314, characters 6-7:
260258
Warning: Unused variable y might be a misspelled constructor. Use _ or _y to
261-
silence this warning.
262-
[unused-pattern-matching-variable,pattern-matching,default]
259+
silence this warning. [unused-pattern-matching-variable,default]
263260
File "./output/Cases.v", line 314, characters 3-4:
264261
Warning: Unused variable x might be a misspelled constructor. Use _ or _x to
265-
silence this warning.
266-
[unused-pattern-matching-variable,pattern-matching,default]
262+
silence this warning. [unused-pattern-matching-variable,default]

test-suite/output/DebugFlags.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
File "./output/DebugFlags.v", line 1, characters 0-33:
22
Warning: There is no debug flag "ThisFlagDoesNotExist".
3-
[unknown-debug-flag,option,default]
3+
[unknown-debug-flag,default]
44
Debug: [Cbv] Unfolding Coq.Init.Datatypes.id
55
= tt
66
: unit

test-suite/output/Warnings.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
File "./output/Warnings.v", line 4, characters 0-22:
22
Warning: Projection value has no head constant: let H := tt in True in
33
canonical instance a of b, ignoring it.
4-
[projection-no-head-constant,typechecker,default]
4+
[projection-no-head-constant,records,default]

test-suite/output/bug_16224.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use '#[global] Existing Instance field.' for compatibility with Coq < 8.17).
55
Beware that the default locality for '::' is #[export], as opposed to
66
#[global] for ':>' currently. Add an explicit #[global] attribute to the
77
field if you need to keep the current behavior. For example: "Class foo := {
8-
#[global] field :: bar }." [future-coercion-class-field,records,default]
8+
#[global] field :: bar }." [future-coercion-class-field,deprecated,default]
99
[rc] : Rc >-> A (reversible)
1010
[ric] : Ric >-> A (reversible)
1111
ric : Ric -> A

test-suite/output/bug_5222.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
True = (nil : T1 nat)
55
File "./output/bug_5222.v", line 16, characters 2-40:
66
Warning: C2 does not respect the uniform inheritance condition.
7-
[uniform-inheritance,typechecker,default]
7+
[uniform-inheritance,coercions,default]
88
1 goal
99

1010
============================

test-suite/output/coercions_nonuniform.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
File "./output/coercions_nonuniform.v", line 22, characters 0-21:
22
Warning: f does not respect the uniform inheritance condition.
3-
[uniform-inheritance,typechecker,default]
3+
[uniform-inheritance,coercions,default]
44
File "./output/coercions_nonuniform.v", line 55, characters 0-17:
55
Warning: f' does not respect the uniform inheritance condition.
6-
[uniform-inheritance,typechecker,default]
6+
[uniform-inheritance,coercions,default]
77
File "./output/coercions_nonuniform.v", line 71, characters 7-17:
88
The command has indeed failed with message:
99
This command does not support this attribute: nonuniform.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
While loading initial state:
22
Warning: There is no flag or option with this name: "Extraction Optimize".
3-
[unknown-option,option,default]
3+
[unknown-option,default]
44
Extraction Optimize is on

test-suite/output/relaxed_ambiguous_paths.out

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
File "./output/relaxed_ambiguous_paths.v", line 13, characters 0-29:
22
Warning:
33
New coercion path [g1; f2] : A >-> B' is ambiguous with existing
4-
[f1; g2] : A >-> B'. [ambiguous-paths,typechecker,default]
4+
[f1; g2] : A >-> B'. [ambiguous-paths,coercions,default]
55
File "./output/relaxed_ambiguous_paths.v", line 14, characters 0-29:
66
Warning:
77
New coercion path [h1; f3] : B >-> C' is ambiguous with existing
8-
[f2; h2] : B >-> C'. [ambiguous-paths,typechecker,default]
8+
[f2; h2] : B >-> C'. [ambiguous-paths,coercions,default]
99
[f1] : A >-> A'
1010
[g1] : A >-> B
1111
[f1; g2] : A >-> B'
@@ -21,7 +21,7 @@ New coercion path [h1; f3] : B >-> C' is ambiguous with existing
2121
File "./output/relaxed_ambiguous_paths.v", line 33, characters 0-28:
2222
Warning:
2323
New coercion path [ab; bc] : A >-> C is ambiguous with existing
24-
[ac] : A >-> C. [ambiguous-paths,typechecker,default]
24+
[ac] : A >-> C. [ambiguous-paths,coercions,default]
2525
[ab] : A >-> B
2626
[ac] : A >-> C
2727
[ac; cd] : A >-> D
@@ -31,12 +31,12 @@ New coercion path [ab; bc] : A >-> C is ambiguous with existing
3131
File "./output/relaxed_ambiguous_paths.v", line 50, characters 0-28:
3232
Warning:
3333
New coercion path [ab; bc] : A >-> C is ambiguous with existing
34-
[ac] : A >-> C. [ambiguous-paths,typechecker,default]
34+
[ac] : A >-> C. [ambiguous-paths,coercions,default]
3535
File "./output/relaxed_ambiguous_paths.v", line 51, characters 0-28:
3636
Warning:
3737
New coercion path [ba; ab] : B >-> B is not definitionally an identity function.
3838
New coercion path [ab; ba] : A >-> A is not definitionally an identity function.
39-
[ambiguous-paths,typechecker,default]
39+
[ambiguous-paths,coercions,default]
4040
[ab] : A >-> B
4141
[ac] : A >-> C
4242
[ba] : B >-> A
@@ -58,7 +58,7 @@ New coercion path [ab; ba] : A >-> A is not definitionally an identity function.
5858
File "./output/relaxed_ambiguous_paths.v", line 147, characters 0-86:
5959
Warning:
6060
New coercion path [D_C; C_A'] : D >-> A' is ambiguous with existing
61-
[D_B; B_A'] : D >-> A'. [ambiguous-paths,typechecker,default]
61+
[D_B; B_A'] : D >-> A'. [ambiguous-paths,coercions,default]
6262
[A'_A] : A' >-> A
6363
[B_A'; A'_A] : B >-> A
6464
[B_A'] : B >-> A'
@@ -71,12 +71,12 @@ New coercion path [D_C; C_A'] : D >-> A' is ambiguous with existing
7171
File "./output/relaxed_ambiguous_paths.v", line 156, characters 0-47:
7272
Warning:
7373
New coercion path [unwrap_nat; wrap_nat] : NAT >-> NAT (reversible) is not definitionally an identity function.
74-
[ambiguous-paths,typechecker,default]
74+
[ambiguous-paths,coercions,default]
7575
File "./output/relaxed_ambiguous_paths.v", line 157, characters 0-64:
7676
Warning:
7777
New coercion path [unwrap_list; wrap_list] : LIST >-> LIST (reversible) is not definitionally an identity function.
78-
[ambiguous-paths,typechecker,default]
78+
[ambiguous-paths,coercions,default]
7979
File "./output/relaxed_ambiguous_paths.v", line 158, characters 0-51:
8080
Warning:
8181
New coercion path [unwrap_Type; wrap_Type] : TYPE >-> TYPE (reversible) is not definitionally an identity function.
82-
[ambiguous-paths,typechecker,default]
82+
[ambiguous-paths,coercions,default]

test-suite/output/undeclared_key.out

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The command has indeed failed with message:
66
There is no qualid-valued table with this name: "Search Blacklist".
77
File "./output/undeclared_key.v", line 3, characters 0-22:
88
Warning: There is no flag or option with this name: "Search Blacklists".
9-
[unknown-option,option,default]
9+
[unknown-option,default]
1010
File "./output/undeclared_key.v", line 4, characters 0-40:
1111
The command has indeed failed with message:
1212
There is no string-valued table with this name: "Search Blacklists".

vernac/classes.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ let add_instance cl info global impl =
184184
observe (Event.NewInstance { class_name = cl.cl_impl; instance = impl; info; locality = global })
185185

186186
let warning_not_a_class =
187-
let name = "not-a-class" in
188-
let category = CWarnings.CoreCategories.typeclasses in
189-
CWarnings.create ~name ~category (fun (n, ty) ->
187+
CWarnings.create ~name:"not-a-class" (fun (n, ty) ->
190188
let env = Global.env () in
191189
let evd = Evd.from_env env in
192190
Pp.(str "Ignored instance declaration for “"

vernac/comCoercion.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ lorque source est None alors target est None aussi.
296296
*)
297297

298298
let warn_uniform_inheritance =
299-
CWarnings.create ~name:"uniform-inheritance" ~category:CWarnings.CoreCategories.typechecker
299+
CWarnings.create ~name:"uniform-inheritance" ~category:CWarnings.CoreCategories.coercions
300300
(fun g ->
301301
Printer.pr_global g ++
302302
strbrk" does not respect the uniform inheritance condition.")

vernac/comInductive.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module RelDecl = Context.Rel.Declaration
2929
(* 3b| Mutual inductive definitions *)
3030

3131
let warn_auto_template =
32-
CWarnings.create ~name:"auto-template" ~category:CWarnings.CoreCategories.vernacular ~default:CWarnings.Disabled
32+
CWarnings.create ~name:"auto-template" ~default:CWarnings.Disabled
3333
(fun id ->
3434
Pp.(strbrk "Automatically declaring " ++ Id.print id ++
3535
strbrk " as template polymorphic. Use attributes or " ++
@@ -448,7 +448,7 @@ let split_universe_context subset (univs, csts) =
448448
(subset, subcst), (rem, remcst)
449449

450450
let warn_no_template_universe =
451-
CWarnings.create ~name:"no-template-universe" ~category:CWarnings.CoreCategories.universes
451+
CWarnings.create ~name:"no-template-universe"
452452
(fun () -> Pp.str "This inductive type has no template universes.")
453453

454454
let compute_template_inductive ~user_template ~env_ar_params ~ctx_params ~univ_entry entry concl =

0 commit comments

Comments
 (0)