diff --git a/haddock-api.cabal b/haddock-api.cabal
--- a/haddock-api.cabal
+++ b/haddock-api.cabal
@@ -1,6 +1,6 @@
 cabal-version:        2.0
 name:                 haddock-api
-version:              2.24.1
+version:              2.24.2
 synopsis:             A documentation-generation tool for Haskell libraries
 description:          Haddock is a documentation-generation tool for Haskell
                       libraries
diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs
--- a/src/Haddock/Backends/Xhtml.hs
+++ b/src/Haddock/Backends/Xhtml.hs
@@ -49,7 +49,6 @@
 import qualified Data.Set as Set hiding ( Set )
 import Data.Ord              ( comparing )
 
-import DynFlags (Language(..))
 import GHC hiding ( NoLink, moduleInfo,LexicalFixity(..) )
 import Name
 
diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs
--- a/src/Haddock/Backends/Xhtml/Decl.hs
+++ b/src/Haddock/Backends/Xhtml/Decl.hs
@@ -517,7 +517,7 @@
             -> [(DocName, DocForDecl DocName)] -> TyClDecl DocNameI
             -> Splice -> Unicode -> Maybe Package -> Qualification -> Html
 ppClassDecl summary links instances fixities loc d subdocs
-        decl@(ClassDecl { tcdCtxt = lctxt, tcdLName = lname@(L _ nm)
+        decl@(ClassDecl { tcdCtxt = lctxt, tcdLName = lname
                         , tcdTyVars = ltyvars, tcdFDs = lfds, tcdSigs = lsigs
                         , tcdATs = ats, tcdATDefs = atsDefs })
             splice unicode pkg qual
diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs
--- a/src/Haddock/Interface/Create.hs
+++ b/src/Haddock/Interface/Create.hs
@@ -1,7 +1,9 @@
 {-# LANGUAGE CPP, TupleSections, BangPatterns, LambdaCase #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE ViewPatterns #-}
-{-# OPTIONS_GHC -Wwarn #-}
+-- Note the -Wno-incomplete-record-updates. When converting Type to HsSyn we
+-- are using incomplete record constructions infortunately.
+{-# OPTIONS_GHC -Wwarn -Wno-incomplete-record-updates #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Haddock.Interface.Create
@@ -811,7 +813,7 @@
             Just synifiedDecl -> pure synifiedDecl
             Nothing -> O.pprPanic "availExportItem" (O.text err)
 
-    availExportDecl :: HasCallStack => AvailInfo -> LHsDecl GhcRn
+    availExportDecl :: AvailInfo -> LHsDecl GhcRn
                     -> (DocForDecl Name, [(Name, DocForDecl Name)])
                     -> ErrMsgGhc [ ExportItem GhcRn ]
     availExportDecl avail decl (doc, subs)
@@ -1167,7 +1169,7 @@
               _ -> Left "internal: extractDecl (ClsInstD)"
       _ -> Left ("extractDecl: Unhandled decl for " ++ getOccString name)
 
-extractPatternSyn :: HasCallStack => Name -> Name -> [LHsTypeArg GhcRn] -> [LConDecl GhcRn] -> Either ErrMsg (LSig GhcRn)
+extractPatternSyn :: Name -> Name -> [LHsTypeArg GhcRn] -> [LConDecl GhcRn] -> Either ErrMsg (LSig GhcRn)
 extractPatternSyn nm t tvs cons =
   case filter matches cons of
     [] -> Left . O.showSDocUnsafe $
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -671,7 +671,7 @@
 withExceptionContext ctxt =
   ghandle (\ex ->
       case ex of
-        HaddockException e -> throw $ WithContext [ctxt] (toException ex)
+        HaddockException _ -> throw $ WithContext [ctxt] (toException ex)
         WithContext ctxts se -> throw $ WithContext (ctxt:ctxts) se
           ) .
   ghandle (throw . WithContext [ctxt])
@@ -712,8 +712,8 @@
 instance ExceptionMonad ErrMsgGhc where
   gcatch act hand = WriterGhc $
     runWriterGhc act `gcatch` (runWriterGhc . hand)
-  gmask act = WriterGhc $ gmask $ \mask ->
-    runWriterGhc $ act (WriterGhc . mask . runWriterGhc)
+  gmask act = WriterGhc $ gmask $ \mask' ->
+    runWriterGhc $ act (WriterGhc . mask'  . runWriterGhc)
 
 -----------------------------------------------------------------------------
 -- * Pass sensitive types
