diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2019-06-13 23:51:24 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2019-06-24 18:35:12 -0400 |
| commit | be72b2724fd0fc6b717f612b23cc16ec56873c07 (patch) | |
| tree | 95283e5e753d1aac719a0cbbb6f26177d95f7b32 | |
| parent | 0cc22a5f18a7c8cb68f0c1a5c01e50ca37cbb1a9 (diff) | |
| download | haskell-be72b2724fd0fc6b717f612b23cc16ec56873c07.tar.gz | |
SafeHaskell: Don't throw -Wsafe warning if module is declared Safe
Fixes #16689.
(cherry picked from commit 29ec33cd3ee390e8006a88d34f5ea0ac236663d0)
| -rw-r--r-- | compiler/main/HscMain.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 9825ee48c7..879e6c75ac 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -507,7 +507,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') |
