@@ -856,9 +856,9 @@ generateHieAsts hscEnv tcm =
856856 where
857857 dflags = hsc_dflags hscEnv
858858#if MIN_VERSION_ghc(9,0,0)
859- run ts =
859+ run _ts = -- ts is only used in GHC 9.2
860860#if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
861- fmap (join . snd ) . liftIO . initDs hscEnv ts
861+ fmap (join . snd ) . liftIO . initDs hscEnv _ts
862862#else
863863 id
864864#endif
@@ -1086,7 +1086,7 @@ mergeEnvs env mg ms extraMods envs = do
10861086 -- Prefer non-boot files over non-boot files
10871087 -- otherwise we can get errors like https://gitlab.haskell.org/ghc/ghc/-/issues/19816
10881088 -- if a boot file shadows over a non-boot file
1089- combineModuleLocations a@ (InstalledFound ml m) b | Just fp <- ml_hs_file ml, not (" boot" `isSuffixOf` fp) = a
1089+ combineModuleLocations a@ (InstalledFound ml _) _ | Just fp <- ml_hs_file ml, not (" boot" `isSuffixOf` fp) = a
10901090 combineModuleLocations _ b = b
10911091
10921092 concatFC :: FinderCacheState -> [FinderCache ] -> IO FinderCache
@@ -1135,9 +1135,10 @@ getModSummaryFromImports
11351135 -> UTCTime
11361136 -> Maybe Util. StringBuffer
11371137 -> ExceptT [FileDiagnostic ] IO ModSummaryResult
1138- getModSummaryFromImports env fp modTime mContents = do
1139-
1140- (contents, opts, ppEnv, src_hash) <- preprocessor env fp mContents
1138+ -- modTime is only used in GHC < 9.4
1139+ getModSummaryFromImports env fp _modTime mContents = do
1140+ -- src_hash is only used in GHC >= 9.4
1141+ (contents, opts, ppEnv, _src_hash) <- preprocessor env fp mContents
11411142
11421143 let dflags = hsc_dflags ppEnv
11431144
@@ -1153,7 +1154,8 @@ getModSummaryFromImports env fp modTime mContents = do
11531154 (src_idecls, ord_idecls) = partition ((== IsBoot ) . ideclSource. unLoc) imps
11541155
11551156 -- GHC.Prim doesn't exist physically, so don't go looking for it.
1156- (ordinary_imps, ghc_prim_imports)
1157+ -- ghc_prim_imports is only used in GHC >= 9.4
1158+ (ordinary_imps, _ghc_prim_imports)
11571159 = partition ((/= moduleName gHC_PRIM) . unLoc
11581160 . ideclName . unLoc)
11591161 ord_idecls
@@ -1177,7 +1179,7 @@ getModSummaryFromImports env fp modTime mContents = do
11771179 rn_imps = fmap (\ (pk, lmn@ (L _ mn)) -> (rn_pkg_qual mn pk, lmn))
11781180 srcImports = rn_imps $ map convImport src_idecls
11791181 textualImports = rn_imps $ map convImport (implicit_imports ++ ordinary_imps)
1180- ghc_prim_import = not (null ghc_prim_imports )
1182+ ghc_prim_import = not (null _ghc_prim_imports )
11811183#else
11821184 srcImports = map convImport src_idecls
11831185 textualImports = map convImport (implicit_imports ++ ordinary_imps)
@@ -1204,10 +1206,10 @@ getModSummaryFromImports env fp modTime mContents = do
12041206#if MIN_VERSION_ghc(9,3,0)
12051207 , ms_dyn_obj_date = Nothing
12061208 , ms_ghc_prim_import = ghc_prim_import
1207- , ms_hs_hash = src_hash
1209+ , ms_hs_hash = _src_hash
12081210
12091211#else
1210- , ms_hs_date = modTime
1212+ , ms_hs_date = _modTime
12111213#endif
12121214 , ms_hsc_src = sourceType
12131215 -- The contents are used by the GetModSummary rule
@@ -1475,19 +1477,21 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do
14751477
14761478 -- The source is modified if it is newer than the destination (iface file)
14771479 -- A more precise check for the core file is performed later
1478- let sourceMod = case mb_dest_version of
1480+ let _sourceMod = case mb_dest_version of -- sourceMod is only used in GHC < 9.4
14791481 Nothing -> SourceModified -- destination file doesn't exist, assume modified source
14801482 Just dest_version
14811483 | source_version <= dest_version -> SourceUnmodified
14821484 | otherwise -> SourceModified
14831485
1484- old_iface <- case mb_old_iface of
1486+ -- old_iface is only used in GHC >= 9.4
1487+ _old_iface <- case mb_old_iface of
14851488 Just iface -> pure (Just iface)
14861489 Nothing -> do
1487- let ncu = hsc_NC sessionWithMsDynFlags
1488- read_dflags = hsc_dflags sessionWithMsDynFlags
1490+ -- ncu and read_dflags are only used in GHC >= 9.4
1491+ let _ncu = hsc_NC sessionWithMsDynFlags
1492+ _read_dflags = hsc_dflags sessionWithMsDynFlags
14891493#if MIN_VERSION_ghc(9,3,0)
1490- read_result <- liftIO $ readIface read_dflags ncu mod iface_file
1494+ read_result <- liftIO $ readIface _read_dflags _ncu mod iface_file
14911495#else
14921496 read_result <- liftIO $ initIfaceCheck (text " readIface" ) sessionWithMsDynFlags
14931497 $ readIface mod iface_file
@@ -1502,11 +1506,11 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do
15021506 -- given that the source is unmodified
15031507 (recomp_iface_reqd, mb_checked_iface)
15041508#if MIN_VERSION_ghc(9,3,0)
1505- <- liftIO $ checkOldIface sessionWithMsDynFlags ms old_iface >>= \ case
1509+ <- liftIO $ checkOldIface sessionWithMsDynFlags ms _old_iface >>= \ case
15061510 UpToDateItem x -> pure (UpToDate , Just x)
15071511 OutOfDateItem reason x -> pure (NeedsRecompile reason, x)
15081512#else
1509- <- liftIO $ checkOldIface sessionWithMsDynFlags ms sourceMod mb_old_iface
1513+ <- liftIO $ checkOldIface sessionWithMsDynFlags ms _sourceMod mb_old_iface
15101514#endif
15111515
15121516 let do_regenerate _reason = withTrace " regenerate interface" $ \ setTag -> do
0 commit comments