Commit 125aa2b8 authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan Committed by Marge Bot
Browse files

Remove leftover comment in tcRnModule', redundant bind

The code for the comment was moved in dc8c03b2 but the comment was
forgotten.
parent c409961a
Pipeline #18467 failed with stages
in 484 minutes and 8 seconds
...@@ -519,36 +519,31 @@ tcRnModule' sum save_rn_syntax mod = do ...@@ -519,36 +519,31 @@ tcRnModule' sum save_rn_syntax mod = do
let allSafeOK = safeInferred dflags && tcSafeOK let allSafeOK = safeInferred dflags && tcSafeOK
-- end of the safe haskell line, how to respond to user? -- end of the safe haskell line, how to respond to user?
res <- if not (safeHaskellOn dflags) if not (safeHaskellOn dflags)
|| (safeInferOn dflags && not allSafeOK) || (safeInferOn dflags && not allSafeOK)
-- if safe Haskell off or safe infer failed, mark unsafe -- if safe Haskell off or safe infer failed, mark unsafe
then markUnsafeInfer tcg_res whyUnsafe then markUnsafeInfer tcg_res whyUnsafe
-- module (could be) safe, throw warning if needed -- module (could be) safe, throw warning if needed
else do else do
tcg_res' <- hscCheckSafeImports tcg_res tcg_res' <- hscCheckSafeImports tcg_res
safe <- liftIO $ fst <$> readIORef (tcg_safeInfer tcg_res') safe <- liftIO $ fst <$> readIORef (tcg_safeInfer tcg_res')
when safe $ do when safe $ do
case wopt Opt_WarnSafe dflags of case wopt Opt_WarnSafe dflags of
True True
| safeHaskell dflags == Sf_Safe -> return () | safeHaskell dflags == Sf_Safe -> return ()
| otherwise -> (logWarnings $ unitBag $ | otherwise -> (logWarnings $ unitBag $
makeIntoWarning (Reason Opt_WarnSafe) $ makeIntoWarning (Reason Opt_WarnSafe) $
mkPlainWarnMsg dflags (warnSafeOnLoc dflags) $ mkPlainWarnMsg dflags (warnSafeOnLoc dflags) $
errSafe tcg_res') errSafe tcg_res')
False | safeHaskell dflags == Sf_Trustworthy && False | safeHaskell dflags == Sf_Trustworthy &&
wopt Opt_WarnTrustworthySafe dflags -> wopt Opt_WarnTrustworthySafe dflags ->
(logWarnings $ unitBag $ (logWarnings $ unitBag $
makeIntoWarning (Reason Opt_WarnTrustworthySafe) $ makeIntoWarning (Reason Opt_WarnTrustworthySafe) $
mkPlainWarnMsg dflags (trustworthyOnLoc dflags) $ mkPlainWarnMsg dflags (trustworthyOnLoc dflags) $
errTwthySafe tcg_res') errTwthySafe tcg_res')
False -> return () False -> return ()
return tcg_res' return tcg_res'
-- apply plugins to the type checking result
return res
where where
pprMod t = ppr $ moduleName $ tcg_mod t pprMod t = ppr $ moduleName $ tcg_mod t
errSafe t = quotes (pprMod t) <+> text "has been inferred as safe!" errSafe t = quotes (pprMod t) <+> text "has been inferred as safe!"
......
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