[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 11 commits: Use HsOuterExplicit in instance sigs in deriving-generated code

Marge Bot gitlab at gitlab.haskell.org
Fri Dec 18 01:00:31 UTC 2020



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
13d70b5d by Ryan Scott at 2020-12-17T20:00:08-05:00
Use HsOuterExplicit in instance sigs in deriving-generated code

Issue #18914 revealed that `GeneralizedNewtypeDeriving` would generate code
that mentions unbound type variables, which is dangerously fragile. The
problem (and fix) is described in the new `Wrinkle: Use HsOuterExplicit`
in `Note [GND and QuantifiedConstraints]`. The gist of it: make sure to
put the top-level `forall`s in `deriving`-generated instance signatures in an
`HsOuterExplicit` to ensure that they scope over the bodies of methods
correctly. A side effect of this process is that it will expand any type
synonyms in the instance signature, which will surface any `forall`s that
are hidden underneath type synonyms (such as in the test case for #18914).

While I was in town, I also performed some maintenance on `NewHsTypeX`, which
powers `GeneralizedNewtypeDeriving`:

* I renamed `NewHsTypeX` to `HsCoreTy`, which more accurately describes its
  intended purpose (#15706). I also made `HsCoreTy` a type synonym instead of
  a newtype, as making it a distinct data type wasn't buying us much.
* To make sure that mistakes similar to #18914 do not occur later, I added an
  additional validity check when renaming `HsCoreTy`s that complains if an
  `HsCoreTy`s contains an out-of-scope type variable. See the new
  `Note [Renaming HsCoreTys]` in `GHC.Rename.HsType` for the details.

Fixes #15706. Fixes #18914. Bumps the `haddock` submodule.

- - - - -
8e2e658a by Andreas Klebinger at 2020-12-17T20:00:09-05:00
OSMem.c: Use proper type for mbinds mask argument.

StgWord has different widths on 32/64bit. So use the proper type
instead.

- - - - -
ac4fa90c by Andreas Klebinger at 2020-12-17T20:00:09-05:00
rts: EventLog.c: Properly cast (potential) 32bit pointers to uint64_t

- - - - -
b5ccee92 by Andreas Klebinger at 2020-12-17T20:00:09-05:00
Rts/elf-linker: Upcast to 64bit to satisfy format string.

The elf size is 32bit on 32bit builds and 64 otherwise.
We just upcast to 64bits before printing now.

- - - - -
048b427f by Alfredo Di Napoli at 2020-12-17T20:00:10-05:00
Split Driver.Env module

This commit splits the GHC.Driver.Env module creating a separate
GHC.Driver.Env.Types module where HscEnv and Hsc would live. This
will pave the way to the structured error values by avoiding one
boot module later down the line.

- - - - -
1f9589f4 by Alfredo Di Napoli at 2020-12-17T20:00:12-05:00
Rename parser Error and Warning types

This commit renames parser's Error and Warning types (and their
constructors) to have a 'Ps' prefix, so that this would play nicely
when more errors and warnings for other phases of the pipeline will
be added. This will make more explicit which is the particular type
of error and warning we are dealing with, and will be more informative
for users to see in the generated Haddock.

- - - - -
4adaee93 by Richard Eisenberg at 2020-12-17T20:00:13-05:00
Fix #19044 by tweaking unification in inst lookup

See Note [Infinitary substitution in lookup] in GHC.Core.InstEnv
and Note [Unification result] in GHC.Core.Unify.

Test case: typecheck/should_compile/T190{44,52}

Close #19044
Close #19052

- - - - -
f333672e by Ben Gamari at 2020-12-17T20:00:13-05:00
rts: Fix typo in macro name

THREADED_RTS was previously misspelled as THREADEDED_RTS.

Fixes #19057.
- - - - -
25ea7006 by Ben Gamari at 2020-12-17T20:00:14-05:00
primops: Document semantics of Float/Int conversions

Fixes #18840.

- - - - -
578b029a by Ben Gamari at 2020-12-17T20:00:22-05:00
testsuite: Fix two shell quoting issues

Fixes two ancient bugs in the testsuite driver makefiles due to
insufficient quoting. I have no idea how these went unnoticed for so
long.

Thanks to @tomjaguarpaw for testing.

- - - - -
b7819b92 by Richard Eisenberg at 2020-12-17T20:00:22-05:00
Cite "Kind Inference for Datatypes"

- - - - -


30 changed files:

- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Parser/Monad.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Driver/Env.hs
- + compiler/GHC/Driver/Env/Types.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/ghc.cabal.in
- rts/RaiseAsync.c
- rts/eventlog/EventLog.c
- rts/linker/Elf.c
- rts/posix/OSMem.c
- testsuite/mk/boilerplate.mk
- testsuite/mk/test.mk


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6de3e4963d9cde9243b5b2018867a031b443a33f...b7819b923c4669da244973351fb8bcf50174b193

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6de3e4963d9cde9243b5b2018867a031b443a33f...b7819b923c4669da244973351fb8bcf50174b193
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201217/29004f8a/attachment.html>


More information about the ghc-commits mailing list