summaryrefslogtreecommitdiff
path: root/compiler/GHC/Utils
diff options
context:
space:
mode:
authorZubin Duggal <zubin.duggal@gmail.com>2021-06-30 15:56:13 +0530
committerZubin <zubin.duggal@gmail.com>2021-07-13 20:45:44 +0000
commit9992159318d0f0c3fcf1c1ae060bb15d0b5fc1a8 (patch)
tree21d54c9455527aebb683ba8df94824759e0b015d /compiler/GHC/Utils
parentbb8e0df8f4187a4f4d0788dd3da3ef6f9268d378 (diff)
downloadhaskell-9992159318d0f0c3fcf1c1ae060bb15d0b5fc1a8.tar.gz
Don't panic on 'no skolem info' and add failing testswip/no-skolem-panic
Diffstat (limited to 'compiler/GHC/Utils')
-rw-r--r--compiler/GHC/Utils/Trace.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/GHC/Utils/Trace.hs b/compiler/GHC/Utils/Trace.hs
index ac29cd6fd8..5da6e6e5d9 100644
--- a/compiler/GHC/Utils/Trace.hs
+++ b/compiler/GHC/Utils/Trace.hs
@@ -7,6 +7,7 @@ module GHC.Utils.Trace
, pprSTrace
, pprTraceException
, warnPprTrace
+ , pprTraceUserWarning
, trace
)
where
@@ -71,6 +72,15 @@ warnPprTrace True msg x
(msg $$ withFrozenCallStack traceCallStackDoc )
x
+-- | For when we want to show the user a non-fatal WARNING so that they can
+-- report a GHC bug, but don't want to panic.
+pprTraceUserWarning :: HasCallStack => SDoc -> a -> a
+pprTraceUserWarning msg x
+ | unsafeHasNoDebugOutput = x
+ | otherwise = pprDebugAndThen defaultSDocContext trace (text "WARNING:")
+ (msg $$ withFrozenCallStack traceCallStackDoc )
+ x
+
traceCallStackDoc :: HasCallStack => SDoc
traceCallStackDoc =
hang (text "Call stack:")