diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2016-11-06 12:46:40 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2016-11-06 12:46:40 +0000 |
commit | 1c886eadcfbb593bb06bfff7b8a4914b5349f080 (patch) | |
tree | bec78ac6e53dd206292bc8c4dd272c122bd23859 | |
parent | 1cab42d88d91f61528a160c212a163f9b2147760 (diff) | |
download | haskell-1c886eadcfbb593bb06bfff7b8a4914b5349f080.tar.gz |
Stop -dno-debug-output suppressing -ddump-tc-trace
Summary:
The user manual states that -dno-debug-output should suppress
*unsolicited* debugging output which essentially amounts to calls
to `pprTrace`. Before I unified the interface of `traceTc` and
`traceRn`, the flag suppressed calls to `traceTc` but not to `traceRn`
or any other tracing function already controlled by a flag.
Thus, in order to make the behaviour more uniform, it seemed best to
remove this one special case.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2628
GHC Trac Issues: #12691
-rw-r--r-- | compiler/typecheck/TcRnMonad.hs | 14 | ||||
-rw-r--r-- | testsuite/tests/indexed-types/should_fail/T8129.stdout | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index d3ae05861b..b958cf8306 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -662,18 +662,18 @@ updTcRef ref fn = liftIO $ do { old <- readIORef ref -- Typechecker trace traceTc :: String -> SDoc -> TcRn () traceTc = - guardedTraceOptTcRn Opt_D_dump_tc_trace + labelledTraceOptTcRn Opt_D_dump_tc_trace -- Renamer Trace traceRn :: String -> SDoc -> TcRn () traceRn = - guardedTraceOptTcRn Opt_D_dump_rn_trace + labelledTraceOptTcRn Opt_D_dump_rn_trace --- | Do not display a trace if `-dno-debug-output` is on -guardedTraceOptTcRn :: DumpFlag -> String -> SDoc -> TcRn () -guardedTraceOptTcRn flag herald doc = do - unless opt_NoDebugOutput - ( traceOptTcRn flag (formatTraceMsg herald doc) ) +-- | Trace when a certain flag is enabled. This is like `traceOptTcRn` +-- but accepts a string as a label and formats the trace message uniformly. +labelledTraceOptTcRn :: DumpFlag -> String -> SDoc -> TcRn () +labelledTraceOptTcRn flag herald doc = do + traceOptTcRn flag (formatTraceMsg herald doc) formatTraceMsg :: String -> SDoc -> SDoc formatTraceMsg herald doc = hang (text herald) 2 doc diff --git a/testsuite/tests/indexed-types/should_fail/T8129.stdout b/testsuite/tests/indexed-types/should_fail/T8129.stdout index bffa3dae0b..f2bab63c9e 100644 --- a/testsuite/tests/indexed-types/should_fail/T8129.stdout +++ b/testsuite/tests/indexed-types/should_fail/T8129.stdout @@ -1 +1,3 @@ • Could not deduce (C x0 (F x0)) + • Could not deduce (C x0 (F x0)) + • Could not deduce (C x0 (F x0)) |