[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 8 commits: For `-fkeep-going` do not duplicate dependency edge code

Marge Bot gitlab at gitlab.haskell.org
Thu Jul 30 11:44:19 UTC 2020



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


Commits:
6c68a842 by John Ericson at 2020-07-30T07:11:02-04:00
For `-fkeep-going` do not duplicate dependency edge code

We now compute the deps for `-fkeep-going` the same way that the
original graph calculates them, so the edges are correct. Upsweep really
ought to take the graph rather than a topological sort so we are never
recalculating anything, but at least things are recaluclated
consistently now.

- - - - -
502de556 by cgibbard at 2020-07-30T07:11:02-04:00
Add haddock comment for unfilteredEdges
and move the note about drop_hs_boot_nodes into it.
- - - - -
01c948eb by Ryan Scott at 2020-07-30T07:11:37-04:00
Clean up the inferred type variable restriction

This patch primarily:

* Documents `checkInferredVars` (previously called
  `check_inferred_vars`) more carefully. This is the
  function which throws an error message if a user quantifies an
  inferred type variable in a place where specificity cannot be
  observed. See `Note [Unobservably inferred type variables]` in
  `GHC.Rename.HsType`.

  Note that I now invoke `checkInferredVars` _alongside_
  `rnHsSigType`, `rnHsWcSigType`, etc. rather than doing so _inside_
  of these functions. This results in slightly more call sites for
  `checkInferredVars`, but it makes it much easier to enumerate the
  spots where the inferred type variable restriction comes into
  effect.
* Removes the inferred type variable restriction for default method
  type signatures, per the discussion in #18432. As a result, this
  patch fixes #18432.

Along the way, I performed some various cleanup:

* I moved `no_nested_foralls_contexts_err` into `GHC.Rename.Utils`
  (under the new name `noNestedForallsContextsErr`), since it now
  needs to be invoked from multiple modules. I also added a helper
  function `addNoNestedForallsContextsErr` that throws the error
  message after producing it, as this is a common idiom.
* In order to ensure that users cannot sneak inferred type variables
  into `SPECIALISE instance` pragmas by way of nested `forall`s, I
  now invoke `addNoNestedForallsContextsErr` when renaming
  `SPECIALISE instance` pragmas, much like when we rename normal
  instance declarations. (This probably should have originally been
  done as a part of the fix for #18240, but this task was somehow
  overlooked.) As a result, this patch fixes #18455 as a side effect.

- - - - -
d47324ce by Ryan Scott at 2020-07-30T07:12:16-04:00
Don't mark closed type family equations as occurrences

Previously, `rnFamInstEqn` would mark the name of the type/data
family used in an equation as an occurrence, regardless of what sort
of family it is. Most of the time, this is the correct thing to do.
The exception is closed type families, whose equations constitute its
definition and therefore should not be marked as occurrences.
Overzealously counting the equations of a closed type family as
occurrences can cause certain warnings to not be emitted, as observed
in #18470.  See `Note [Type family equations and occurrences]` in
`GHC.Rename.Module` for the full story.

This fixes #18470 with a little bit of extra-casing in
`rnFamInstEqn`. To accomplish this, I added an extra
`ClosedTyFamInfo` field to the `NonAssocTyFamEqn` constructor of
`AssocTyFamInfo` and refactored the relevant call sites accordingly
so that this information is propagated to `rnFamInstEqn`.

While I was in town, I moved `wrongTyFamName`, which checks that the
name of a closed type family matches the name in an equation for that
family, from the renamer to the typechecker to avoid the need for an
`ASSERT`. As an added bonus, this lets us simplify the details of
`ClosedTyFamInfo` a bit.

- - - - -
ebe2cf45 by Simon Peyton Jones at 2020-07-30T07:12:52-04:00
Remove an incorrect WARN in extendLocalRdrEnv

I noticed this warning going off, and discovered that it's
really fine.  This small patch removes the warning, and docments
what is going on.

- - - - -
9f71f697 by Simon Peyton Jones at 2020-07-30T07:13:27-04:00
Add two bangs to improve perf of flattening

This tiny patch improves the compile time of flatten-heavy
programs by 1-2%, by adding two bangs.

Addresses (somewhat) #18502

This reduces allocation by
   T9872b   -1.1%
   T9872d   -3.3%

   T5321Fun -0.2%
   T5631    -0.2%
   T5837    +0.1%
   T6048    +0.1%

Metric Decrease:
    T9872b
    T9872d

- - - - -
bda03297 by Sylvain Henry at 2020-07-30T07:44:15-04:00
Fix minimal imports dump for boot files (fix #18497)

- - - - -
062234fd by Sylvain Henry at 2020-07-30T07:44:16-04:00
DynFlags: don't use sdocWithDynFlags in datacon ppr

We don't need to use `sdocWithDynFlags` to know whether we should
display linear types for datacon types, we already have
`sdocLinearTypes` field in `SDocContext`.  Moreover we want to remove
`sdocWithDynFlags` (#10143, #17957)).

- - - - -


30 changed files:

- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Ppr/TyThing.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Types/Name/Reader.hs
- testsuite/tests/indexed-types/should_fail/Overlap5.stderr
- + testsuite/tests/quantified-constraints/T18432.hs
- testsuite/tests/quantified-constraints/all.T
- testsuite/tests/rename/should_compile/Makefile
- + testsuite/tests/rename/should_compile/T18497.stdout
- + testsuite/tests/rename/should_compile/T18497_Bar.hs
- + testsuite/tests/rename/should_compile/T18497_Bar.hs-boot
- + testsuite/tests/rename/should_compile/T18497_Foo.hs
- + testsuite/tests/rename/should_compile/T18497_Foo.hs-boot
- testsuite/tests/rename/should_compile/all.T
- testsuite/tests/rename/should_fail/T16002.stderr
- testsuite/tests/th/T15362.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2545583198d1eda0c21f62ebf704ee113df56bb8...062234fdaaa06b2de77095032cf4e7948b5a1a95

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2545583198d1eda0c21f62ebf704ee113df56bb8...062234fdaaa06b2de77095032cf4e7948b5a1a95
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/20200730/199b4ab7/attachment.html>


More information about the ghc-commits mailing list