diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs index b3432d6975211ee4f7c61c668a706ee0e30dc8dc..97ee78fedb2d458ba7e688f75c6b5f812067460f 100644 --- a/compiler/GHC/Driver/Flags.hs +++ b/compiler/GHC/Driver/Flags.hs @@ -1370,8 +1370,7 @@ minusWeverythingOpts = [ toEnum 0 .. ] -- code future compatible to fix issues before they even generate warnings. minusWcompatOpts :: [WarningFlag] minusWcompatOpts - = [ Opt_WarnCompatUnqualifiedImports - , Opt_WarnImplicitRhsQuantification + = [ Opt_WarnImplicitRhsQuantification , Opt_WarnDeprecatedTypeAbstractions ] diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index d6c200994265bd591fac3155150b788aede0471b..a52591ebcd3ac764514cbd956a48e6cc853fad05 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -2328,7 +2328,8 @@ wWarningFlagsDeps = [minBound..maxBound] >>= \x -> case x of Opt_WarnPartialFields -> warnSpec x Opt_WarnPrepositiveQualifiedModule -> warnSpec x Opt_WarnUnusedPackages -> warnSpec x - Opt_WarnCompatUnqualifiedImports -> warnSpec x + Opt_WarnCompatUnqualifiedImports -> + depWarnSpec x "This warning no longer does anything; see GHC #24904" Opt_WarnInvalidHaddock -> warnSpec x Opt_WarnOperatorWhitespaceExtConflict -> warnSpec x Opt_WarnOperatorWhitespace -> warnSpec x diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 1315dfb9d6bc2ae3b56bf893946dd8991f8c7669..27e8b2e014710fafc2ce7f09779243b8cec3be0b 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -169,7 +169,6 @@ as ``-Wno-...`` for every individual warning in the group. .. hlist:: :columns: 3 - * :ghc-flag:`-Wcompat-unqualified-imports` * :ghc-flag:`-Wimplicit-rhs-quantification` * :ghc-flag:`-Wdeprecated-type-abstractions` @@ -296,25 +295,16 @@ of ``-W(no-)*``. recognised. .. ghc-flag:: -Wcompat-unqualified-imports - :shortdesc: Report unqualified imports of core libraries which are expected - to cause compatibility problems in future releases. + :shortdesc: *(deprecated)* + Report unqualified imports of core libraries which are expected + to cause compatibility problems in future releases. :type: dynamic :reverse: -Wno-compat-unqualified-imports :category: :since: 8.10 - Warns on unqualified imports of core library modules which are subject to - change in future GHC releases. Currently the following modules are covered - by this warning: - - - ``Data.List`` due to the future addition of ``Data.List.singleton`` and - specialisation of exports to the ``[]`` type. See the - `mailing list <https://groups.google.com/forum/#!topic/haskell-core-libraries/q3zHLmzBa5E>`_ - for details. - - This warning can be addressed by either adding an explicit import list or - using a ``qualified`` import. + This warning is deprecated. It no longer has any effect since GHC 9.12. .. ghc-flag:: -Wprepositive-qualified-module :shortdesc: Report imports with a leading/prepositive "qualified" diff --git a/libraries/base/tests/T9586.hs b/libraries/base/tests/T9586.hs index cf1c35625cf61787bf73673dc3b0add464ae6aea..8310b99bf47dc20d6ccae06ed1f3ae0e771510fe 100644 --- a/libraries/base/tests/T9586.hs +++ b/libraries/base/tests/T9586.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - module XPrelude (module X) where import Control.Monad as X diff --git a/libraries/base/tests/list001.hs b/libraries/base/tests/list001.hs index a411952110f1b592db626b9347d21d6a9d1fafae..f15fb4da58b961de889c9ef4ed94d06b9512f98e 100644 --- a/libraries/base/tests/list001.hs +++ b/libraries/base/tests/list001.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} module Main where import Data.List diff --git a/testsuite/tests/ghci/scripts/T14828.script b/testsuite/tests/ghci/scripts/T14828.script index d8eea69b7cb17128e63d5ee403e3ed048b563166..59d616abdeac2c44988136cdaff3f21a82e37988 100644 --- a/testsuite/tests/ghci/scripts/T14828.script +++ b/testsuite/tests/ghci/scripts/T14828.script @@ -14,7 +14,6 @@ :p mempty :p mappend -:set -Wno-compat-unqualified-imports :m + Data.List :p foldl' diff --git a/testsuite/tests/ghci/scripts/ghci024.stdout b/testsuite/tests/ghci/scripts/ghci024.stdout index 2ffd2f63c51db86968b86b8e6e288a11c92c63d9..f46c059958bdfadbbb842c5a89faa300696d646c 100644 --- a/testsuite/tests/ghci/scripts/ghci024.stdout +++ b/testsuite/tests/ghci/scripts/ghci024.stdout @@ -16,7 +16,6 @@ other dynamic, non-language, flag settings: -fprefer-byte-code -fbreak-points warning settings: - -Wcompat-unqualified-imports -Wimplicit-rhs-quantification -Wdeprecated-type-abstractions ~~~~~~~~~~ Testing :set -a diff --git a/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32 b/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32 index 0af942df938decdd8f2a2c3820ddc16d88cb3e7d..527720d81fe80191fadd4796afd5c0c9256798cf 100644 --- a/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32 +++ b/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32 @@ -15,7 +15,6 @@ other dynamic, non-language, flag settings: -fprefer-byte-code -fbreak-points warning settings: - -Wcompat-unqualified-imports -Wimplicit-rhs-quantification -Wdeprecated-type-abstractions ~~~~~~~~~~ Testing :set -a diff --git a/testsuite/tests/ghci/scripts/ghci036.script b/testsuite/tests/ghci/scripts/ghci036.script index 105f147b54f24b69415e9f75abce3baa71affb38..1652fb067e92adbacfa88cc00994b8ef50b902c2 100644 --- a/testsuite/tests/ghci/scripts/ghci036.script +++ b/testsuite/tests/ghci/scripts/ghci036.script @@ -1,4 +1,3 @@ -:set -Wno-compat-unqualified-imports import Data.List (nub) :t nubBy import Data.List (nubBy) diff --git a/testsuite/tests/module/Mod137_A.hs b/testsuite/tests/module/Mod137_A.hs index 582ffbccd984f355ceb2ef7189714c6cec0acf8e..ba71afce39239236c21f5e570d6311ebad954085 100644 --- a/testsuite/tests/module/Mod137_A.hs +++ b/testsuite/tests/module/Mod137_A.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} module Mod137_A (module Data.Char) where import Data.Char diff --git a/testsuite/tests/module/Mod138_A.hs b/testsuite/tests/module/Mod138_A.hs index 67cbe97c79b802be96c554470811fb9825383bf2..44f6645d1b496a351f1984d1bf916c2f3ff00b0a 100644 --- a/testsuite/tests/module/Mod138_A.hs +++ b/testsuite/tests/module/Mod138_A.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} module Mod138_A (module Data.Char) where import qualified Data.Char diff --git a/testsuite/tests/module/Mod141_A.hs b/testsuite/tests/module/Mod141_A.hs index b49841be039651f4a4d1a4a910afcfc368646115..fc6c1da430b1b68b9055443f30c87b3997c3140f 100644 --- a/testsuite/tests/module/Mod141_A.hs +++ b/testsuite/tests/module/Mod141_A.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} module Mod141_A (partition, module Data.List) where import Data.List hiding (partition) diff --git a/testsuite/tests/module/mod154.hs b/testsuite/tests/module/mod154.hs index 4b7df0936cc9e9405b5635866757e77623e987c9..6155b830f06a7fd94187b9d4c3644489c62a9f65 100644 --- a/testsuite/tests/module/mod154.hs +++ b/testsuite/tests/module/mod154.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - -- !!! Default export list isn't the same as (module M) -- This should succeed, exporting only the local 'sort', -- and not being confused by the 'sort' from 'List'. diff --git a/testsuite/tests/overloadedlists/should_run/overloadedlistsrun05.hs b/testsuite/tests/overloadedlists/should_run/overloadedlistsrun05.hs index 3abdd5da875b67e60f5bc6bdac294563b83c906b..d24f2f36b14f3badeb8774dc8932901c2975c6e1 100644 --- a/testsuite/tests/overloadedlists/should_run/overloadedlistsrun05.hs +++ b/testsuite/tests/overloadedlists/should_run/overloadedlistsrun05.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} {-# LANGUAGE OverloadedLists, TypeFamilies, RebindableSyntax #-} import Prelude diff --git a/testsuite/tests/perf/compiler/T16875.hs b/testsuite/tests/perf/compiler/T16875.hs index dcf93ad5ac98283114838367807a8b232f9a23ee..0ba3c17d5b50f97e30a159b0d23b726090109303 100644 --- a/testsuite/tests/perf/compiler/T16875.hs +++ b/testsuite/tests/perf/compiler/T16875.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} module T16875 where import Control.Applicative diff --git a/testsuite/tests/perf/compiler/T16875.stderr b/testsuite/tests/perf/compiler/T16875.stderr index 0518194623341b3d9032647a4a7dc1f71018bac2..e0b1b7003a9baf897e16bf6a8d02881c8880823f 100644 --- a/testsuite/tests/perf/compiler/T16875.stderr +++ b/testsuite/tests/perf/compiler/T16875.stderr @@ -1,12 +1,12 @@ - -T16875.hs:13:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] +T16875.hs:12:5: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] • Found hole: _ :: p Where: ‘p’ is a rigid type variable bound by the inferred type of a :: p - at T16875.hs:13:1-5 + at T16875.hs:12:1-5 • In an equation for ‘a’: a = _ - • Relevant bindings include a :: p (bound at T16875.hs:13:1) + • Relevant bindings include a :: p (bound at T16875.hs:12:1) Valid hole fits include a :: forall {p}. p with a - (defined at T16875.hs:13:1) + (defined at T16875.hs:12:1) + diff --git a/testsuite/tests/rename/prog001/rn037.hs b/testsuite/tests/rename/prog001/rn037.hs index 2886bac59cffe9248780b29e98025dd0e375a8a0..23a4cfa4b9333fc17506677d91253e942772718e 100644 --- a/testsuite/tests/rename/prog001/rn037.hs +++ b/testsuite/tests/rename/prog001/rn037.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - -- !!! Checking that you can hide a constructor module ShouldCompile where diff --git a/testsuite/tests/rename/should_compile/T17244A.hs b/testsuite/tests/rename/should_compile/T17244A.hs index 290120affdf1f762ca97a56ad8b9384773442668..a1c2bbb70e061f147bf6de94e3b8f5cccd74a89c 100644 --- a/testsuite/tests/rename/should_compile/T17244A.hs +++ b/testsuite/tests/rename/should_compile/T17244A.hs @@ -2,7 +2,8 @@ module T17244A (hello) where --- This should warn with -Wcompat-unqualified-imports. +-- This used to warn with -Wcompat-unqualified-imports. +-- Now it shows the flag is deprecated. import Data.List hello :: [Int] -> Int diff --git a/testsuite/tests/rename/should_compile/T17244A.stderr b/testsuite/tests/rename/should_compile/T17244A.stderr new file mode 100644 index 0000000000000000000000000000000000000000..8c9f054f9f202cc7865a0b74b08d05f74ee94c0b --- /dev/null +++ b/testsuite/tests/rename/should_compile/T17244A.stderr @@ -0,0 +1,6 @@ +on the commandline: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)] + -Wno-error=compat-unqualified-imports is deprecated: This warning no longer does anything; see GHC #24904 + +T17244A.hs:1:17: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)] + -Wcompat-unqualified-imports is deprecated: This warning no longer does anything; see GHC #24904 + diff --git a/testsuite/tests/rename/should_compile/T17244B.hs b/testsuite/tests/rename/should_compile/T17244B.hs index 61cbde3bee856663a8de738ac6a3fc09a5c9d5d9..2b1b635052659a3ac15eff8e1e1c7cdb966af7a1 100644 --- a/testsuite/tests/rename/should_compile/T17244B.hs +++ b/testsuite/tests/rename/should_compile/T17244B.hs @@ -2,7 +2,8 @@ module T17244B (hello) where --- This should not warn with -Wcompat-unqualified-imports. +-- This wouldn't warn with -Wcompat-unqualified-imports. +-- The flag is deprecated now. import qualified Data.List as List hello :: [Int] -> Int diff --git a/testsuite/tests/rename/should_compile/T17244B.stderr b/testsuite/tests/rename/should_compile/T17244B.stderr index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ba9e88f7ff7971855c04eae5a63de449062dcb17 100644 --- a/testsuite/tests/rename/should_compile/T17244B.stderr +++ b/testsuite/tests/rename/should_compile/T17244B.stderr @@ -0,0 +1,3 @@ +T17244B.hs:1:17: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)] + -Wcompat-unqualified-imports is deprecated: This warning no longer does anything; see GHC #24904 + diff --git a/testsuite/tests/rename/should_compile/T17244C.hs b/testsuite/tests/rename/should_compile/T17244C.hs index 3da92dddd6cdc8793bd8298456166adb1da632ec..ee8287fa8d7c562c5f461c610bff274306473206 100644 --- a/testsuite/tests/rename/should_compile/T17244C.hs +++ b/testsuite/tests/rename/should_compile/T17244C.hs @@ -2,7 +2,8 @@ module T17244C (hello) where --- This should not warn with -Wcompat-unqualified-imports. +-- This would not warn with -Wcompat-unqualified-imports. +-- The flag is deprecated now. import Data.List (sum) hello :: [Int] -> Int diff --git a/testsuite/tests/rename/should_compile/T17244C.stderr b/testsuite/tests/rename/should_compile/T17244C.stderr index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..490d311ff7494709b909915ee3eecbfe7ca05482 100644 --- a/testsuite/tests/rename/should_compile/T17244C.stderr +++ b/testsuite/tests/rename/should_compile/T17244C.stderr @@ -0,0 +1,3 @@ +T17244C.hs:1:17: warning: [GHC-53692] [-Wdeprecated-flags (in -Wdefault)] + -Wcompat-unqualified-imports is deprecated: This warning no longer does anything; see GHC #24904 + diff --git a/testsuite/tests/rename/should_compile/T4478.hs b/testsuite/tests/rename/should_compile/T4478.hs index 9e3fcee81a08879a52967e7774e5d9eb84db3cd8..0e3e78396289384f6739d002bd461805e783ed6c 100644 --- a/testsuite/tests/rename/should_compile/T4478.hs +++ b/testsuite/tests/rename/should_compile/T4478.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - -- We don't want to warn about duplicate exports for things exported -- by both "module" exports module T4478 (module Prelude, module Data.List) where diff --git a/testsuite/tests/rename/should_compile/T7167.hs b/testsuite/tests/rename/should_compile/T7167.hs index 3fa28d21734b8472905d0046c6a8cf70ff023a8d..78e6938ef5d76b8946ce19e6a8bc093fde64912f 100644 --- a/testsuite/tests/rename/should_compile/T7167.hs +++ b/testsuite/tests/rename/should_compile/T7167.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} {-# OPTIONS_GHC -fwarn-dodgy-imports #-} module T7167 where diff --git a/testsuite/tests/rename/should_compile/T7167.stderr b/testsuite/tests/rename/should_compile/T7167.stderr index 3d5943c9975dd81b50d5e3776de8c1adabb61a2b..fce9d1fc8ed2c9afe072184960ef37c165b07f54 100644 --- a/testsuite/tests/rename/should_compile/T7167.stderr +++ b/testsuite/tests/rename/should_compile/T7167.stderr @@ -1,3 +1,3 @@ - -T7167.hs:6:26: warning: [GHC-61689] [-Wdodgy-imports (in -Wextra)] +T7167.hs:5:26: warning: [GHC-61689] [-Wdodgy-imports (in -Wextra)] Module ‘Data.List’ does not export ‘foo’. + diff --git a/testsuite/tests/rename/should_compile/rn025.hs b/testsuite/tests/rename/should_compile/rn025.hs index 141d105f2d0696aac31ef0908de60bfb26c07935..b8bf1ffe941f5f293c772756c0894fc0711895e7 100644 --- a/testsuite/tests/rename/should_compile/rn025.hs +++ b/testsuite/tests/rename/should_compile/rn025.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - -- !!! Re-exporting a module whose contents is partially hidden. module ShouldCompile ( module Data.List ) where diff --git a/testsuite/tests/rename/should_compile/rn027.hs b/testsuite/tests/rename/should_compile/rn027.hs index fb5bbdf52941764a5f7c313e8df2a2f335b02148..76cefe9310fbdf02e0d5d436e86b8121e0a651c1 100644 --- a/testsuite/tests/rename/should_compile/rn027.hs +++ b/testsuite/tests/rename/should_compile/rn027.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - -- !!! Checking that an imported module may still have -- !!! a local alias without having used 'qualified'. module ShouldCompile where diff --git a/testsuite/tests/rename/should_compile/rn031.hs b/testsuite/tests/rename/should_compile/rn031.hs index f84c793956fb6da50f61082baf4729a5af14b1dc..7b4a07d6260d38b1358d27ca037cd2b55f28a0dc 100644 --- a/testsuite/tests/rename/should_compile/rn031.hs +++ b/testsuite/tests/rename/should_compile/rn031.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - -- !!! Checking that an imported module may still have -- !!! a local alias without having used 'qualified'. module ShouldCompile where diff --git a/testsuite/tests/rename/should_compile/rn060.hs b/testsuite/tests/rename/should_compile/rn060.hs index ae5bbeeb681112130fde5115d9aeaeee54aa1d2d..754a0c951f66b2b7ce15ff599c391c829254066f 100644 --- a/testsuite/tests/rename/should_compile/rn060.hs +++ b/testsuite/tests/rename/should_compile/rn060.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - module Foo (module Data.List) where import Data.List diff --git a/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs b/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs index 2a89ee2d91c2f375ad1c5f1b0a396e34a7ae88ef..033896a17720134638aa65e65ba7d91755f638aa 100644 --- a/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs +++ b/testsuite/tests/safeHaskell/unsafeLibs/GoodImport03.hs @@ -47,7 +47,7 @@ import Data.Functor import Data.IORef import Data.Int import Data.Ix -import Data.List () -- -Wno-compat-unqualified-imports +import Data.List import Data.Maybe import Data.Monoid import Data.Ord diff --git a/testsuite/tests/warnings/should_compile/T11077.hs b/testsuite/tests/warnings/should_compile/T11077.hs index a5280d9f8dd62da770dc62bf8a96e27a115c0e7e..76533cb950468cfaeada55c0b3649b68d25c63f8 100644 --- a/testsuite/tests/warnings/should_compile/T11077.hs +++ b/testsuite/tests/warnings/should_compile/T11077.hs @@ -1,5 +1,3 @@ -{-# OPTIONS_GHC -Wno-compat-unqualified-imports #-} - module T11077 (module X, foo) where import Data.List as X foo = undefined diff --git a/testsuite/tests/warnings/should_compile/T11077.stderr b/testsuite/tests/warnings/should_compile/T11077.stderr index 011f5a264c04fe182d7172271f36b85ade2722fb..5488d836d878e44089fe1632eee15c047699e381 100644 --- a/testsuite/tests/warnings/should_compile/T11077.stderr +++ b/testsuite/tests/warnings/should_compile/T11077.stderr @@ -1,3 +1,3 @@ - -T11077.hs:5:1: warning: [GHC-38417] [-Wmissing-exported-signatures] +T11077.hs:3:1: warning: [GHC-38417] [-Wmissing-exported-signatures] Top-level binding with no type signature: foo :: a +