Commit f405e1e7 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

Disable failed specialisation warnings by default & update documentation.

These were far too noisy to enable by default. In the future we will
hopefully have a more variant of -Wall targetted at these sorts of
diagnostics.

In the interim I've pointed out the existence of these options in the
release
notes in hopes that people will discover them.

Test Plan: Validate

Reviewers: hvr, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1492
parent 11e336e4
......@@ -3436,8 +3436,7 @@ standardWarnings -- see Note [Documenting warning flags]
Opt_WarnAlternativeLayoutRuleTransitional,
Opt_WarnUnsupportedLlvmVersion,
Opt_WarnContextQuantification,
Opt_WarnTabs,
Opt_WarnMissedSpecs
Opt_WarnTabs
]
minusWOpts :: [WarningFlag]
......@@ -3465,8 +3464,7 @@ minusWallOpts
Opt_WarnOrphans,
Opt_WarnUnusedDoBind,
Opt_WarnTrustworthySafe,
Opt_WarnUntickedPromotedConstructors,
Opt_WarnAllMissedSpecs
Opt_WarnUntickedPromotedConstructors
]
enableUnusedBinds :: DynP ()
......
......@@ -108,6 +108,13 @@ Compiler
Enabling ``-fworker-wrapper`` while strictness analysis is disabled (by
``-fno-strictness``) has no effect.
- Added the options ``-fwarn-missed-specialisations`` and
``-fwarn-all-missed-specialisations``. When enabled, the simplifier will
produce a warning when a overloaded imported function cannot be
specialised (typically due to a missing ``INLINEABLE`` pragma). This
is intended to alert users to cases where they apply ``INLINEABLE`` but
may not get the speed-up they expect.
GHCi
~~~~
......
......@@ -158,17 +158,16 @@ command line.
single: warnings
single: pragmas
Emits a warning if GHC cannot specialise a function that is imported
and overloaded, usually because the function needs an ``INLINEABLE``
pragma.. The "all" form reports all such situations. The "non-all"
form only reports when the situation arises during specialisation of
an imported function; presumably teh latter was marked
``INLINEABLE`` so that it would specialise but if it, in turn, calls
other functions that are not specialised you won't get the
performance boost you expect.
``-fwarn-missed-specialisations`` is on by default;
``-fwarn-all-missed-specialisations`` is implied by ``-Wall``.
Emits a warning if GHC cannot specialise an overloaded function, usually
because the function needs an ``INLINEABLE`` pragma. The "all" form reports
all such situations whereas the "non-all" form only reports when the
situation arises during specialisation of an imported function.
The "non-all" form is intended to catch cases where an imported function
that is marked as ``INLINEABLE`` (presumably to enable specialisation) cannot
be specialised as it calls other functions that are themselves not specialised.
These options are both off by default.
``-fwarn-warnings-deprecations``
.. index::
......
......@@ -8,7 +8,6 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should fail, GADTs is not enabled
options currently set: none.
base language is: Haskell2010
......@@ -23,7 +22,6 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should work, GADTs is in force from :set
options currently set: none.
base language is: Haskell2010
......@@ -37,7 +35,6 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should fail, GADTs is now disabled
base language is: Haskell2010
with the following modifiers:
......@@ -53,6 +50,5 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should fail, GADTs is only enabled at the prompt
C :: T Int
......@@ -9,7 +9,6 @@ other dynamic, non-language, flag settings:
-fforce-recomp
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
-fno-warn-tabs
~~~~~~~~~~ Testing :set -a
options currently set: none.
......
......@@ -8,7 +8,6 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should fail, GADTs is not enabled
options currently set: none.
base language is: Haskell2010
......@@ -23,7 +22,6 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should work, GADTs is in force from :set
options currently set: none.
base language is: Haskell2010
......@@ -37,7 +35,6 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should fail, GADTs is now disabled
base language is: Haskell2010
with the following modifiers:
......@@ -53,6 +50,5 @@ other dynamic, non-language, flag settings:
-fno-ghci-history
-fimplicit-import-qualified
warning settings:
-fno-warn-missed-specialisations
Should fail, GADTs is only enabled at the prompt
C :: T Int
......@@ -145,6 +145,18 @@ warningsOptions =
, flagType = DynamicFlag
, flagReverse = "-fno-warn-missing-local-sigs"
}
, flag { flagName = "-fwarn-missed-specialisations"
, flagDescription =
"warn when specialisation of an imported, overloaded function fails."
, flagType = DynamicFlag
, flagReverse = "-fno-warn-missed-specialisations"
}
, flag { flagName = "-fwarn-all-missed-specialisations"
, flagDescription =
"warn when specialisation of any overloaded function fails."
, flagType = DynamicFlag
, flagReverse = "-fno-warn-all-missed-specialisations"
}
, flag { flagName = "-fwarn-monomorphism-restriction"
, flagDescription = "warn when the Monomorphism Restriction is applied"
, flagType = DynamicFlag
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment