[commit: ghc] master: Remove -Wtoo-many-guards from default flags (fixes #11316) (77494fa)
git at git.haskell.org
git at git.haskell.org
Tue Jan 5 21:07:19 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/77494fa9fa34c1a831caabc194e855167de0c2d9/ghc
>---------------------------------------------------------------
commit 77494fa9fa34c1a831caabc194e855167de0c2d9
Author: George Karachalias <george.karachalias at gmail.com>
Date: Tue Jan 5 15:59:49 2016 +0100
Remove -Wtoo-many-guards from default flags (fixes #11316)
Since #11316 indicates that having flag `-Wtoo-many-guards`
enabled by default causes issues, the simplest thing is to
remove it. This patch removes it from the default list, it
updates the docs and removes the suppression flags for
`T783` and `types/OptCoercion.hs`
Test Plan: validate
Reviewers: bgamari, austin, goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1737
GHC Trac Issues: #11316
>---------------------------------------------------------------
77494fa9fa34c1a831caabc194e855167de0c2d9
compiler/main/DynFlags.hs | 1 -
compiler/types/OptCoercion.hs | 6 +-----
docs/users_guide/8.0.1-notes.rst | 3 +--
docs/users_guide/using-warnings.rst | 11 ++++++-----
testsuite/tests/perf/compiler/T783.hs | 5 -----
5 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index fcb954e..29c1423 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3400,7 +3400,6 @@ optLevelFlags -- see Note [Documenting optimisation flags]
standardWarnings :: [WarningFlag]
standardWarnings -- see Note [Documenting warning flags]
= [ Opt_WarnOverlappingPatterns,
- Opt_WarnTooManyGuards,
Opt_WarnWarningsDeprecations,
Opt_WarnDeprecatedFlags,
Opt_WarnDeferredTypeErrors,
diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs
index 41cec21..1038851 100644
--- a/compiler/types/OptCoercion.hs
+++ b/compiler/types/OptCoercion.hs
@@ -1,14 +1,10 @@
-- (c) The University of Glasgow 2006
{-# LANGUAGE CPP #-}
-#if __GLASGOW_HASKELL__ > 710
-{-# OPTIONS_GHC -Wno-too-many-guards #-}
-#endif
-- This module used to take 10GB of memory to compile with the new
-- (Nov '15) pattern-match check. In order to be able to compile it,
-- do not enable -ffull-guard-reasoning. Instead, simplify the guards
- -- (default behaviour when guards are too many) but suppress the
- -- "too-many-guards" warning (-Werror is on).
+ -- (default behaviour when guards are too many).
module OptCoercion ( optCoercion, checkAxInstCo ) where
diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst
index 1e47d19..08f4800 100644
--- a/docs/users_guide/8.0.1-notes.rst
+++ b/docs/users_guide/8.0.1-notes.rst
@@ -248,8 +248,7 @@ Compiler
- Added the ``-Wtoo-many-guards`` flag. When enabled, this will issue a
warning if a pattern match contains too many guards (over 20 at the
- moment). It is enabled by default but makes a difference only if pattern
- match checking is also enabled.
+ moment). Makes a difference only if pattern match checking is also enabled.
- Added the ``-ffull-guard-reasoning`` flag. When enabled, pattern match
checking tries its best to reason about guards. Since the additional
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 619f701..bc12688 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -545,14 +545,15 @@ of ``-W(no-)*``.
The option ``-Wtoo-many-guards`` warns about places where a
pattern match contains too many guards (over 20 at the moment).
- It is enabled by default but has an effect only if any form of
- exhaustivness/overlapping checking is enabled (one of
+ It has an effect only if any form of exhaustivness/overlapping
+ checking is enabled (one of
``-Wincomplete-patterns``,
``-Wincomplete-uni-patterns``,
``-Wincomplete-record-updates``,
- ``-Woverlapping-patterns``). The warning can be suppressed by
- enabling either ``-Wno-too-many-guards``, which just hides the
- warning, or ``-ffull-guard-reasoning``.
+ ``-Woverlapping-patterns``). When enabled, the warning can be
+ suppressed by enabling either ``-Wno-too-many-guards``, which just
+ hides the warning, or ``-ffull-guard-reasoning`` which runs the
+ full check, independently of the number of guards.
``-ffull-guard-reasoning``
.. index::
diff --git a/testsuite/tests/perf/compiler/T783.hs b/testsuite/tests/perf/compiler/T783.hs
index cfd6b62..c3ea08d 100644
--- a/testsuite/tests/perf/compiler/T783.hs
+++ b/testsuite/tests/perf/compiler/T783.hs
@@ -1,8 +1,3 @@
-{-# LANGUAGE CPP #-}
-#if __GLASGOW_HASKELL__ > 710
-{-# OPTIONS_GHC -Wno-too-many-guards #-}
-#endif
-
module Test where
foo :: Double -> Int
More information about the ghc-commits
mailing list