diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-03-28 16:13:03 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2022-04-01 11:15:24 +0100 |
commit | f8fc6d2e91038a98a321eceefe0a2ffff3dc9e72 (patch) | |
tree | 846f6310cb933eae6d38c5c24864b55c76032d1b /testsuite/tests/warnings | |
parent | f8f152e7089af9a5434408e17ff071999d381ee1 (diff) | |
download | haskell-f8fc6d2e91038a98a321eceefe0a2ffff3dc9e72.tar.gz |
driver: Improve -Wunused-packages error message (and simplify implementation)
In the past I improved the part of -Wunused-packages which found which
packages were used. Now I improve the part which detects which ones were
specified. The key innovation is to use the explicitUnits field from
UnitState which has the result of resolving the package flags, so we
don't need to mess about with the flag arguments from DynFlags anymore.
The output now always includes the package name and version (and the
flag which exposed it).
```
The following packages were specified via -package or -package-id flags,
but were not needed for compilation:
- bytestring-0.11.2.0 (exposed by flag -package bytestring)
- ghc-9.3 (exposed by flag -package ghc)
- process-1.6.13.2 (exposed by flag -package process)
```
Fixes #21307
Diffstat (limited to 'testsuite/tests/warnings')
-rw-r--r-- | testsuite/tests/warnings/should_compile/UnusedPackages.stderr | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testsuite/tests/warnings/should_compile/UnusedPackages.stderr b/testsuite/tests/warnings/should_compile/UnusedPackages.stderr index 11f87e6de4..94c487e550 100644 --- a/testsuite/tests/warnings/should_compile/UnusedPackages.stderr +++ b/testsuite/tests/warnings/should_compile/UnusedPackages.stderr @@ -2,8 +2,8 @@ <no location info>: warning: [-Wunused-packages] The following packages were specified via -package or -package-id flags, but were not needed for compilation: - - ghc - - process - - bytestring + - bytestring-0.11.2.0 (exposed by flag -package bytestring) + - ghc-9.3 (exposed by flag -package ghc) + - process-1.6.13.2 (exposed by flag -package process) [1 of 2] Compiling Main ( UnusedPackages.hs, UnusedPackages.o ) [2 of 2] Linking UnusedPackages |