From 853397a9c62f906f5c8b4dc889c97ad2823f9c07 Mon Sep 17 00:00:00 2001 From: David Terei Date: Tue, 3 Apr 2012 17:58:02 -0700 Subject: Fix reporting of modules safe haskell mode (#5989) --- src/Haddock/Interface/LexParseRn.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Haddock/Interface/LexParseRn.hs') 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) -- cgit v1.2.3