[Git][ghc/ghc][master] Remove leftover comment in tcRnModule', redundant bind

Marge Bot gitlab at gitlab.haskell.org
Thu Apr 23 03:17:01 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
125aa2b8 by Ömer Sinan Ağacan at 2020-04-22T23:16:51-04:00
Remove leftover comment in tcRnModule', redundant bind

The code for the comment was moved in dc8c03b2a5c but the comment was
forgotten.

- - - - -


1 changed file:

- compiler/GHC/Driver/Main.hs


Changes:

=====================================
compiler/GHC/Driver/Main.hs
=====================================
@@ -519,36 +519,31 @@ tcRnModule' sum save_rn_syntax mod = do
     let allSafeOK = safeInferred dflags && tcSafeOK
 
     -- end of the safe haskell line, how to respond to user?
-    res <- if not (safeHaskellOn dflags)
-                || (safeInferOn dflags && not allSafeOK)
-             -- if safe Haskell off or safe infer failed, mark unsafe
-             then markUnsafeInfer tcg_res whyUnsafe
-
-             -- module (could be) safe, throw warning if needed
-             else do
-                 tcg_res' <- hscCheckSafeImports tcg_res
-                 safe <- liftIO $ fst <$> readIORef (tcg_safeInfer tcg_res')
-                 when safe $ do
-                   case wopt Opt_WarnSafe dflags of
-                     True
-                       | safeHaskell dflags == Sf_Safe -> return ()
-                       | otherwise -> (logWarnings $ unitBag $
-                              makeIntoWarning (Reason Opt_WarnSafe) $
-                              mkPlainWarnMsg dflags (warnSafeOnLoc dflags) $
-                              errSafe tcg_res')
-                     False | safeHaskell dflags == Sf_Trustworthy &&
-                             wopt Opt_WarnTrustworthySafe dflags ->
-                             (logWarnings $ unitBag $
-                              makeIntoWarning (Reason Opt_WarnTrustworthySafe) $
-                              mkPlainWarnMsg dflags (trustworthyOnLoc dflags) $
-                              errTwthySafe tcg_res')
-                     False -> return ()
-                 return tcg_res'
-
-    -- apply plugins to the type checking result
-
-
-    return res
+    if not (safeHaskellOn dflags)
+         || (safeInferOn dflags && not allSafeOK)
+      -- if safe Haskell off or safe infer failed, mark unsafe
+      then markUnsafeInfer tcg_res whyUnsafe
+
+      -- module (could be) safe, throw warning if needed
+      else do
+          tcg_res' <- hscCheckSafeImports tcg_res
+          safe <- liftIO $ fst <$> readIORef (tcg_safeInfer tcg_res')
+          when safe $ do
+            case wopt Opt_WarnSafe dflags of
+              True
+                | safeHaskell dflags == Sf_Safe -> return ()
+                | otherwise -> (logWarnings $ unitBag $
+                       makeIntoWarning (Reason Opt_WarnSafe) $
+                       mkPlainWarnMsg dflags (warnSafeOnLoc dflags) $
+                       errSafe tcg_res')
+              False | safeHaskell dflags == Sf_Trustworthy &&
+                      wopt Opt_WarnTrustworthySafe dflags ->
+                      (logWarnings $ unitBag $
+                       makeIntoWarning (Reason Opt_WarnTrustworthySafe) $
+                       mkPlainWarnMsg dflags (trustworthyOnLoc dflags) $
+                       errTwthySafe tcg_res')
+              False -> return ()
+          return tcg_res'
   where
     pprMod t  = ppr $ moduleName $ tcg_mod t
     errSafe t = quotes (pprMod t) <+> text "has been inferred as safe!"



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/125aa2b8b8bb402d7819c3a35255b65c15b8bf9a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/125aa2b8b8bb402d7819c3a35255b65c15b8bf9a
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200422/6700f070/attachment-0001.html>


More information about the ghc-commits mailing list