[Git][ghc/ghc][wip/ttg/types/basic] Removed a bunch of warnings. Hopefully none remain.

Hassan Al-Awwadi (@hassan.awwadi) gitlab at gitlab.haskell.org
Sun Oct 27 15:23:51 UTC 2024



Hassan Al-Awwadi pushed to branch wip/ttg/types/basic at Glasgow Haskell Compiler / GHC


Commits:
9eab1e9a by Hassan Al-Awwadi at 2024-10-27T16:23:21+01:00
Removed a bunch of warnings. Hopefully none remain.

- - - - -


23 changed files:

- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/InlinePragma.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Generics.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Rule.hs
- compiler/GHC/Tc/Gen/Sig.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Utils.hs
- compiler/GHC/Tc/Types/Origin.hs


Changes:

=====================================
compiler/GHC/Core/Opt/WorkWrap.hs
=====================================
@@ -831,8 +831,8 @@ mkWWBindPair ww_opts fn_id fn_info fn_args fn_body work_uniq div
 
     work_rhs = work_fn (mkLams fn_args fn_body)
     work_act = case fn_inline_spec of  -- See Note [Worker activation]
-                   NoInline _  -> inl_act fn_inl_prag
-                   _           -> inl_act wrap_prag
+                   NoInline _  -> inl_act' fn_inl_prag
+                   _           -> inl_act' wrap_prag
 
     work_prag = InlinePragma { inl_ext = InlExt (SourceText $ fsLit "{-# INLINE") Nothing
                              , inl_inline = fn_inline_spec
@@ -893,10 +893,17 @@ mkWWBindPair ww_opts fn_id fn_info fn_args fn_body work_uniq div
                         -- about a loop breaker with an INLINE rule
 
     fn_inl_prag     = inlinePragInfo fn_info
-    fn_inline_spec  = inl_inline fn_inl_prag
+    fn_inline_spec  = inl_inline' fn_inl_prag
     fn_unfolding    = realUnfoldingInfo fn_info
     fn_rules        = ruleInfoRules (ruleInfo fn_info)
 
+    inl_inline' (XCInlinePragma imp) = dataConCantHappen imp
+    inl_inline' (InlinePragma{ inl_inline = inline }) = inline
+
+    inl_act' (XCInlinePragma imp) = dataConCantHappen imp
+    inl_act' (InlinePragma{ inl_act = act }) = act
+
+
 mkStrWrapperInlinePrag :: InlinePragma GhcTc -> [CoreRule] -> InlinePragma GhcTc
 mkStrWrapperInlinePrag (XCInlinePragma impossible) _ = dataConCantHappen impossible
 mkStrWrapperInlinePrag (InlinePragma { inl_inline = fn_inl


=====================================
compiler/GHC/Hs.hs
=====================================
@@ -36,7 +36,6 @@ module GHC.Hs (
         module GHC.Hs.InlinePragma,
         module GHC.Hs.OverlapPragma,
         module GHC.Parser.Annotation,
-        Fixity,
 
         HsModule(..), AnnsModule(..),
         HsParsedModule(..), XModulePs(..)
@@ -64,7 +63,6 @@ import GHC.Hs.Instances () -- For Data instances
 
 -- others:
 import GHC.Utils.Outputable
-import GHC.Types.Fixity         ( Fixity )
 import GHC.Types.SrcLoc
 import GHC.Unit.Module.Warnings
 


=====================================
compiler/GHC/Hs/Binds.hs
=====================================
@@ -13,6 +13,8 @@
                                       -- in module Language.Haskell.Syntax.Extension
 
 {-# OPTIONS_GHC -Wno-orphans #-} -- Outputable
+{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
+{-# HLINT ignore "Use camelCase" #-}
 
 {-
 (c) The University of Glasgow 2006
@@ -864,7 +866,8 @@ ppr_sig (SpecSig _ var ty inl@(InlinePragma { inl_inline = spec }))
       pragmaSrc = case spec of
         NoUserInlinePrag _ -> "{-# " ++ extractSpecPragName (inl_src inl)
         _                  -> "{-# " ++ extractSpecPragName (inl_src inl)  ++ "_INLINE"
-ppr_sig (InlineSig _ var inl)
+ppr_sig (InlineSig _ _   (XCInlinePragma imp)) = dataConCantHappen imp
+ppr_sig (InlineSig _ var inl@(InlinePragma{}))
   = ppr_pfx <+> pprInline inl <+> pprPrefixOcc (unLoc var) <+> text "#-}"
     where
       ppr_pfx = case inlinePragmaSource inl of
@@ -904,8 +907,10 @@ hsSigDoc (PatSynSig {})         = text "pattern synonym signature"
 hsSigDoc (ClassOpSig _ is_deflt _ _)
  | is_deflt                     = text "default type signature"
  | otherwise                    = text "class method signature"
-hsSigDoc (SpecSig _ _ _ inl)    = (inlinePragmaName . inl_inline $ inl) <+> text "pragma"
-hsSigDoc (InlineSig _ _ prag)   = (inlinePragmaName . inl_inline $ prag) <+> text "pragma"
+hsSigDoc (SpecSig _ _ _ (InlinePragma{inl_inline = spec}))   = inlinePragmaName spec <+> text "pragma"
+hsSigDoc (SpecSig _ _ _ (XCInlinePragma imp))                = dataConCantHappen imp
+hsSigDoc (InlineSig _ _ (InlinePragma{inl_inline = spec}))   = inlinePragmaName spec <+> text "pragma"
+hsSigDoc (InlineSig _ _ (XCInlinePragma imp))                = dataConCantHappen imp
 -- Using the 'inlinePragmaName' function ensures that the pragma name for any
 -- one of the INLINE/INLINABLE/NOINLINE pragmas are printed after being extracted
 -- from the InlineSpec field of the pragma.


=====================================
compiler/GHC/Hs/InlinePragma.hs
=====================================
@@ -27,7 +27,7 @@ module GHC.Hs.InlinePragma(
         pprInline, pprInlineDebug,
         convertInlinePragma, convertInlineSpec, convertActivation,
 
-        set_pragma_inline, set_pragma_activation, set_pragma_rule, set_pragma_sat
+        set_pragma_rule, set_pragma_sat
 ) where
 
 import GHC.Prelude


=====================================
compiler/GHC/Hs/Utils.hs
=====================================
@@ -146,7 +146,6 @@ import GHC.Types.Name.Reader
 import GHC.Types.Var
 import GHC.Types.Basic
 import GHC.Types.SrcLoc
-import GHC.Types.Fixity
 import GHC.Types.SourceText
 
 import GHC.Data.FastString
@@ -165,7 +164,6 @@ import Data.IntMap ( IntMap )
 import qualified Data.IntMap.Strict as IntMap
 import Data.Map ( Map )
 import qualified Data.Map.Strict as Map
-import GHC.Core.TyCon (TyConFlavour)
 
 {-
 ************************************************************************


=====================================
compiler/GHC/HsToCore/Errors/Types.hs
=====================================
@@ -6,14 +6,13 @@ module GHC.HsToCore.Errors.Types where
 
 import GHC.Prelude
 
-import GHC.Core (CoreRule, CoreExpr, RuleName)
+import GHC.Core (CoreRule, CoreExpr)
 import GHC.Core.DataCon
 import GHC.Core.ConLike
 import GHC.Core.Type
 import GHC.Driver.DynFlags (DynFlags, xopt)
 import GHC.Driver.Flags (WarningFlag)
 import GHC.Hs
-import GHC.Hs.InlinePragma (Activation)
 import GHC.HsToCore.Pmc.Solver.Types
 import GHC.Types.Error
 import GHC.Types.ForeignCall


=====================================
compiler/GHC/HsToCore/Quote.hs
=====================================
@@ -74,12 +74,10 @@ import GHC.Data.Maybe
 
 import GHC.Types.SrcLoc as SrcLoc
 import GHC.Types.Unique
-import GHC.Types.Basic
 import GHC.Types.ForeignCall
 import GHC.Types.Var
 import GHC.Types.Id
 import GHC.Types.SourceText
-import GHC.Types.Fixity
 import GHC.Types.TyThing
 import GHC.Types.Name hiding( varName, tcName )
 import GHC.Types.Name.Env
@@ -89,8 +87,6 @@ import Data.Kind (Constraint)
 
 import qualified GHC.LanguageExtensions as LangExt
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import Data.ByteString ( unpack )
 import Control.Monad
 import Data.List (sort, sortBy)
@@ -1079,13 +1075,13 @@ rep_inline :: LocatedN Name
            -> InlinePragma (GhcPass p)      -- Never defaultInlinePragma
            -> SrcSpan
            -> MetaM [(SrcSpan, Core (M TH.Dec))]
+rep_inline _  (XCInlinePragma imp) _ = dataConCantHappen imp
 rep_inline nm ispec loc
   | Opaque {} <- inl_inline ispec
   = do { nm1    <- lookupLOcc nm
        ; opq <- repPragOpaque nm1
        ; return [(loc, opq)]
        }
-
 rep_inline nm ispec loc
   = do { nm1    <- lookupLOcc nm
        ; inline <- repInline $ inl_inline ispec
@@ -1098,6 +1094,7 @@ rep_inline nm ispec loc
 rep_specialise :: LocatedN Name -> LHsSigType GhcRn -> InlinePragma (GhcPass p)
                -> SrcSpan
                -> MetaM [(SrcSpan, Core (M TH.Dec))]
+rep_specialise _  _ (XCInlinePragma imp) _ = dataConCantHappen imp
 rep_specialise nm ty ispec loc
   = do { nm1 <- lookupLOcc nm
        ; ty1 <- repHsSigType ty
@@ -1144,6 +1141,7 @@ repInline (Opaque            _ )   = panic "repInline: Opaque"
 repInline (Inline            _ )   = dataCon inlineDataConName
 repInline (Inlinable         _ )   = dataCon inlinableDataConName
 repInline (NoUserInlinePrag  _ )   = notHandled ThNoUserInline
+repInline (XInlineSpec     imp )   = dataConCantHappen imp
 
 repRuleMatch :: RuleMatchInfo -> MetaM (Core TH.RuleMatch)
 repRuleMatch ConLike = dataCon conLikeDataConName


=====================================
compiler/GHC/Parser.y
=====================================
@@ -95,8 +95,6 @@ import GHC.Builtin.Types ( unitTyCon, unitDataCon, sumTyCon,
                            listTyCon_RDR, consDataCon_RDR,
                            unrestrictedFunTyCon )
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import qualified Data.Semigroup as Semi
 }
 


=====================================
compiler/GHC/Parser/Errors/Types.hs
=====================================
@@ -6,7 +6,6 @@ module GHC.Parser.Errors.Types where
 
 import GHC.Prelude
 
-import GHC.Core.TyCon (Role)
 import GHC.Data.FastString
 import GHC.Hs
 import GHC.Parser.Types


=====================================
compiler/GHC/Parser/PostProcess.hs
=====================================
@@ -131,7 +131,7 @@ import GHC.Hs           -- Lots of it
 import GHC.Core.TyCon          ( TyCon, isTupleTyCon, tyConSingleDataCon_maybe )
 import GHC.Core.DataCon        ( DataCon, dataConTyCon, dataConName )
 import GHC.Core.ConLike        ( ConLike(..) )
-import GHC.Core.Coercion.Axiom ( Role, fsFromRole )
+import GHC.Core.Coercion.Axiom ( fsFromRole )
 import GHC.Types.Name.Reader
 import GHC.Types.Name
 import GHC.Types.Basic


=====================================
compiler/GHC/Rename/Bind.hs
=====================================
@@ -74,8 +74,6 @@ import GHC.Data.Maybe          ( orElse, mapMaybe )
 import GHC.Data.OrdList
 import qualified GHC.LanguageExtensions as LangExt
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import Control.Monad
 import Data.List          ( partition )
 import Data.List.NonEmpty ( NonEmpty(..) )


=====================================
compiler/GHC/Tc/Deriv/Generate.hs
=====================================
@@ -91,8 +91,6 @@ import GHC.Data.Bag
 import GHC.Data.Maybe ( expectJust )
 import GHC.Unit.Module
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import Data.List  ( find, partition, intersperse )
 
 -- | A declarative description of an auxiliary binding that should be


=====================================
compiler/GHC/Tc/Deriv/Generics.hs
=====================================
@@ -45,8 +45,6 @@ import GHC.Iface.Env    ( newGlobalBinder )
 import GHC.Types.Name hiding ( varName )
 import GHC.Types.Name.Reader
 import GHC.Types.SourceText
-import GHC.Types.Fixity
-import GHC.Types.Basic
 import GHC.Types.SrcLoc
 import GHC.Types.Var.Env
 import GHC.Types.Var.Set (elemVarSet)
@@ -63,8 +61,6 @@ import GHC.Utils.Misc
 import GHC.Driver.DynFlags
 import GHC.Data.FastString
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import Control.Monad (mplus)
 import Data.List (zip4, partition)
 import qualified Data.List as Partial (last)


=====================================
compiler/GHC/Tc/Errors/Types.hs
=====================================
@@ -217,7 +217,7 @@ import GHC.Core.FamInstEnv (FamInst)
 import GHC.Core.InstEnv (LookupInstanceErrReason, ClsInst, DFunId)
 import GHC.Core.PatSyn (PatSyn)
 import GHC.Core.Predicate (EqRel, predTypeEqRel)
-import GHC.Core.TyCon (TyCon, Role, FamTyConFlav, AlgTyConRhs)
+import GHC.Core.TyCon (TyCon, FamTyConFlav, AlgTyConRhs)
 import GHC.Core.Type (Kind, Type, ThetaType, PredType, ErrorMsgType, ForAllTyFlag)
 import GHC.Driver.Backend (Backend)
 
@@ -229,8 +229,6 @@ import GHC.Data.FastString (FastString)
 import GHC.Data.Pair
 import GHC.Exception.Type (SomeException)
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import qualified Data.List.NonEmpty as NE
 import           Data.Typeable (Typeable)
 import qualified GHC.Internal.TH.Syntax as TH


=====================================
compiler/GHC/Tc/Gen/App.hs
=====================================
@@ -65,7 +65,6 @@ import GHC.Utils.Outputable as Outputable
 import GHC.Utils.Panic
 
 import qualified GHC.LanguageExtensions as LangExt
-import Language.Haskell.Syntax.Basic( isBoxed )
 
 import Control.Monad
 import Data.Function


=====================================
compiler/GHC/Tc/Gen/Expr.hs
=====================================
@@ -27,8 +27,6 @@ module GHC.Tc.Gen.Expr
 
 import GHC.Prelude
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import {-# SOURCE #-} GHC.Tc.Gen.Splice
   ( tcTypedSplice, tcTypedBracket, tcUntypedBracket, getUntypedSpliceBody )
 


=====================================
compiler/GHC/Tc/Gen/Pat.hs
=====================================
@@ -59,7 +59,6 @@ import GHC.Core.DataCon
 import GHC.Core.PatSyn
 import GHC.Core.ConLike
 import GHC.Builtin.Names
-import GHC.Types.Basic hiding (SuccessFlag(..))
 import GHC.Driver.DynFlags
 import GHC.Types.SrcLoc
 import GHC.Types.Var.Set
@@ -73,8 +72,6 @@ import GHC.Data.FastString
 import qualified Data.List.NonEmpty as NE
 
 import GHC.Data.List.SetOps ( getNth )
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import Data.List( partition )
 import Control.Monad.Trans.Writer.CPS
 import Control.Monad.Trans.Class


=====================================
compiler/GHC/Tc/Gen/Rule.hs
=====================================
@@ -34,7 +34,7 @@ import GHC.Core.Predicate
 import GHC.Types.Id
 import GHC.Types.Var( EvVar, tyVarName )
 import GHC.Types.Var.Set
-import GHC.Types.Basic ( RuleName, NonStandardDefaultingStrategy(..) )
+import GHC.Types.Basic ( NonStandardDefaultingStrategy(..) )
 import GHC.Types.SrcLoc
 import GHC.Utils.Outputable
 import GHC.Utils.Panic


=====================================
compiler/GHC/Tc/Gen/Sig.hs
=====================================
@@ -592,6 +592,7 @@ add_inl_arity ar prag@(InlinePragma { inl_inline = inl_spec })
   = set_pragma_sat prag (Just ar)
   | otherwise
   = prag
+add_inl_arity _ (XCInlinePragma imp) = dataConCantHappen imp
 
 lhsBindArity :: LHsBind GhcRn -> NameEnv Arity -> NameEnv Arity
 lhsBindArity (L _ (FunBind { fun_id = id, fun_matches = ms })) env


=====================================
compiler/GHC/Tc/Instance/Class.hs
=====================================
@@ -63,10 +63,11 @@ import GHC.Unit.Module.Warnings
 
 import GHC.Hs.Extension
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
 import GHC.Types.Id.Info
 import GHC.Tc.Errors.Types
 
+import Language.Haskell.Syntax.Basic (FieldLabelString(..))
+
 import Data.Functor
 import Data.Maybe
 


=====================================
compiler/GHC/Tc/TyCl.hs
=====================================
@@ -102,8 +102,6 @@ import GHC.Utils.Panic
 import GHC.Utils.Constants (debugIsOn)
 import GHC.Utils.Misc
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import Control.Monad
 import Data.Foldable ( toList, traverse_ )
 import Data.Functor.Identity


=====================================
compiler/GHC/Tc/TyCl/Utils.hs
=====================================
@@ -79,8 +79,6 @@ import GHC.Types.Unique.Set
 import GHC.Types.TyThing
 import qualified GHC.LanguageExtensions as LangExt
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import Control.Monad
 
 {-


=====================================
compiler/GHC/Tc/Types/Origin.hs
=====================================
@@ -81,8 +81,6 @@ import GHC.Utils.Misc( HasDebugCallStack )
 import GHC.Types.Unique
 import GHC.Types.Unique.Supply
 
-import Language.Haskell.Syntax.Basic (FieldLabelString(..))
-
 import qualified Data.Kind as Hs
 
 {- *********************************************************************



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9eab1e9af0de7180a04069106d3fd921dd577c8d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/9eab1e9af0de7180a04069106d3fd921dd577c8d
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/20241027/8e392324/attachment-0001.html>


More information about the ghc-commits mailing list