Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Enable two warnings #1245

Merged
merged 1 commit into from
Dec 8, 2020
Merged

Enable two warnings #1245

merged 1 commit into from
Dec 8, 2020

Conversation

tomjaguarpaw
Copy link
Member

because they will be soon be added to -Wall.

See https://gitlab.haskell.org/ghc/ghc/-/issues/15656

Haddock is a boot library so it is very important it is -Wall clean, else GHC's validation test will fail.

because they will be soon be added to -Wall.

See https://gitlab.haskell.org/ghc/ghc/-/issues/15656
@tomjaguarpaw
Copy link
Member Author

Please let me know if there are any questions about this.

@alexbiehl
Copy link
Member

Sorry I missed this. I didn't have my notification settings right.

Change looks ok but I do wonder which record constructions in particular we are addressing here?

@tomjaguarpaw
Copy link
Member Author

src/Haddock/GhcUtils.hs:298:14: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            FamDecl _ _
            SynDecl _ _ _ _ _
            ClassDecl _ _ _ _ _ _ _ _ _ _ _
            XTyClDecl _
    |
298 |     TyClD x (d { tcdDataDefn = restrictDataDefn names (tcdDataDefn d) })
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/GhcUtils.hs:300:14: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            FamDecl _ _
            SynDecl _ _ _ _ _
            DataDecl _ _ _ _ _
            XTyClDecl _
    |
300 |     TyClD x (d { tcdSigs = restrictDecls names (tcdSigs d),
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Haddock/GhcUtils.hs:307:5: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct: Patterns not matched: XHsDataDefn _
    |
307 |   = defn { dd_cons = restrictCons names cons }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/GhcUtils.hs:310:16: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct: Patterns not matched: XHsDataDefn _
    |
310 |       []    -> defn { dd_ND = DataType, dd_cons = [] }
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/GhcUtils.hs:311:16: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct: Patterns not matched: XHsDataDefn _
    |
311 |       [con] -> defn { dd_cons = [con] }
    |                ^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/GhcUtils.hs:323:32: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct: Patterns not matched: XConDecl _
    |
323 |           | otherwise -> Just (d { con_args = PrefixCon (field_types (map unLoc (unLoc fields))) })
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Interface/Specialize.hs:76:30: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched: XHsWildCardBndrs _
   |
76 |   TypeSig noExtField lnames (typ {hswc_body = (hswc_body typ) {hsib_body = noLoc typ'}})
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Interface/Specialize.hs:76:47: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched: XHsImplicitBndrs _
   |
76 |   TypeSig noExtField lnames (typ {hswc_body = (hswc_body typ) {hsib_body = noLoc typ'}})
   |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Interface/Specialize.hs:92:17: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            TypeInst _
            DataInst _
   |
92 |     instType' = clsi
   |                 ^^^^...

src/Haddock/Interface/Rename.hs:487:15: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            ConDeclGADT _ _ _ _ _ _ _ _
            XConDecl _
    |
487 |       return (decl { con_ext = noExtField, con_name = lname', con_ex_tvs = ltyvars'
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Haddock/Interface/Rename.hs:501:15: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            ConDeclH98 _ _ _ _ _ _ _
            XConDecl _
    |
501 |       return (decl { con_g_ext = noExtField, con_names = lnames', con_qvars = ltyvars'
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Haddock/Backends/Hyperlinker/Parser.hs:36:11: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding: Patterns not matched: []
   |
36 |       let err:_ = bagToList (getErrorMessages pst dflags) in
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Backends/Hyperlinker/Parser.hs:96:15: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding: Patterns not matched: UnhelpfulLoc _
   |
96 |               RealSrcLoc lStart = srcSpanStart sp -- safe since @sp@ is real
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Interface/AttachInstances.hs:132:16: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            ExportNoDecl _ _
            ExportGroup _ _ _
            ExportDoc _
            ExportModule _
    |
132 |       return $ e { expItemInstances = insts }
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Interface/AttachInstances.hs:138:36: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            ExportNoDecl _ _
            ExportGroup _ _ _
            ExportDoc _
            ExportModule _
    |
138 |                                } = e { expItemFixities =
    |                                    ^^^^^^^^^^^^^^^^^^^^^...

src/Haddock/Interface/AttachInstances.hs:206:9: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding: Patterns not matched: SimpleTyLit _
    |
206 |   where (SimpleType s ts) = simplify t1
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Interface/Create.hs:619:17: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            FamDecl _ _
            SynDecl _ _ _ _ _
            DataDecl _ _ _ _ _
            XTyClDecl _
    |
619 |       TyClD x $ c { tcdSigs = filter (liftA2 (||) isUserLSig isMinimalLSig) $ tcdSigs c }
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Interface/Create.hs:771:49: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            FamDecl _ _
            SynDecl _ _ _ _ _
            DataDecl _ _ _ _ _
            XTyClDecl _
    |
771 |                       (L loc $ TyClD noExtField cl { tcdSigs = sig ++ tcdSigs cl }) docs_
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/Haddock/Backends/Hoogle.hs:163:15: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            FamDecl _ _
            SynDecl _ _ _ _ _
            DataDecl _ _ _ _ _
            XTyClDecl _
    |
163 |   (out dflags decl{tcdSigs=[], tcdATs=[], tcdATDefs=[], tcdMeths=emptyLHsBinds}
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Backends/Hoogle.hs:196:37: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct: Patterns not matched: XFamilyDecl _
    |
196 |               ClosedTypeFamily{} -> decl { fdInfo = OpenTypeFamily }
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Backends/Hoogle.hs:217:16: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct:
        Patterns not matched:
            FamDecl _ _
            SynDecl _ _ _ _ _
            ClassDecl _ _ _ _ _ _ _ _ _ _ _
            XTyClDecl _
    |
217 |     = showData decl{ tcdDataDefn = defn { dd_cons=[],dd_derivs=noLoc [] }} :
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Haddock/Backends/Hoogle.hs:217:36: warning: [-Wincomplete-record-updates]
    Pattern match(es) are non-exhaustive
    In a record-update construct: Patterns not matched: XHsDataDefn _
    |
217 |     = showData decl{ tcdDataDefn = defn { dd_cons=[],dd_derivs=noLoc [] }} :
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@alexbiehl-gc
Copy link
Contributor

Oh wow! I didn't expect that! Thanks for clarifying, doesn't seem like it has an easy fix to it.

@alexbiehl alexbiehl merged commit 96a60e2 into haskell:ghc-8.10 Dec 8, 2020
@tomjaguarpaw tomjaguarpaw deleted the warnings branch December 8, 2020 17:05
@tomjaguarpaw tomjaguarpaw restored the warnings branch December 10, 2020 15:20
@tomjaguarpaw tomjaguarpaw deleted the warnings branch December 10, 2020 15:20
tomjaguarpaw added a commit to tomjaguarpaw/haddock that referenced this pull request Dec 10, 2020
alexbiehl pushed a commit that referenced this pull request Dec 10, 2020
bgamari added a commit that referenced this pull request Dec 15, 2020
As this does not build on GHC `master`.

This reverts commit 7936692.
tomjaguarpaw added a commit to tomjaguarpaw/haddock that referenced this pull request Dec 19, 2020
hsyl20 pushed a commit to hsyl20/haddock-1 that referenced this pull request Dec 21, 2020
As this does not build on GHC `master`.

This reverts commit 7936692.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants