aboutsummaryrefslogtreecommitdiff
path: root/src/Haddock/Interface/LexParseRn.hs
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2012-04-03 17:58:02 -0700
committerDavid Terei <davidterei@gmail.com>2012-04-04 15:08:21 -0700
commit853397a9c62f906f5c8b4dc889c97ad2823f9c07 (patch)
treef899cff780e1d527ea1cbc542eee20129c6b00e7 /src/Haddock/Interface/LexParseRn.hs
parent0a9b99a0c916100e7087026d29253d72f1ff9057 (diff)
Fix reporting of modules safe haskell mode (#5989)
Diffstat (limited to 'src/Haddock/Interface/LexParseRn.hs')
-rw-r--r--src/Haddock/Interface/LexParseRn.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs
index f70c5953..27a52ea2 100644
--- a/src/Haddock/Interface/LexParseRn.hs
+++ b/src/Haddock/Interface/LexParseRn.hs
@@ -67,8 +67,9 @@ lexParseRnMbHaddockComment dflags hty gre (Just d) = lexParseRnHaddockComment df
-- yes, you always get a HaddockModInfo though it might be empty
-lexParseRnHaddockModHeader :: DynFlags -> GlobalRdrEnv -> GhcDocHdr -> ErrMsgM (HaddockModInfo Name, Maybe (Doc Name))
-lexParseRnHaddockModHeader dflags gre mbStr = do
+lexParseRnHaddockModHeader :: DynFlags -> GlobalRdrEnv -> SafeHaskellMode -> GhcDocHdr
+ -> ErrMsgM (HaddockModInfo Name, Maybe (Doc Name))
+lexParseRnHaddockModHeader dflags gre safety mbStr = do
(hmi, docn) <-
case mbStr of
Nothing -> return failure
@@ -79,9 +80,8 @@ lexParseRnHaddockModHeader dflags gre mbStr = do
tell ["haddock module header parse failed: " ++ mess]
return failure
Right (info, doc) -> return (renameHmi gre info, Just (rename gre doc))
- return (hmi { hmi_safety = safety }, docn)
+ return (hmi { hmi_safety = Just $ showPpr safety }, docn)
where
- safety = Just $ showPpr $ safeHaskell dflags
failure = (emptyHaddockModInfo, Nothing)