summaryrefslogtreecommitdiff
path: root/docs/users_guide/using-warnings.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/users_guide/using-warnings.rst')
-rw-r--r--docs/users_guide/using-warnings.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 256d143f45..a83cc6837e 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -1762,6 +1762,25 @@ of ``-W(no-)*``.
You may want to enable this warning on a clean build or enable :ghc-flag:`-fforce-recomp`
in order to get reliable results.
+.. ghc-flag:: -Winvalid-haddock
+ :shortdesc: warn when a Haddock comment occurs in an invalid position
+ :type: dynamic
+ :category:
+
+ :since: 8.12
+
+ When the ``-haddock`` option is enabled, GHC collects documentation
+ comments and associates them with declarations, function arguments, data
+ constructors, and other syntactic elements. Documentation comments in
+ invalid positions are discarded::
+
+ myValue =
+ -- | Invalid (discarded) comment in an expression
+ 2 + 2
+
+ This warning informs you about discarded documentation comments.
+ It has no effect when :ghc-flag:`-haddock` is disabled.
+
If you're feeling really paranoid, the :ghc-flag:`-dcore-lint` option is a good choice.
It turns on heavyweight intra-pass sanity-checking within GHC. (It checks GHC's
sanity, not yours.)