summaryrefslogtreecommitdiff
path: root/docs/users_guide/using-warnings.rst
diff options
context:
space:
mode:
authorchessai <chessai1996@gmail.com>2018-12-26 12:12:37 -0500
committerBen Gamari <ben@smart-cactus.org>2019-01-06 07:27:09 -0500
commitc121e33f9b039acf2ac6939af8bfafe593560039 (patch)
treebb61fb561f3fce2c0f5d8d90884e76d5297bc609 /docs/users_guide/using-warnings.rst
parent08b8ea2f4f1bbc1c61a7cca03ae7fa8ffb099556 (diff)
downloadhaskell-c121e33f9b039acf2ac6939af8bfafe593560039.tar.gz
Add -Wmissing-deriving-strategies
Warn users when -XDerivingStrategies is enabled but not used, at each potential use site. add -Wmissing-deriving-strategies Reviewers: bgamari, RyanGlScott Subscribers: andrewthad, rwbarton, carter GHC Trac Issues: #15798 Differential Revision: https://phabricator.haskell.org/D5451
Diffstat (limited to 'docs/users_guide/using-warnings.rst')
-rw-r--r--docs/users_guide/using-warnings.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 6a6166bf0d..03ca184531 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -904,6 +904,27 @@ of ``-W(no-)*``.
This option isn't enabled by default because it can be very noisy,
and it often doesn't indicate a bug in the program.
+.. ghc-flag:: -Wmissing-deriving-strategies
+ :shortdesc: warn when a deriving clause is missing a deriving strategy
+ :type: dynamic
+ :reverse: -Wno-missing-deriving-strategies
+ :category:
+
+ :since: 8.8.1
+
+ The datatype below derives the ``Eq`` typeclass, but doesn't specify a
+ strategy. When :ghc-flag:`-Wmissing-deriving-strategies` is enabled,
+ the compiler will emit a warning about this. ::
+
+ data Foo a = Foo a
+ deriving (Eq)
+
+ The compiler will warn here that the deriving clause doesn't specify a
+ strategy. If the warning is enabled, but :extension:`DerivingStrategies` is
+ not enabled, the compiler will suggest turning on the
+ :extension:`DerivingStrategies` extension. This option is not on by default,
+ having to be turned on manually or with :ghc-flag:`-Weverything`.
+
.. ghc-flag:: -Wmissing-fields
:shortdesc: warn when fields of a record are uninitialised
:type: dynamic