diff options
author | Vincent Laporte <Vincent.Laporte@gmail.com> | 2018-03-06 20:29:06 +0000 |
---|---|---|
committer | Vincent Laporte <Vincent.Laporte@gmail.com> | 2018-03-07 17:31:47 +0000 |
commit | 33bf4f2c5c60114eb6db4a8e082ff8882923f6c8 (patch) | |
tree | a07c626739bf195b5d7a938c5fe4ee5594c2c1a1 | |
parent | 66c523bcac8b64e202baa084bf24f5b57c61fcd6 (diff) |
[vernac] Warn when using “Require” in a section
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | vernac/vernacentries.ml | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -73,6 +73,7 @@ Vernacular Commands was removed. Use Local as a prefix instead. - For the Extraction Language command, "OCaml" is spelled correctly. The older "Ocaml" is still accepted, but deprecated. +- Using “Require” inside a section is deprecated. Universes diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml index 0ff6d9c17..5779c07ab 100644 --- a/vernac/vernacentries.ml +++ b/vernac/vernacentries.ml @@ -805,7 +805,14 @@ let vernac_end_segment ({v=id} as lid) = (* Libraries *) +let warn_require_in_section = + let name = "require-in-section" in + let category = "deprecated" in + CWarnings.create ~name ~category + (fun () -> strbrk "Use of “Require” inside a section is deprecated.") + let vernac_require from import qidl = + if Lib.sections_are_opened () then warn_require_in_section (); let qidl = List.map qualid_of_reference qidl in let root = match from with | None -> None |