[commit: ghc] wip/remove-cabal-dep: Fix warnings arising from the package db refactoring (e0805af)

git at git.haskell.org git at git.haskell.org
Fri Aug 22 15:38:46 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/remove-cabal-dep
Link       : http://ghc.haskell.org/trac/ghc/changeset/e0805afa5ef2690bd357e4444be55d08e290e60f/ghc

>---------------------------------------------------------------

commit e0805afa5ef2690bd357e4444be55d08e290e60f
Author: Duncan Coutts <duncan at well-typed.com>
Date:   Fri Aug 22 15:57:07 2014 +0100

    Fix warnings arising from the package db refactoring


>---------------------------------------------------------------

e0805afa5ef2690bd357e4444be55d08e290e60f
 libraries/bin-package-db/GHC/PackageDb.hs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libraries/bin-package-db/GHC/PackageDb.hs b/libraries/bin-package-db/GHC/PackageDb.hs
index 08dabd2..b29d707 100644
--- a/libraries/bin-package-db/GHC/PackageDb.hs
+++ b/libraries/bin-package-db/GHC/PackageDb.hs
@@ -1,6 +1,6 @@
 {-# LANGUAGE CPP #-}
 -- This module deliberately defines orphan instances for now (Binary Version).
-{-# OPTIONS_GHC -fno-warn-orphans #-}
+{-# OPTIONS_GHC -fno-warn-orphans -fno-warn-name-shadowing #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  GHC.PackageDb
@@ -246,10 +246,10 @@ writeFileAtomic targetPath content = do
   let (targetDir, targetName) = splitFileName targetPath
   Exception.bracketOnError
     (openBinaryTempFileWithDefaultPermissions targetDir $ targetName <.> "tmp")
-    (\(tmpPath, handle) -> hClose handle >> removeFile tmpPath)
-    (\(tmpPath, handle) -> do
-        BS.Lazy.hPut handle content
-        hClose handle
+    (\(tmpPath, hnd) -> hClose hnd >> removeFile tmpPath)
+    (\(tmpPath, hnd) -> do
+        BS.Lazy.hPut hnd content
+        hClose hnd
 #if mingw32_HOST_OS || mingw32_TARGET_OS
         renameFile tmpPath targetPath
           -- If the targetPath exists then renameFile will fail



More information about the ghc-commits mailing list