diff options
author | Michael Walker <mike@barrucadu.co.uk> | 2016-02-25 17:34:07 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-02-25 23:44:08 +0100 |
commit | bb5afd3c274011c5ea302210b4c290ec1f83209c (patch) | |
tree | b6c2000e466e894207ce28dc65346853120f8548 /compiler/rename/RnBinds.hs | |
parent | 1badf157be3b7f604ba1ac64d2ea044d783e6e50 (diff) | |
download | haskell-bb5afd3c274011c5ea302210b4c290ec1f83209c.tar.gz |
Print which warning-flag controls an emitted warning
Both gcc and clang tell which warning flag a reported warning can be
controlled with, this patch makes ghc do the same. More generally, this
allows for annotated compiler output, where an optional annotation is
displayed in brackets after the severity.
This also adds a new flag `-f(no-)show-warning-groups` to control
whether to show which warning-group (such as `-Wall` or `-Wcompat`)
a warning belongs to. This flag is on by default.
This implements #10752
Reviewed By: quchen, bgamari, hvr
Differential Revision: https://phabricator.haskell.org/D1943
Diffstat (limited to 'compiler/rename/RnBinds.hs')
-rw-r--r-- | compiler/rename/RnBinds.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rename/RnBinds.hs b/compiler/rename/RnBinds.hs index 33a1cb447b..2f7e808cfe 100644 --- a/compiler/rename/RnBinds.hs +++ b/compiler/rename/RnBinds.hs @@ -462,7 +462,7 @@ rnBind _ bind@(PatBind { pat_lhs = pat -- or an occurrence of, a variable on the RHS ; whenWOptM Opt_WarnUnusedPatternBinds $ when (null bndrs && not is_wild_pat) $ - addWarn $ unusedPatBindWarn bind' + addWarn (Reason Opt_WarnUnusedPatternBinds) $ unusedPatBindWarn bind' ; fvs' `seq` -- See Note [Free-variable space leak] return (bind', bndrs, all_fvs) } @@ -1104,7 +1104,7 @@ rnGRHS' ctxt rnBody (GRHS guards rhs) rnBody rhs ; unless (pattern_guards_allowed || is_standard_guard guards') - (addWarn (nonStdGuardErr guards')) + (addWarn NoReason (nonStdGuardErr guards')) ; return (GRHS guards' rhs', fvs) } where |