summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Split up -Wunused-imports into three warningswip/unused-importsMatthew Pickering2022-09-1421-41/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | This splits up `-Wunused-imports` into three warnings: `-Wunused-explicit-imports`: Warn when an explicitly imported identifier is not used. import Foo (bar) `-Wredundant-imports`: Warn when nothing from an import is used. -- Nothing from Foo is used import Foo `-Wunused-source-imports`: Warn when a source import is unecessary -- Can just `import Foo`. import {-# SOURCE #-} Foo These three flags are implied by `-Wunused-imports` The motiviation for this is that some library authors don't want to always enable `-Wredundant-imports` as it makes downstream library changes introduce warnings in libraries. Fixes #21879 Also fixes #22182 by supporting -Werror=unused-imports and -Werror=unused-binds
* compiler: remove unused lazy state monadCheng Shao2022-09-132-79/+0
|
* ci: remove unused appveyor configCheng Shao2022-09-132-75/+0
|
* Allow imports to reference multiple fields with the same name (#21625)Adam Gundry2022-09-137-23/+54
| | | | | | | | | | | | | | If a module `M` exports two fields `f` (using DuplicateRecordFields), we can still accept import M (f) import M hiding (f) and treat `f` as referencing both of them. This was accepted in GHC 9.0, but gave rise to an ambiguity error in GHC 9.2. See #21625. This patch also documents this behaviour in the user's guide, and updates the test for #16745 which is now treated differently.
* Diagnostic codes: acccept test changessheaf2022-09-132224-4578/+4819
| | | | | | | | The testsuite output now contains diagnostic codes, so many tests need to be updated at once. We decided it was best to keep the diagnostic codes in the testsuite output, so that contributors don't inadvertently make changes to the diagnostic codes.
* Add diagnostic codessheaf2022-09-1353-944/+2031
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR adds diagnostic codes, assigning unique numeric codes to error and warnings, e.g. error: [GHC-53633] Pattern match is redundant This is achieved as follows: - a type family GhcDiagnosticCode that gives the diagnostic code for each diagnostic constructor, - a type family ConRecursInto that specifies whether to recur into an argument of the constructor to obtain a more fine-grained code (e.g. different error codes for different 'deriving' errors), - generics machinery to generate the value-level function assigning each diagnostic its error code; see Note [Diagnostic codes using generics] in GHC.Types.Error.Codes. The upshot is that, to add a new diagnostic code, contributors only need to modify the two type families mentioned above. All logic relating to diagnostic codes is thus contained to the GHC.Types.Error.Codes module, with no code duplication. This MR also refactors error message datatypes a bit, ensuring we can derive Generic for them, and cleans up the logic around constraint solver reports by splitting up 'TcSolverReportInfo' into separate datatypes (see #20772). Fixes #21684
* Windows: Always define _UCRT when compiling C codeRyan Scott2022-09-126-1/+47
| | | | | | | As seen in #22159, this is required to ensure correct behavior when MinGW-w64 headers are in the `C_INCLUDE_PATH`. Fixes #22159.
* ci: enable parallel compression for xzCheng Shao2022-09-121-1/+1
|
* rts: fix missing dirty_MVAR argument in stg_writeIOPortzhCheng Shao2022-09-121-1/+1
|
* Add native delimited continuations to the RTSAlexis King2022-09-1156-55/+1344
| | | | | | | | | | | | | | | | | | | | | This patch implements GHC proposal 313, "Delimited continuation primops", by adding native support for delimited continuations to the GHC RTS. All things considered, the patch is relatively small. It almost exclusively consists of changes to the RTS; the compiler itself is essentially unaffected. The primops come with fairly extensive Haddock documentation, and an overview of the implementation strategy is given in the Notes in rts/Continuation.c. This first stab at the implementation prioritizes simplicity over performance. Most notably, every continuation is always stored as a single, contiguous chunk of stack. If one of these chunks is particularly large, it can result in poor performance, as the current implementation does not attempt to cleverly squeeze a subset of the stack frames into the existing stack: it must fit all at once. If this proves to be a performance issue in practice, a cleverer strategy would be a worthwhile target for future improvements.
* CmmToC: enable 64-bit CallishMachOp on 32-bit targetsCheng Shao2022-09-081-31/+29
| | | | | | | | | Normally, the unregisterised builds avoid generating 64-bit CallishMachOp in StgToCmm, so CmmToC doesn't support these. However, there do exist cases where we'd like to invoke cmmToC for other cmm inputs which may contain such CallishMachOps, and it's a rather low effort to add support for these since they only require calling into existing ghc-prim cbits.
* Isolate some Applicative hidings to GHC.PreludeGeorgi Lyubenov2022-09-085-9/+7
| | | | | | | By reexporting the entirety of Applicative from GHC.Prelude, we can save ourselves some `hiding` and importing of `Applicative` in consumers of GHC.Prelude. This also has the benefit of isolating this type of change to GHC.Prelude, so that people in the future don't have to think about it.
* Bump submodule Cabal to one with liftA2 warnings fixedGeorgi Lyubenov2022-09-081-0/+0
|
* Bump submodule containers to one with liftA2 warnings fixedGeorgi Lyubenov2022-09-081-0/+0
|
* Add changelog entry for liftA2 export from PreludeGeorgi Lyubenov2022-09-081-0/+4
|
* Export liftA2 from PreludeGeorgi Lyubenov2022-09-0811-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: In order to be warning free and compatible, we hide Applicative(..) from Prelude in a few places and instead import it directly from Control.Applicative. Please see the migration guide at https://github.com/haskell/core-libraries-committee/blob/main/guides/export-lifta2-prelude.md for more details. This means that Applicative is now exported in its entirety from Prelude. Motivation: This change is motivated by a few things: * liftA2 is an often used function, even more so than (<*>) for some people. * When implementing Applicative, the compiler will prompt you for either an implementation of (<*>) or of liftA2, but trying to use the latter ends with an error, without further imports. This could be confusing for newbies. * For teaching, it is often times easier to introduce liftA2 first, as it is a natural generalisation of fmap. * This change seems to have been unanimously and enthusiastically accepted by the CLC members, possibly indicating a lot of love for it. * This change causes very limited breakage, see the linked issue below for an investigation on this. See https://github.com/haskell/core-libraries-committee/issues/50 for the surrounding discussion and more details.
* Remove Outputable Char instanceKrzysztof Gogolewski2022-09-0713-24/+26
| | | | | Use 'text' instead of 'ppr'. Using 'ppr' on the list "hello" rendered as "h,e,l,l,o".
* Minor SDoc cleanupKrzysztof Gogolewski2022-09-0711-28/+19
| | | | | | | Change calls to renderWithContext with showSDocOneLine; it's more efficient and explanatory. Remove polyPatSig (unused)
* CmmToAsm: remove unused ModLocation from NatM_StateCheng Shao2022-09-073-21/+10
|
* whitespaceEric Lindblad2022-09-071-1/+1
|
* typosEric Lindblad2022-09-076-13/+13
|
* typoEric Lindblad2022-09-071-1/+1
|
* ci: remove unused build_make/test_make in ci scriptCheng Shao2022-09-061-46/+0
|
* Fix :add docs in user guideJan HrĨek2022-09-061-1/+1
|
* Update instances.rst, clarifying InstanceSigssheaf2022-09-061-5/+30
| | | | Fixes #22103
* gitlab-ci: Ensure that ghc derivation is in scopeBen Gamari2022-09-051-1/+1
| | | | | | Previously the lint-ci job attempted to use cabal-install (specifically `cabal update`) without a GHC in PATH. However, cabal-install-3.8 appears to want GHC, even for `cabal update`.
* DmdAnal: Don't panic in addCaseBndrDmd (#22039)Sebastian Graf2022-09-053-18/+117
| | | | | | | | | | Rather conservatively return Top. See Note [Untyped demand on case-alternative binders]. I also factored `addCaseBndrDmd` into two separate functions `scrutSubDmd` and `fieldBndrDmds`. Fixes #22039.
* Fix bootstrap with ghc-9.0Matthew Pickering2022-09-011-0/+9
| | | | | | It turns out Solo is a very recent addition to base, so for older GHC versions we just defined it inline here the one place we use it in the compiler.
* Change Ord defaults per CLC proposalTommy Bidne2022-09-013-3/+11
| | | | Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/24#issuecomment-1233331267
* Minor cleanupKrzysztof Gogolewski2022-09-0112-40/+19
| | | | | | | | | - Remove mkHeteroCoercionType, sdocImpredicativeTypes, isStateType (unused), isCoVar_maybe (duplicated by getCoVar_maybe) - Replace a few occurrences of voidPrimId with (# #). void# is a deprecated synonym for the unboxed tuple. - Use showSDoc in :show linker. This makes it consistent with the other :show commands
* Add regression test for #21550Zubin Duggal2022-09-012-0/+40
| | | | | This was fixed by ca90ffa321a31842a32be1b5b6e26743cd677ec5 "Use local instances with least superclass depth"
* Make ghcDebugAssertions into a Stage predicate (Stage -> Bool)Matthew Pickering2022-08-317-11/+14
| | | | | | | | | | We also care whether we have debug assertions enabled for a stage one compiler, but the way which we turned on the assertions was quite different from the stage2 compiler. This makes the logic for turning on consistent across both and has the advantage of being able to correct determine in in-tree args whether a flavour enables assertions or not. Ticket #22096
* Refine in-tree compiler args for --test-compiler=stage1Matthew Pickering2022-08-311-4/+6
| | | | | | | | | Some of the logic to calculate in-tree arguments was not correct for the stage1 compiler. Namely we were not correctly reporting whether we were building static or dynamic executables and whether debug assertions were enabled. Fixes #22096
* Update submodule Cabal to tag Cabal-v3.8.1.0wip/9.4-foward-fixed-makeDouglas Wilson2022-08-315-8/+4
| | | | closes #21931
* Bump bytestring submodule to 0.11.3.1Ben Gamari2022-08-311-0/+0
|
* Update autoconf scriptsBen Gamari2022-08-312-607/+775
| | | | Scripts taken from autoconf 02ba26b218d3d3db6c56e014655faf463cefa983
* Add dates to base, ghc-prim changelogsBen Gamari2022-08-311-1/+1
|
* Bump deepseq submodule to 1.4.8.0Ben Gamari2022-08-311-0/+0
|
* Bump text submodule to 2.0.1Douglas Wilson2022-08-311-0/+0
|
* Bump directory submodule to 1.3.7.1Ben Gamari2022-08-311-0/+0
|
* Update submodule process to 1.6.15.0Douglas Wilson2022-08-311-0/+0
|
* Update submodule containers to 0.6.6Douglas Wilson2022-08-312-2/+2
|
* users-guide: Document system-cxx-std-libBen Gamari2022-08-311-0/+20
|
* Bump stm submodule to 2.5.1.0Ben Gamari2022-08-311-0/+0
|
* Bump binary submodule to 0.8.9.1Ben Gamari2022-08-311-0/+0
|
* Add a missing trimArityTypeSimon Peyton Jones2022-08-314-146/+184
| | | | | This buglet was exposed by #22114, a consequence of my earlier refactoring of arity for join points.
* Fix typo in Any docs: syntatic -> syntacticPi Delport2022-08-301-1/+1
|
* Fix typo in Any docs: stray "--"Pi Delport2022-08-301-1/+1
|
* ci: Attempt using normal submodule cloning strategyMatthew Pickering2022-08-302-3/+3
| | | | | | | We do not use any recursively cloned submodules, and this protects us from flaky upstream remotes. Fixes #22121
* Various Hadrian bootstrapping fixessheaf2022-08-301-14/+22
| | | | | | | | | | - Don't always produce a distribution archive (#21629) - Use correct executable names for ghc-pkg and hsc2hs on windows (we were missing the .exe file extension) - Fix a bug where we weren't using the right archive format on Windows when unpacking the bootstrap sources. Fixes #21629