Skip to content

Commit d61b290

Browse files
committed
Fix some warnings on ghc 8.10
1 parent 34df92c commit d61b290

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -929,29 +929,29 @@ checkHieFile recorder se@ShakeExtras{withHieDb} tag hieFileLocation = do
929929
-- Log that the HIE file does not exist where we expect that it should.
930930
logHieFileMissing :: IO HieFileCheck
931931
logHieFileMissing = do
932-
let log :: Log
933-
log = LogMissingHieFile hieFileLocation
934-
logWith recorder Logger.Debug log
932+
let logMissing :: Log
933+
logMissing = LogMissingHieFile hieFileLocation
934+
logWith recorder Logger.Debug logMissing
935935
pure HieFileMissing
936936
-- When we know that the HIE file exists, check that it has not already
937937
-- been indexed. If it hasn't, try to load it.
938938
checkExistingHieFile :: IO HieFileCheck
939939
checkExistingHieFile = do
940-
hash <- Util.getFileHash $ fromNormalizedFilePath hieFileLocation
941-
mrow <- withHieDb (\hieDb -> HieDb.lookupHieFileFromHash hieDb hash)
940+
hieFileHash <- Util.getFileHash $ fromNormalizedFilePath hieFileLocation
941+
mrow <- withHieDb (\hieDb -> HieDb.lookupHieFileFromHash hieDb hieFileHash)
942942
dbHieFileLocation <- traverse (makeAbsolute . HieDb.hieModuleHieFile) mrow
943-
bool (tryLoadingHieFile hash) (pure HieAlreadyIndexed) $
943+
bool (tryLoadingHieFile hieFileHash) (pure HieAlreadyIndexed) $
944944
Just hieFileLocation == fmap toNormalizedFilePath' dbHieFileLocation
945945
-- Attempt to load the HIE file, logging on failure (logging happens
946946
-- in readHieFileFromDisk). If the file loads successfully, return
947947
-- the data necessary for indexing it in the HieDb database.
948948
tryLoadingHieFile :: Util.Fingerprint -> IO HieFileCheck
949-
tryLoadingHieFile hash = do
949+
tryLoadingHieFile hieFileHash = do
950950
ehf <- runIdeAction tag se $ runExceptT $
951951
readHieFileFromDisk recorder hieFileLocation
952952
pure $ case ehf of
953953
Left err -> CouldNotLoadHie err
954-
Right hf -> DoIndexing hash hf
954+
Right hf -> DoIndexing hieFileHash hf
955955

956956
-- | Check state of hiedb after loading an iface from disk - have we indexed the corresponding `.hie` file?
957957
-- This function is responsible for ensuring database consistency
@@ -966,7 +966,7 @@ getModIfaceFromDiskAndIndexRule recorder =
966966
-- doesn't need early cutoff since all its dependencies already have it
967967
defineNoDiagnostics (cmapWithPrio LogShake recorder) $ \GetModIfaceFromDiskAndIndex f -> do
968968
x <- use_ GetModIfaceFromDisk f
969-
se@ShakeExtras{withHieDb} <- getShakeExtras
969+
se <- getShakeExtras
970970

971971
-- GetModIfaceFromDisk should have written a `.hie` file, must check if it matches version in db
972972
let ms = hirModSummary x
@@ -985,9 +985,9 @@ getModIfaceFromDiskAndIndexRule recorder =
985985
-- Uh oh, we failed to read the file for some reason, need to regenerate it
986986
CouldNotLoadHie err -> hieFailure $ Just err
987987
-- can just re-index the file we read from disk
988-
DoIndexing hash hf -> liftIO $ do
988+
DoIndexing hieFileHash hf -> liftIO $ do
989989
logWith recorder Logger.Debug $ LogReindexingHieFile f
990-
indexHieFile se hie_loc (HieDb.RealFile $ fromNormalizedFilePath f) hash hf
990+
indexHieFile se hie_loc (HieDb.RealFile $ fromNormalizedFilePath f) hieFileHash hf
991991
return (Just x)
992992

993993
newtype DisplayTHWarning = DisplayTHWarning (IO())

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,7 @@ defineEarlyCutoff' doDiagnostics cmp key file mbOld mode action = do
12481248
-- * creating bogus "file does not exists" diagnostics
12491249
| otherwise = useWithoutDependency (GetModificationTime_ False) fp
12501250
isSafeDependencyRule
1251-
:: forall k v
1252-
. IdeRule k v
1253-
=> k
1251+
:: k
12541252
-> Bool
12551253
isSafeDependencyRule _k
12561254
-- The only Rules that are safe for dependencies.

ghcide/src/Development/IDE/Types/HscEnvEq.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import qualified Data.Unique as Unique
2525
import Development.IDE.Core.Dependencies (indexDependencyHieFiles)
2626
import Development.IDE.Core.Rules (Log)
2727
import Development.IDE.Core.Shake (ShakeExtras)
28-
import Development.IDE.GHC.Compat
28+
import Development.IDE.GHC.Compat hiding (newUnique)
2929
import qualified Development.IDE.GHC.Compat.Util as Maybes
3030
import Development.IDE.GHC.Error (catchSrcErrors)
3131
import Development.IDE.GHC.Util (lookupPackageConfig)

0 commit comments

Comments
 (0)