diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-10-28 21:05:34 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2022-11-04 15:54:25 +0100 |
commit | 4dd9e74bb216244c77e973eca8047447dddd1509 (patch) | |
tree | e11a998f4ca8a25badfb289e2ff540347e78acea /compiler/GHC/Tc/Errors | |
parent | 311251543f2e37af4a121e58028bfc46267a7fc9 (diff) | |
download | haskell-wip/strings-refactor3.tar.gz |
Minor refactor around FastStringswip/strings-refactor3
Pass FastStrings to functions directly, to make sure the rule
for fsLit "literal" fires.
Remove SDoc indirection in GHCi.UI.Tags and GHC.Unit.Module.Graph.
Diffstat (limited to 'compiler/GHC/Tc/Errors')
-rw-r--r-- | compiler/GHC/Tc/Errors/Hole.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs index 8ec874da41..5590e29454 100644 --- a/compiler/GHC/Tc/Errors/Hole.hs +++ b/compiler/GHC/Tc/Errors/Hole.hs @@ -82,7 +82,7 @@ import GHC.Builtin.Utils (knownKeyNames) import GHC.Tc.Errors.Hole.FitTypes import qualified Data.Set as Set import GHC.Types.SrcLoc -import GHC.Data.FastString (unpackFS) +import GHC.Data.FastString (NonDetFastString(..)) import GHC.Types.Unique.Map @@ -482,15 +482,16 @@ addHoleFitDocs fits = Just m -> Right m Nothing -> Left $ case nameSrcLoc name of - RealSrcLoc r _ -> unpackFS $ srcLocFile r - UnhelpfulLoc s -> unpackFS $ s + -- Nondeterminism is fine, this is used only to display a warning + RealSrcLoc r _ -> NonDetFastString $ srcLocFile r + UnhelpfulLoc s -> NonDetFastString s report mods = do { let warning = text "WARNING: Couldn't find any documentation for the following modules:" $+$ nest 2 - (pprWithCommas (either text ppr) (Set.toList mods) $+$ + (pprWithCommas (either ppr ppr) (Set.toList mods) $+$ text "Make sure the modules are compiled with '-haddock'.") - ; warnPprTrace (not $ Set.null mods)"addHoleFitDocs" warning (pure ()) + ; warnPprTrace (not $ Set.null mods) "addHoleFitDocs" warning (pure ()) } -- For pretty printing hole fits, we display the name and type of the fit, |