diff options
| author | Owen Shepherd <owen@owen.cafe> | 2022-10-11 16:18:56 +0100 |
|---|---|---|
| committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-10-27 13:54:33 -0400 |
| commit | 223e159d7af546a7176eef073e6e599b3c261c9c (patch) | |
| tree | 2d9039801ae577d2e51e5b7a4c94ebaeaa1b1117 /compiler/GHC/Unit/Module | |
| parent | f60a1a62bf88ec787a5b5d1725129a24b6b81f4a (diff) | |
| download | haskell-223e159d7af546a7176eef073e6e599b3c261c9c.tar.gz | |
Remove source location information from interface files
This change aims to minimize source location information leaking
into interface files, which makes ABI hashes dependent on the
build location.
The `Binary (Located a)` instance has been removed completely.
It seems that the HIE interface still needs the ability to
serialize SrcSpans, but by wrapping the instances, it should
be a lot more difficult to inadvertently add source location
information.
Diffstat (limited to 'compiler/GHC/Unit/Module')
| -rw-r--r-- | compiler/GHC/Unit/Module/Warnings.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/GHC/Unit/Module/Warnings.hs b/compiler/GHC/Unit/Module/Warnings.hs index 6dae41ecfc..75f3950208 100644 --- a/compiler/GHC/Unit/Module/Warnings.hs +++ b/compiler/GHC/Unit/Module/Warnings.hs @@ -61,21 +61,21 @@ instance Outputable (WarningTxt pass) where instance Binary (WarningTxt GhcRn) where put_ bh (WarningTxt s w) = do putByte bh 0 - put_ bh s - put_ bh w + put_ bh $ unLoc s + put_ bh $ unLoc <$> w put_ bh (DeprecatedTxt s d) = do putByte bh 1 - put_ bh s - put_ bh d + put_ bh $ unLoc s + put_ bh $ unLoc <$> d get bh = do h <- getByte bh case h of - 0 -> do s <- get bh - w <- get bh + 0 -> do s <- noLoc <$> get bh + w <- fmap noLoc <$> get bh return (WarningTxt s w) - _ -> do s <- get bh - d <- get bh + _ -> do s <- noLoc <$> get bh + d <- fmap noLoc <$> get bh return (DeprecatedTxt s d) |
