summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2023-01-10 21:03:48 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-03-24 02:36:09 -0400
commitf932c5890ec358aa0cbba547eb6982168e13da37 (patch)
tree62c27ed44eb43b7ed8f55af7ea0325cbcb3cfe14 /compiler/GHC/Parser
parente1c8c41d62854553d889403d8ee52d120c26bc66 (diff)
downloadhaskell-f932c5890ec358aa0cbba547eb6982168e13da37.tar.gz
Allow WARNING pragmas to be controlled with custom categories
Closes #17209. This implements GHC Proposal 541, allowing a WARNING pragma to be annotated with a category like so: {-# WARNING in "x-partial" head "This function is undefined on empty lists." #-} The user can then enable, disable and set the severity of such warnings using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on. There is a new warning group `-Wextended-warnings` containing all these warnings. Warnings without a category are treated as if the category was `deprecations`, and are (still) controlled by the flags `-Wdeprecations` and `-Wwarnings-deprecations`. Updates Haddock submodule.
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r--compiler/GHC/Parser/HaddockLex.x10
1 files changed, 1 insertions, 9 deletions
diff --git a/compiler/GHC/Parser/HaddockLex.x b/compiler/GHC/Parser/HaddockLex.x
index 682ede39a4..52e67894b5 100644
--- a/compiler/GHC/Parser/HaddockLex.x
+++ b/compiler/GHC/Parser/HaddockLex.x
@@ -16,7 +16,6 @@ import GHC.Types.SourceText
import GHC.Data.StringBuffer
import qualified GHC.Data.Strict as Strict
import GHC.Types.Name.Reader
-import GHC.Utils.Outputable
import GHC.Utils.Error
import GHC.Utils.Encoding
import GHC.Hs.Extension
@@ -180,14 +179,7 @@ validateIdentWith identParser mloc str0 =
dopts
[]
False False False False
- dopts = DiagOpts
- { diag_warning_flags = EnumSet.empty
- , diag_fatal_warning_flags = EnumSet.empty
- , diag_warn_is_error = False
- , diag_reverse_errors = False
- , diag_max_errors = Nothing
- , diag_ppr_ctx = defaultSDocContext
- }
+ dopts = emptyDiagOpts
buffer = stringBufferFromByteString str0
realSrcLc = case mloc of
RealSrcSpan loc _ -> realSrcSpanStart loc