summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Module/ModIface.hs
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2022-12-07 19:24:59 +0530
committerMatthew Pickering <matthewtpickering@gmail.com>2023-01-03 12:22:11 +0000
commit62b9a7b23b20f5cf0a2de14251c2096098009f10 (patch)
tree425f6509a48e28c41bdbaff2e7fba6f6749eff8f /compiler/GHC/Unit/Module/ModIface.hs
parenta5bd0eb8dd1d03c54e1b0b476ebbc4cc886d6f19 (diff)
downloadhaskell-wip/force-docs.tar.gz
Force the Docs structure to prevent leaks in GHCi with -haddock without -fwrite-interfacewip/force-docs
Involves adding many new NFData instances. Without forcing Docs, references to the TcGblEnv for each module are retained by the Docs structure. Usually these are forced when the ModIface is serialised but not when we aren't writing the interface.
Diffstat (limited to 'compiler/GHC/Unit/Module/ModIface.hs')
-rw-r--r--compiler/GHC/Unit/Module/ModIface.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Unit/Module/ModIface.hs b/compiler/GHC/Unit/Module/ModIface.hs
index 1d5280f4fa..d46160a1a6 100644
--- a/compiler/GHC/Unit/Module/ModIface.hs
+++ b/compiler/GHC/Unit/Module/ModIface.hs
@@ -240,7 +240,7 @@ data ModIface_ (phase :: ModIfacePhase)
-- See Note [Trust Own Package] in GHC.Rename.Names
mi_complete_matches :: ![IfaceCompleteMatch],
- mi_docs :: Maybe Docs,
+ mi_docs :: !(Maybe Docs),
-- ^ Docstrings and related data for use by haddock, the ghci
-- @:doc@ command, and other tools.
--
@@ -554,7 +554,7 @@ instance (NFData (IfaceBackendExts (phase :: ModIfacePhase)), NFData (IfaceDeclE
f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24) =
rnf f1 `seq` rnf f2 `seq` f3 `seq` f4 `seq` f5 `seq` f6 `seq` rnf f7 `seq` f8 `seq`
f9 `seq` rnf f10 `seq` rnf f11 `seq` rnf f12 `seq` f13 `seq` rnf f14 `seq` rnf f15 `seq` rnf f16 `seq`
- rnf f17 `seq` f18 `seq` rnf f19 `seq` rnf f20 `seq` f21 `seq` f22 `seq` f23 `seq` rnf f24
+ rnf f17 `seq` f18 `seq` rnf f19 `seq` rnf f20 `seq` rnf f21 `seq` f22 `seq` f23 `seq` rnf f24
`seq` ()