summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-13 23:51:24 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-13 23:51:24 -0400
commit6ce3b61e2e21a75f331221141a35e063afdb18e4 (patch)
tree43cc449ff7cd9466f00e5f5b80e1ebd69b99e541
parentb02242093b2458e2c446dd469e6f7cdd2a59e6a9 (diff)
downloadhaskell-wip/T16689.tar.gz
SafeHaskell: Don't throw -Wsafe warning if module is declared Safewip/T16689
Fixes #16689.
-rw-r--r--compiler/main/HscMain.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index a99fde706e..1960193358 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -520,7 +520,9 @@ tcRnModule' sum save_rn_syntax mod = do
safe <- liftIO $ fst <$> readIORef (tcg_safeInfer tcg_res')
when safe $ do
case wopt Opt_WarnSafe dflags of
- True -> (logWarnings $ unitBag $
+ True
+ | safeHaskell dflags == Sf_Safe -> return ()
+ | otherwise -> (logWarnings $ unitBag $
makeIntoWarning (Reason Opt_WarnSafe) $
mkPlainWarnMsg dflags (warnSafeOnLoc dflags) $
errSafe tcg_res')