[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 9 commits: Propagate long distance info to guarded let binds

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Feb 26 12:33:42 UTC 2025



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


Commits:
0f2241e9 by sheaf at 2025-02-25T19:23:21-05:00
Propagate long distance info to guarded let binds

This commit ensures that we propagate the enclosing long distance
information to let bindings inside guards, in order to get accurate
pattern-match checking warnings, in particular incomplete record
selector warnings.

Example:

  data D = K0 | K1 { fld :: Int }
  f :: D -> Int
  f d@(K1 {})
    | let i = fld d
    = i
  f _ = 3

We now correctly recognise that the field selector 'fld' cannot fail,
due to the outer pattern match which guarantees that the value 'd' has
the field 'fld'.

Fixes #25749

- - - - -
64b0d4d0 by Fangyi Zhou at 2025-02-25T19:24:07-05:00
wasm: use primitive opcodes for fabs and sqrt

- Add new `WasmInstr` constructor `WasmSqrt` for sqrt, corresponding to
  primitivie operations in wasm.
- When lowering CallishMachOp, use `WasmAbs` and `WasmSqrt` for F32 and
  F64 fabs and sqrt.

- - - - -
272eaef0 by Cheng Shao at 2025-02-25T19:24:43-05:00
hadrian: enable building stage1 haddock for cross ghc

This commit enables building stage1 haddock for cross ghc. Without
this change, hadrian would panic with "Unknown program" error when
building the _build/stage1/bin/cross-prefix-haddock program needed by
the docs-haddock target, even if it only needs to copy from
_build/stage0/bin/cross-prefix-haddock.

- - - - -
a794e733 by Cheng Shao at 2025-02-25T19:24:43-05:00
hadrian: enable building docs for cross targets

Hadrian used to omit the docs target as a part of binary-dist-dir for
cross targets. This commit enables docs to be built as a part of cross
bindists and it works just fine in CI.

- - - - -
6dba56e1 by Cheng Shao at 2025-02-25T19:24:43-05:00
ci: build haddock/sphinx-html for wasm jobs

This commit enables building haddock & sphinx-html documentation for
wasm targets. The docs are useful for end users and should be tested
in CI.

I've omitted pdf & manpage generation for the wasm target; I've never
found the pdf version of docs to be useful, and the manpage only
contains `ghc.1` where we really want `wasm32-wasi-ghc.1` but that
should be a separate issue to fix.

- - - - -
2d6a63ab by Cheng Shao at 2025-02-25T19:25:20-05:00
ghci: remove unused showBreakArray function

GHCi.BreakArray.showBreakArray is not used anywhere, hence the
housecleaning.

- - - - -
b228fcb5 by Cheng Shao at 2025-02-25T19:25:57-05:00
ghc-heap: fix HalfWord incompatible Binary instances for cross GHC

ghc-heap defines HalfWord as Word32/Word16 depending on host word
size. For cross GHC with different host/target word sizes, the Binary
instances are incompatible and breaks iserv serialization of any
message type that involves HalfWord, breaking the ghci debugger. This
patch fixes the issue and has been tested to fix ghci debugger
functionality of the wasm backend. Fixes #25420 #25781.

- - - - -
f54742f3 by Rodrigo Mesquita at 2025-02-26T07:33:29-05:00
ghci-debugger: display thunks provenance if avail

Improves reporting on ghci breakpoints when IPE information is available
by printing, next to the thunk, the source file and src span where the
thunk originated.

Closes #25746

- - - - -
7929468c by Vladislav Zavialov at 2025-02-26T07:33:29-05:00
Tidy up error messages for TypeAbstractions

1. Print the '@' symbol before invisible patterns and improve phrasing:

      T24557c.hs:8:4: error: [GHC-11983]
     -    Invisible type pattern pat is not allowed here
     +    Illegal invisible type pattern: @pat
     +    An invisible type pattern must occur in an argument position.

2. Use a single error code for all type abstractions deemed illegal
   due to the TypeAbstractions extension being disabled.

   Before this change:
     * [GHC-78249] was used in function equations, lambdas
     * [GHC-17916] was used in constructor patterns

   After this change:
     * [GHC-78249] is used to report all illegal type abstractions
     * [GHC-17916] is no longer used

   There was no reason for both error codes to exist and this distinction
   was a source of complexity in GHC/Tc/Errors/* and GHC/Rename/Pat.hs

3. Group the different "invisible type pattern" error constructors
   under a single parent constructor, TcRnIllegalInvisibleTypePattern
   containing BadInvisPatReason

- - - - -


38 changed files:

- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/HsToCore/GuardedRHSs.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Debugger.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Types/Error/Codes.hs
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Settings/Default.hs
- libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc
- libraries/ghci/GHCi/BreakArray.hs
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- + testsuite/tests/pmcheck/should_compile/T25749.hs
- testsuite/tests/pmcheck/should_compile/all.T
- testsuite/tests/rename/should_fail/T17594b.hs
- testsuite/tests/rename/should_fail/T17594b.stderr
- + testsuite/tests/rename/should_fail/T17594b_th.hs
- + testsuite/tests/rename/should_fail/T17594b_th.stderr
- testsuite/tests/rename/should_fail/T22478e.stderr
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/th/T24557a.stderr
- testsuite/tests/th/T24557b.stderr
- testsuite/tests/th/T24557c.stderr
- testsuite/tests/th/T24557d.stderr
- testsuite/tests/typecheck/should_fail/T17594c.stderr
- testsuite/tests/typecheck/should_fail/T17594d.stderr
- testsuite/tests/typecheck/should_fail/T17594g.stderr
- testsuite/tests/typecheck/should_fail/T19109.stderr
- testsuite/tests/typecheck/should_fail/T23776.stderr


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e2017eee257a9a4dca25c84fd3821b106230e610...7929468cfbc76931610d3c4a79185a6704659635

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e2017eee257a9a4dca25c84fd3821b106230e610...7929468cfbc76931610d3c4a79185a6704659635
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/20250226/61e0f310/attachment.html>


More information about the ghc-commits mailing list