summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-11-01 12:22:05 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-11 13:17:22 -0500
commit6dab0046b575e102bf3245fd63d5ac6bc6f4204d (patch)
tree777586c9cdbb4333f4fe663d1f0ad2c83e208fd3 /compiler
parent430eccefaef1bc78a00a5327e6e485299be674a5 (diff)
downloadhaskell-6dab0046b575e102bf3245fd63d5ac6bc6f4204d.tar.gz
driver: Fix -fdefer-diagnostics flag
The `withDeferredDiagnostics` wrapper wasn't doing anything because the session it was modifying wasn't used in hsc_env. Therefore the fix is simple, just push the `getSession` call into the scope of `withDeferredDiagnostics`. Fixes #22391
Diffstat (limited to 'compiler')
-rw-r--r--compiler/GHC/Driver/Make.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index ff2b73eea3..462a52ea45 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -741,8 +741,8 @@ load' mhmi_cache how_much mHscMessage mod_graph = do
Just n -> return n
setSession $ hscUpdateHUG (unitEnv_map pruneHomeUnitEnv) hsc_env
- hsc_env <- getSession
- (upsweep_ok, hsc_env1) <- withDeferredDiagnostics $
+ (upsweep_ok, hsc_env1) <- withDeferredDiagnostics $ do
+ hsc_env <- getSession
liftIO $ upsweep n_jobs hsc_env mhmi_cache mHscMessage (toCache pruned_cache) build_plan
setSession hsc_env1
case upsweep_ok of