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

Commits:

30 changed files:

Changes:

  • .gitlab-ci.yml
    ... ... @@ -497,12 +497,7 @@ hadrian-multi:
    497 497
         # workaround for docker permissions
    
    498 498
         - sudo chown ghc:ghc -R .
    
    499 499
       variables:
    
    500
    -    GHC_FLAGS: "-Werror=-Wno-error=incomplete-record-selectors -Wwarn=deprecations -Wwarn=unused-imports"
    
    501
    -       # -Wno-error=incomplete-record-selectors is present because -Wall now
    
    502
    -       # includes -Wincomplete-record-selectors, and hadrian-multi has many, many
    
    503
    -       # warnings about incomplete record selectors.  A better fix would be to
    
    504
    -       # remove the use of incomplete record selectors, since each of them represents
    
    505
    -       # a potential crash.
    
    500
    +    GHC_FLAGS: "-Wwarn=deprecations -Wwarn=unused-imports"
    
    506 501
         CONFIGURE_ARGS: --enable-bootstrap-with-devel-snapshot
    
    507 502
       tags:
    
    508 503
         - x86_64-linux
    

  • compiler/GHC/Core/Opt/WorkWrap/Utils.hs
    ... ... @@ -1367,13 +1367,8 @@ It's surprisingly subtle.
    1367 1367
       application; see test `T27627f`.
    
    1368 1368
     
    
    1369 1369
     TL;DR: we play safe: we never make an absent filler for any /constraint-kinded/ type,
    
    1370
    -using `isPredTy` to decide.
    
    1371
    -
    
    1372
    -  * `mkAbsentFiller` returns `Nothing` for any constraint type, so worker/wrapper
    
    1373
    -    keeps the real argument.
    
    1374
    -
    
    1375
    -  * `Specialise.specHeader` calls `mkAbsentFiller` too, so it likewise keeps the
    
    1376
    -    dead dictionary argument rather than dropping it for a filler.
    
    1370
    +using `isPredTy` to decide: `mkAbsentFiller` returns `Nothing` for any constraint
    
    1371
    +type, so worker/wrapper keeps the real argument.
    
    1377 1372
     
    
    1378 1373
     Prior failed approaches
    
    1379 1374
     
    

  • compiler/GHC/Driver/Downsweep.hs
    ... ... @@ -6,6 +6,8 @@
    6 6
     {-# LANGUAGE BlockArguments #-}
    
    7 7
     {-# LANGUAGE ViewPatterns #-}
    
    8 8
     
    
    9
    +{-# OPTIONS_GHC -Wno-invalid-haddock #-}
    
    10
    +
    
    9 11
     -- | See Note [The ModuleGraph]
    
    10 12
     module GHC.Driver.Downsweep
    
    11 13
       ( downsweep
    
    ... ... @@ -54,8 +56,6 @@ import GHC.Runtime.Context
    54 56
     import Language.Haskell.Syntax.ImpExp
    
    55 57
     import GHC.Types.UnresolvedImport
    
    56 58
     
    
    57
    -import GHC.Data.Graph.Directed
    
    58
    -import GHC.Data.FastString
    
    59 59
     import GHC.Data.Maybe      ( expectJust )
    
    60 60
     import qualified GHC.Data.Maybe as M
    
    61 61
     import GHC.Data.OsPath     ( OsPath, unsafeEncodeUtf )
    
    ... ... @@ -71,12 +71,15 @@ import GHC.Utils.Logger
    71 71
     import GHC.Utils.Fingerprint
    
    72 72
     import GHC.Utils.TmpFs
    
    73 73
     import GHC.Utils.Constants
    
    74
    +import GHC.Utils.Monad (concatMapM)
    
    75
    +import GHC.Utils.Monad.State.Strict
    
    74 76
     
    
    75 77
     import GHC.Types.Error
    
    76 78
     import GHC.Types.Target
    
    77 79
     import GHC.Types.SourceFile
    
    78 80
     import GHC.Types.SourceError
    
    79 81
     import GHC.Types.SrcLoc
    
    82
    +import GHC.Types.Unique.Set
    
    80 83
     import GHC.Types.Unique.Map
    
    81 84
     import GHC.Types.PkgQual
    
    82 85
     import GHC.Types.Basic
    
    ... ... @@ -91,9 +94,12 @@ import GHC.Unit.Module.Graph
    91 94
     import GHC.Unit.Module.Deps
    
    92 95
     import qualified GHC.Unit.Home.Graph as HUG
    
    93 96
     import GHC.Unit.Module.Stage
    
    97
    +import GHC.Unit.External.Index (UnitAbiHash)
    
    94 98
     
    
    95 99
     import Data.Either ( partitionEithers, lefts )
    
    100
    +import Data.Map (Map)
    
    96 101
     import qualified Data.Map as Map
    
    102
    +import Data.Set (Set)
    
    97 103
     import qualified Data.Set as Set
    
    98 104
     
    
    99 105
     import Control.Concurrent.MVar
    
    ... ... @@ -101,7 +107,7 @@ import Control.Monad
    101 107
     import Control.Monad.Trans.Except ( ExceptT(..), runExceptT, throwE )
    
    102 108
     import qualified Control.Monad.Catch as MC
    
    103 109
     import Data.Maybe
    
    104
    -import Data.List (partition)
    
    110
    +import Data.List (sort, partition)
    
    105 111
     import Data.Time
    
    106 112
     import Data.List (unfoldr)
    
    107 113
     import Data.Bifunctor (first, bimap)
    
    ... ... @@ -864,7 +870,7 @@ getRootSummary excl_mods summ_cache imports_cache hsc_env target
    864 870
           mkPlainErrorMsgEnvelope noSrcSpan (DriverFileNotFound offset_file)
    
    865 871
       | TargetModule modl <- targetId
    
    866 872
       = do
    
    867
    -    let root_imp = (generatedImport FromTarget (L rootLoc modl))
    
    873
    +    let root_imp = (generatedImport FromTarget (L noSrcSpan modl))
    
    868 874
                          { ui_pkg_qual = ThisPkg (homeUnitId home_unit) }
    
    869 875
         maybe_summary <- summariseModule hsc_env home_unit summ_cache imports_cache root_imp
    
    870 876
                          maybe_buf excl_mods
    
    ... ... @@ -875,7 +881,6 @@ getRootSummary excl_mods summ_cache imports_cache hsc_env target
    875 881
         where
    
    876 882
           Target {targetId, targetContents = maybe_buf, targetUnitId = uid} = target
    
    877 883
           home_unit = ue_unitHomeUnit uid (hsc_unit_env hsc_env)
    
    878
    -      rootLoc = mkGeneralSrcSpan (fsLit "<command line>")
    
    879 884
           dflags = homeUnitEnv_dflags (ue_findHomeUnitEnv uid (hsc_unit_env hsc_env))
    
    880 885
     
    
    881 886
     -- | Execute 'getRootSummary' for the 'Target's using the parallelism pipeline
    
    ... ... @@ -933,52 +938,171 @@ rootSummariesParallel n_jobs hsc_env diag_wrapper msg get_summary = do
    933 938
     -- * Check/validate properties and error out
    
    934 939
     --------------------------------------------------------------------------------
    
    935 940
     
    
    936
    --- | This function checks then important property that if both p and q are home units
    
    937
    --- then any dependency of p, which transitively depends on q is also a home unit.
    
    941
    +-- | Checks whether the given 'UnitEnv' has the closure property.
    
    938 942
     --
    
    939
    --- See Note [Multiple Home Units], section 'Closure Property'.
    
    940
    -checkHomeUnitsClosed ::  UnitEnv -> [DriverMessages]
    
    941
    -checkHomeUnitsClosed ue
    
    942
    -    | Set.null bad_unit_ids = []
    
    943
    -    | otherwise = [singleMessage $ mkPlainErrorMsgEnvelope rootLoc $ DriverHomePackagesNotClosed (Set.toList bad_unit_ids)]
    
    943
    +--   See the section “Closure Property” in @Note [Multiple Home Units]@ for the
    
    944
    +--   definition of the closure property and
    
    945
    +--   @Note [Home unit closure property check]@ below for a discussion of the
    
    946
    +--   algorithm used for this check, its justification, and a potential
    
    947
    +--   alternative.
    
    948
    +checkHomeUnitsClosed :: UnitEnv -> [DriverMessages]
    
    949
    +checkHomeUnitsClosed unit_env
    
    950
    +  | null offenders = []
    
    951
    +  | otherwise      = [
    
    952
    +                        singleMessage                                $
    
    953
    +                        mkPlainErrorMsgEnvelope noSrcSpan            $
    
    954
    +                        DriverHomePackagesNotClosed (sort offenders)
    
    955
    +                     ]
    
    944 956
       where
    
    945
    -    home_id_set = HUG.allUnits $ ue_home_unit_graph ue
    
    946
    -    bad_unit_ids = upwards_closure Set.\\ home_id_set {- Remove all home units reached, keep only bad nodes -}
    
    947
    -    rootLoc = mkGeneralSrcSpan (fsLit "<command line>")
    
    948 957
     
    
    949
    -    downwards_closure :: Graph (Node UnitId UnitId)
    
    950
    -    downwards_closure = graphFromEdgedVerticesUniq graphNodes
    
    958
    +  -- | The 'UnitId' and 'HomeUnitEnv' of each home unit.
    
    959
    +  home_unit_data :: [(UnitId, HomeUnitEnv)]
    
    960
    +  home_unit_data = HUG.unitEnv_assocs (ue_home_unit_graph unit_env)
    
    961
    +
    
    962
    +  -- | The 'UnitId's of all home units.
    
    963
    +  home_units :: UniqSet UnitId
    
    964
    +  home_units = mkUniqSet (map fst home_unit_data)
    
    965
    +
    
    966
    +  -- | All offending dependencies. A dependency of a unit /u/ on a unit /v/ is
    
    967
    +  --   offending exactly if /u/ is an external unit reachable from a home unit
    
    968
    +  --   and /v/ is a home unit. Each such dependency is represented in this list
    
    969
    +  --   by the pair of the 'UnitId' of /u/ and the 'UnitId' of /v/.
    
    970
    +  offenders :: [(UnitId, UnitId)]
    
    971
    +  offenders
    
    972
    +    = evalState (collect (map (homeUnitEnv_units . snd) home_unit_data))
    
    973
    +                emptyUniqMap
    
    974
    +    where
    
    951 975
     
    
    952
    -    inverse_closure = graphReachability $ transposeG downwards_closure
    
    976
    +    -- | Collects offending dependencies.
    
    977
    +    collect :: [UnitState]
    
    978
    +               -- ^ The 'UnitState's of the home units from which to traverse
    
    979
    +               --   the dependency graph.
    
    980
    +            -> State (UniqMap UnitId (Set UnitAbiHash)) [(UnitId, UnitId)]
    
    981
    +               -- ^ A stateful computation that collects offending dependencies
    
    982
    +               --   that have not yet been found. It uses its state, which is an
    
    983
    +               --   efficent representation of a set of 'GlobalUnitKey's, to
    
    984
    +               --   keep track of which units have already been considered as
    
    985
    +               --   sources of offending dependencies.
    
    986
    +    collect = concatMapM $ \ unit_state ->
    
    987
    +              collect_for_home_unit
    
    988
    +                (unitInfoMap unit_state)
    
    989
    +                (map (toUnitId . fst) $ explicitUnits $ unit_state)
    
    990
    +      where
    
    953 991
     
    
    954
    -    upwards_closure = Set.fromList $ map node_key $ allReachableMany inverse_closure [DigraphNode uid uid [] | uid <- Set.toList home_id_set]
    
    992
    +      -- | Collects offending dependencies that are reachable from a particular
    
    993
    +      --   home unit.
    
    994
    +      collect_for_home_unit
    
    995
    +        :: UnitInfoMap
    
    996
    +           -- ^ The 'UnitInfoMap' of the home unit.
    
    997
    +        -> [UnitId]
    
    998
    +           -- ^ The 'UnitId's of the units from which to traverse the dependency
    
    999
    +           --   graph.
    
    1000
    +        -> State (UniqMap UnitId (Set UnitAbiHash)) [(UnitId, UnitId)]
    
    1001
    +           -- ^ A stateful computation that collects offending dependencies that
    
    1002
    +           --   have not yet been found. It uses its state, which is an efficent
    
    1003
    +           --   representation of a set of 'GlobalUnitKey's, to keep track of
    
    1004
    +           --   which units have already been considered as sources of offending
    
    1005
    +           --   dependencies.
    
    1006
    +      collect_for_home_unit _ []
    
    1007
    +        = return []
    
    1008
    +      collect_for_home_unit unit_info_map (current_unit : remaining_units) = do
    
    1009
    +        let
    
    1010
    +
    
    1011
    +          -- | The 'UnitInfo' of the current unit.
    
    1012
    +          unit_info :: UnitInfo
    
    1013
    +          unit_info
    
    1014
    +            = fromMaybe (pprPanic unit_not_found_msg (ppr current_unit)) $
    
    1015
    +              lookupUniqMap unit_info_map current_unit
    
    1016
    +            where
    
    1017
    +
    
    1018
    +            -- | The message that says that a unit was not found.
    
    1019
    +            unit_not_found_msg :: String
    
    1020
    +            unit_not_found_msg = "Unit not found during closure property check"
    
    1021
    +
    
    1022
    +          -- | The ABI hash of the current unit.
    
    1023
    +          unit_abi_hash :: UnitAbiHash
    
    1024
    +          unit_abi_hash = unitAbiHash unit_info
    
    1025
    +
    
    1026
    +        has_been_processed <- gets $ maybe False (Set.member unit_abi_hash) .
    
    1027
    +                                     (`lookupUniqMap` current_unit)
    
    1028
    +        if has_been_processed
    
    1029
    +          then collect_for_home_unit unit_info_map remaining_units
    
    1030
    +          else do
    
    1031
    +            modify $ \ processed -> addToUniqMap_C Set.union
    
    1032
    +                                                   processed
    
    1033
    +                                                   current_unit
    
    1034
    +                                                   (Set.singleton unit_abi_hash)
    
    1035
    +            let
    
    1036
    +
    
    1037
    +              -- | The 'UnitId's of the units that the current unit depends on.
    
    1038
    +              needed_units :: [UnitId]
    
    1039
    +              needed_units = unitDepends unit_info
    
    1040
    +
    
    1041
    +              -- | The offending dependencies of the current unit.
    
    1042
    +              current_offenders :: [(UnitId, UnitId)]
    
    1043
    +              current_offenders
    
    1044
    +                | current_unit `elementOfUniqSet` home_units
    
    1045
    +                  = []
    
    1046
    +                | otherwise
    
    1047
    +                  = map ((,) current_unit) $
    
    1048
    +                    nonDetEltsUniqSet $
    
    1049
    +                    mkUniqSet needed_units `intersectUniqSets` home_units
    
    1050
    +
    
    1051
    +            remaining_offenders <- collect_for_home_unit unit_info_map $
    
    1052
    +                                   needed_units ++ remaining_units
    
    1053
    +            return $ current_offenders ++ remaining_offenders
    
    955 1054
     
    
    956
    -    all_unit_direct_deps :: UniqMap UnitId (Set.Set UnitId)
    
    957
    -    all_unit_direct_deps
    
    958
    -      = HUG.unitEnv_foldWithKey go emptyUniqMap $ ue_home_unit_graph ue
    
    959
    -      where
    
    960
    -        go rest this this_uis =
    
    961
    -           plusUniqMap_C Set.union
    
    962
    -             (addToUniqMap_C Set.union external_depends this (Set.fromList $ this_deps))
    
    963
    -             rest
    
    964
    -           where
    
    965
    -             external_depends = mapUniqMap (Set.fromList . unitDepends) (unitInfoMap this_units)
    
    966
    -             this_units = homeUnitEnv_units this_uis
    
    967
    -             this_deps = [ toUnitId unit | (unit,Just _) <- explicitUnits this_units]
    
    968
    -
    
    969
    -    graphNodes :: [Node UnitId UnitId]
    
    970
    -    graphNodes = go Set.empty home_id_set
    
    971
    -      where
    
    972
    -        go done todo
    
    973
    -          = case Set.minView todo of
    
    974
    -              Nothing -> []
    
    975
    -              Just (uid, todo')
    
    976
    -                | Set.member uid done -> go done todo'
    
    977
    -                | otherwise -> case lookupUniqMap all_unit_direct_deps uid of
    
    978
    -                    Nothing -> pprPanic "uid not found" (ppr (uid, all_unit_direct_deps))
    
    979
    -                    Just depends ->
    
    980
    -                      let todo'' = (depends Set.\\ done) `Set.union` todo'
    
    981
    -                      in DigraphNode uid uid (Set.toList depends) : go (Set.insert uid done) todo''
    
    1055
    +{-
    
    1056
    +
    
    1057
    +Note [Home unit closure property check]
    
    1058
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    1059
    +
    
    1060
    +Per the definition in Note [Multiple Home Units], a unit environment has the
    
    1061
    +closure property exactly if there are no paths /h/₁ →* /e/ →* /h/₂ in the
    
    1062
    +dependency graph, where /h/₁ and /h/₂ are home units and /e/ is an external
    
    1063
    +unit. However, the algorithm used by 'checkHomeUnitsClosed' searches for
    
    1064
    +so-called offending dependencies, which are dependencies /e/ → /h/₂ that are
    
    1065
    +part of a path /h/₁ →* /e/ → /h/₂ in the dependency graph. To see that this is a
    
    1066
    +viable approach, consider the following:
    
    1067
    +
    
    1068
    +  * A path /h/₁ →* /e/ → /h/₂ is also a path /h/₁ →* /e/ →* /h/₂.
    
    1069
    +
    
    1070
    +  * For each path /h/₁ →* /e/ →* /h/₂, there exists a path /h/₁ →* /e/′ → /h/₂′,
    
    1071
    +    where /e/′ is an external unit and /h/₂′ is a home unit. Such a path can be
    
    1072
    +    constructed by taking as /h/₂′ the first home unit on the path /e/ →* /h/₂
    
    1073
    +    and as /e/′ the, necessarily external, unit preceding it.
    
    1074
    +
    
    1075
    +Concretely, the algorithm picks one home unit after the other, determines what
    
    1076
    +units it directly depends on, and, starting from them, follows unit dependencies
    
    1077
    +to search for offending dependencies. It does not follow dependencies that have
    
    1078
    +been followed before, possibly when processing another home unit. To achieve
    
    1079
    +this, the algorithm tracks, across home units, from which units it has already
    
    1080
    +followed dependencies. For this tracking, it identifies each unit by a 'UnitId'
    
    1081
    +and an ABI hash. Using only a 'UnitId' would not work, because 'UnitId's are not
    
    1082
    +always globally unique. Also using only an ABI hash is not an option, because an
    
    1083
    +ABI hash is not necessarily an ABI hash: it can also be the string @"inline"@.
    
    1084
    +
    
    1085
    +The correctness of this algorithm rests on the, likely correct, assumption that,
    
    1086
    +among the units mentioned in the 'UnitState' of a particular home unit, any unit
    
    1087
    +can be uniquely identified by its 'UnitId' and thus 'UnitId' clashes can only
    
    1088
    +occur across the 'UnitState's of different home units.
    
    1089
    +
    
    1090
    +An alternative approach to finding offending dependencies would be to follow
    
    1091
    +dependencies starting from all units that /any/ home unit directly depends on
    
    1092
    +instead of considering the different home units separately. A corresponding
    
    1093
    +algorithm could in principle find the dependencies of a particular unit
    
    1094
    +independently of any home unit by fetching the 'UnitInfo' of that unit from the
    
    1095
    +'GlobalUnitInfoMap'. However, for such a lookup the algorithm would need not
    
    1096
    +only the 'UnitId' but also the ABI hash of the unit in question. Therefore,
    
    1097
    +whenever following a dependency of a unit /u/ on a unit /v/, it would have to
    
    1098
    +determine the ABI hash of /v/, so that it could later look up /v/’s
    
    1099
    +dependencies. The ABI hashes of all units that /u/ depends on should be
    
    1100
    +available in the 'unitAbiDepends' field of /u/’s 'UnitInfo'. However, at the
    
    1101
    +time of writing, 'unitAbiDepends' never contained anything other than the empty
    
    1102
    +list during GHC test runs, which indicated that this alternative solution was
    
    1103
    +impossible to realize.
    
    1104
    +
    
    1105
    +-}
    
    982 1106
     
    
    983 1107
     --------------------------------------------------------------------------------
    
    984 1108
     -- * Enable Code Gen for Template Haskell
    
    ... ... @@ -1763,7 +1887,7 @@ data NodeRes v
    1763 1887
     --
    
    1764 1888
     -- See also Note [Downsweep Control Flow and Caching]
    
    1765 1889
     dfsBuild :: (Ord k, Monad m)
    
    1766
    -         => Maybe (Map.Map k (NodeRes v))
    
    1890
    +         => Maybe (Map k (NodeRes v))
    
    1767 1891
              -- ^ Base map, existing results. We won't re-expand any of the nodes
    
    1768 1892
              -- already present in this map.
    
    1769 1893
              -> [n]
    
    ... ... @@ -1773,7 +1897,7 @@ dfsBuild :: (Ord k, Monad m)
    1773 1897
              -> (n -> m (NodeRes (v,[n])))
    
    1774 1898
              -- ^ Expand this node into its payload result and into the list of
    
    1775 1899
              -- children nodes to visit next.
    
    1776
    -         -> m (Map.Map k (NodeRes v))
    
    1900
    +         -> m (Map k (NodeRes v))
    
    1777 1901
              -- ^ The result accumulates the payload of expanding the root nodes
    
    1778 1902
              -- and all nodes transitively reachable from those roots.
    
    1779 1903
     dfsBuild base_map roots key expand = go roots (fromMaybe Map.empty base_map)
    

  • compiler/GHC/Driver/Errors/Ppr.hs
    ... ... @@ -235,10 +235,17 @@ instance Diagnostic DriverMessage where
    235 235
                            "but no output will be generated.") $$
    
    236 236
                            (text "There is no module named" <+>
    
    237 237
                            quotes (ppr mod_name) <> text "."))
    
    238
    -    DriverHomePackagesNotClosed needed_unit_ids
    
    239
    -      -> mkSimpleDecorated $ vcat ([text "Home units are not closed."
    
    240
    -                                  , text "It is necessary to also load the following units:" ]
    
    241
    -                                  ++ map (\uid -> text "-" <+> ppr uid) needed_unit_ids)
    
    238
    +    DriverHomePackagesNotClosed offending_dependencies
    
    239
    +      -> mkSimpleDecorated $
    
    240
    +         hang (text "Some units are not loaded but depend on loaded units.")
    
    241
    +              4
    
    242
    +              (vcat (map pprDependency offending_dependencies))
    
    243
    +      where
    
    244
    +
    
    245
    +        pprDependency :: (UnitId, UnitId) -> SDoc
    
    246
    +        pprDependency (external_unit, home_unit)
    
    247
    +          = ppr external_unit <+> arrow <+> ppr home_unit
    
    248
    +
    
    242 249
         DriverInterfaceError reason -> diagnosticMessage (ifaceDiagnosticOpts opts) reason
    
    243 250
     
    
    244 251
         DriverInconsistentDynFlags msg
    

  • compiler/GHC/Driver/Errors/Types.hs
    ... ... @@ -369,7 +369,7 @@ data DriverMessage where
    369 369
     
    
    370 370
       DriverRedirectedNoMain :: !ModuleName -> DriverMessage
    
    371 371
     
    
    372
    -  DriverHomePackagesNotClosed :: ![UnitId] -> DriverMessage
    
    372
    +  DriverHomePackagesNotClosed :: ![(UnitId, UnitId)] -> DriverMessage
    
    373 373
     
    
    374 374
       DriverInterfaceError :: !IfaceMessage -> DriverMessage
    
    375 375
     
    

  • compiler/GHC/Parser.y
    ... ... @@ -1796,10 +1796,10 @@ cvars1 :: { [RecordPatSynField GhcPs] }
    1796 1796
     where_decls :: { LocatedA (OrdList (LHsDecl GhcPs), EpToken "where", AnnList) }
    
    1797 1797
             : 'where' '{' decls '}'       {% amsA' (sLL $1 $> (thdOf3 $ unLoc $3,
    
    1798 1798
                                                     epTok $1,
    
    1799
    -                                                AnnList (Just (fstOf3 $ unLoc $3)) (ListBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3))) }
    
    1799
    +                                                AnnList (AnnListLayout (fstOf3 $ unLoc $3)) (ListBraces (epTok $2) (epTok $4)) (sndOf3 $ unLoc $3))) }
    
    1800 1800
             | 'where' vocurly decls close {% amsA' (sLL $1 $3 (thdOf3 $ unLoc $3,
    
    1801 1801
                                                     epTok $1,
    
    1802
    -                                                AnnList (Just (fstOf3 $ unLoc $3)) ListNone (sndOf3 $ unLoc $3))) }
    
    1802
    +                                                AnnList (AnnListLayout (fstOf3 $ unLoc $3)) ListNone (sndOf3 $ unLoc $3))) }
    
    1803 1803
     
    
    1804 1804
     pattern_synonym_sig :: { LSig GhcPs }
    
    1805 1805
             : 'pattern' con_list '::' sigtype
    
    ... ... @@ -1935,9 +1935,9 @@ decls :: { Located (EpaLocation, [EpToken ";"], OrdList (LHsDecl GhcPs)) }
    1935 1935
             | {- empty -}                   { noLoc (noAnn, [],nilOL) }
    
    1936 1936
     
    
    1937 1937
     decllist :: { Located (AnnList,Located (OrdList (LHsDecl GhcPs))) }
    
    1938
    -        : '{'            decls '}'     { sLL $1 $> (AnnList (Just (fstOf3 $ unLoc $2)) (ListBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2)
    
    1938
    +        : '{'            decls '}'     { sLL $1 $> (AnnList (AnnListLayout (fstOf3 $ unLoc $2)) (ListBraces (epTok $1) (epTok $3)) (sndOf3 $ unLoc $2)
    
    1939 1939
                                                        ,sL1 $2 $ thdOf3 $ unLoc $2) }
    
    1940
    -        |     vocurly    decls close   { sL1 $2    (AnnList (Just (fstOf3 $ unLoc $2)) ListNone (sndOf3 $ unLoc $2)
    
    1940
    +        |     vocurly    decls close   { sL1 $2    (AnnList (AnnListLayout (fstOf3 $ unLoc $2)) ListNone (sndOf3 $ unLoc $2)
    
    1941 1941
                                                        ,sL1 $2 $ thdOf3 $ unLoc $2) }
    
    1942 1942
     
    
    1943 1943
     -- Binding groups other than those of class and instance declarations
    
    ... ... @@ -1945,16 +1945,16 @@ decllist :: { Located (AnnList,Located (OrdList (LHsDecl GhcPs))) }
    1945 1945
     binds   ::  { Located (HsLocalBinds GhcPs) }
    
    1946 1946
                                              -- May have implicit parameters
    
    1947 1947
                                                     -- No type declarations
    
    1948
    -        : decllist          {% do { let { (AnnList anc p s, decls) = unLoc $1 }
    
    1948
    +        : decllist          {% do { let { (AnnList la p s, decls) = unLoc $1 }
    
    1949 1949
                                       ; val_binds <- cvBindGroup (unLoc $ decls)
    
    1950 1950
                                       ; !cs <- getCommentsFor (gl $1)
    
    1951
    -                                  ; return (sL1 $1 $ HsValBinds (EpAnn (glR $1) (AnnList anc p s) cs, noEpTok) val_binds)} }
    
    1951
    +                                  ; return (sL1 $1 $ HsValBinds (EpAnn (glR $1) (AnnList la p s) cs, noEpTok) val_binds)} }
    
    1952 1952
     
    
    1953 1953
             | '{'            dbinds '}'     {% acs (comb3 $1 $2 $3) (\loc cs -> (L loc
    
    1954
    -                                             $ HsIPBinds (EpAnn (spanAsAnchor (comb3 $1 $2 $3)) (AnnList (Just$ glR $2) (ListBraces (epTok $1) (epTok $3)) []) cs, noEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1954
    +                                             $ HsIPBinds (EpAnn (spanAsAnchor (comb3 $1 $2 $3)) (AnnList (AnnListLayout$ glR $2) (ListBraces (epTok $1) (epTok $3)) []) cs, noEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1955 1955
     
    
    1956 1956
             |     vocurly    dbinds close   {% acs (gl $2) (\loc cs -> (L loc
    
    1957
    -                                             $ HsIPBinds (EpAnn (glR $1) (AnnList (Just $ glR $2) ListNone []) cs, noEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1957
    +                                             $ HsIPBinds (EpAnn (glR $1) (AnnList (AnnListLayout $ glR $2) ListNone []) cs, noEpTok) (IPBinds noExtField (reverse $ unLoc $2)))) }
    
    1958 1958
     
    
    1959 1959
     
    
    1960 1960
     wherebinds :: { Maybe (Located (HsLocalBinds GhcPs, Maybe EpAnnComments )) }
    
    ... ... @@ -3542,11 +3542,11 @@ guardquals1 :: { Located [LStmt GhcPs (LHsExpr GhcPs)] }
    3542 3542
     altslist(PATS) :: { forall b. DisambECP b => PV (LocatedA ([LMatch GhcPs (LocatedA b)], AnnList)) }
    
    3543 3543
             : '{'        alts(PATS) '}'    { $2 >>= \ $2 -> amsA'
    
    3544 3544
                                                (sLL $1 $> (reverse (snd $ unLoc $2),
    
    3545
    -                                           (AnnList (Just $ glR $2) (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2)))) }
    
    3545
    +                                           (AnnList (AnnListLayout $ glR $2) (ListBraces (epTok $1) (epTok $3)) (fst $ unLoc $2)))) }
    
    3546 3546
             | vocurly    alts(PATS)  close { $2 >>= \ $2 -> amsA'
    
    3547 3547
                                                (L (getLoc $2) (reverse (snd $ unLoc $2),
    
    3548
    -                                           (AnnList (Just $ glR $2) ListNone (fst $ unLoc $2)))) }
    
    3549
    -        | '{'              '}'   { amsA' (sLL $1 $> ([], (AnnList Nothing (ListBraces (epTok $1) (epTok $2)) []))) }
    
    3548
    +                                           (AnnList (AnnListLayout $ glR $2) ListNone (fst $ unLoc $2)))) }
    
    3549
    +        | '{'              '}'   { amsA' (sLL $1 $> ([], (AnnList AnnListNoLayout (ListBraces (epTok $1) (epTok $2)) []))) }
    
    3550 3550
             | vocurly          close { return $ noLocA ([], noAnn) }
    
    3551 3551
     
    
    3552 3552
     alts(PATS) :: { forall b. DisambECP b => PV (Located ([EpToken ";"],[LMatch GhcPs (LocatedA b)])) }
    
    ... ... @@ -3656,10 +3656,10 @@ apat : aexp {% (checkPattern <=< runPV) (unECP $1) }
    3656 3656
     
    
    3657 3657
     stmtlist :: { forall b. DisambECP b => PV (LocatedA (AnnList, Located [LocatedA (Stmt GhcPs (LocatedA b))])) }
    
    3658 3658
             : '{'           stmts '}'       { $2 >>= \ $2 ->
    
    3659
    -                                          amsA' (sLL $1 $> (AnnList (Just (spanAsAnchor $ stmtsLoc $2)) (ListBraces (epTok $1) (epTok $3)) (fromOL $ fst $ unLoc $2)
    
    3659
    +                                          amsA' (sLL $1 $> (AnnList (AnnListLayout (spanAsAnchor $ stmtsLoc $2)) (ListBraces (epTok $1) (epTok $3)) (fromOL $ fst $ unLoc $2)
    
    3660 3660
                                                                , sL1 $2 $ reverse $ snd $ unLoc $2))}
    
    3661 3661
             |     vocurly   stmts close     { $2 >>= \ $2 ->
    
    3662
    -                                          amsA' (L (stmtsLoc $2) (AnnList (Just (spanAsAnchor $ stmtsLoc $2)) ListNone (fromOL $ fst $ unLoc $2)
    
    3662
    +                                          amsA' (L (stmtsLoc $2) (AnnList (AnnListLayout (spanAsAnchor $ stmtsLoc $2)) ListNone (fromOL $ fst $ unLoc $2)
    
    3663 3663
                                                                      , sL1 $2 $ reverse $ snd $ unLoc $2))}
    
    3664 3664
     
    
    3665 3665
     --      do { ;; s ; s ; ; s ;; }
    
    ... ... @@ -4630,9 +4630,6 @@ glEEz !x !y = if isZeroWidthSpan (getHasLoc y)
    4630 4630
                     then spanAsAnchor (getHasLoc x)
    
    4631 4631
                     else spanAsAnchor $ comb2 x y
    
    4632 4632
     
    
    4633
    -glRM :: Located a -> Maybe EpaLocation
    
    4634
    -glRM (L !l _) = Just $ spanAsAnchor l
    
    4635
    -
    
    4636 4633
     n2l :: LocatedN a -> LocatedA a
    
    4637 4634
     n2l (L !la !a) = L (l2l la) a
    
    4638 4635
     
    

  • compiler/GHC/Parser/Annotation.hs
    ... ... @@ -31,10 +31,6 @@ module GHC.Parser.Annotation (
    31 31
       SrcSpanAnnA, SrcSpanAnnN,
    
    32 32
     
    
    33 33
       -- ** Annotation data types used in 'GenLocated'
    
    34
    -
    
    35
    -  AnnList(..), AnnListBrackets(..),
    
    36
    -  AnnParen(..),
    
    37
    -  AnnCType(..),AnnWarningTxt(..),AnnOverlap(..),AnnAnnDecl(..),AnnPragSCC(..),
    
    38 34
       NameAnn(..), NameAdornment(..),
    
    39 35
       NoEpAnns(..),
    
    40 36
     
    
    ... ... @@ -43,6 +39,12 @@ module GHC.Parser.Annotation (
    43 39
       addTrailingAnnToA, addTrailingCommaToN,
    
    44 40
       noTrailingN,
    
    45 41
     
    
    42
    +  -- ** Annotation data types used in TTG extension points
    
    43
    +
    
    44
    +  AnnList(..), AnnListBrackets(..), AnnListLayout(..),
    
    45
    +  AnnParen(..),
    
    46
    +  AnnCType(..),AnnWarningTxt(..),AnnOverlap(..),AnnAnnDecl(..),AnnPragSCC(..),
    
    47
    +
    
    46 48
       -- ** Utilities for converting between different 'GenLocated' when
    
    47 49
       -- ** we do not care about the annotations.
    
    48 50
       l2l, la2la,
    
    ... ... @@ -513,7 +515,7 @@ instance Outputable TrailingAnn where
    513 515
     -- AZ: goal: only used when there is layout, so vertical alignment matters
    
    514 516
     data AnnList
    
    515 517
       = AnnList {
    
    516
    -      al_anchor    :: !(Maybe EpaLocation), -- ^ start point of a list having layout
    
    518
    +      al_layout    :: !AnnListLayout,
    
    517 519
           al_brackets  :: !AnnListBrackets,
    
    518 520
           al_semis     :: [EpToken ";"] -- decls
    
    519 521
           } deriving (Data,Eq)
    
    ... ... @@ -523,6 +525,18 @@ data AnnListBrackets
    523 525
       | ListNone
    
    524 526
       deriving (Data,Eq)
    
    525 527
     
    
    528
    +-- | How the extent of a list was delimited in the source.
    
    529
    +data AnnListLayout
    
    530
    +  = AnnListBraces   -- ^ Explicit @{ ; }@ written by the user. The tokens
    
    531
    +                    --   live in 'al_brackets' and 'al_semis'.
    
    532
    +  | AnnListLayout !EpaLocation
    
    533
    +                    -- ^ The lexer opened an implicit layout context.
    
    534
    +                    --   The 'EpaLocation' is the @vocurly@ token (or, for
    
    535
    +                    --   MultiWayIf, the leading @|@), whose start column is
    
    536
    +                    --   the layout column chosen by 'new_layout_context'.
    
    537
    +  | AnnListNoLayout -- ^ Neither: an Empty or compiler-generated list.
    
    538
    +  deriving (Data, Eq)
    
    539
    +
    
    526 540
     -- ---------------------------------------------------------------------
    
    527 541
     -- Annotations for parenthesised elements, such as tuples, lists
    
    528 542
     -- ---------------------------------------------------------------------
    
    ... ... @@ -993,7 +1007,10 @@ instance NoAnn NoEpAnns where
    993 1007
       noAnn = NoEpAnns
    
    994 1008
     
    
    995 1009
     instance NoAnn AnnList where
    
    996
    -  noAnn = AnnList Nothing ListNone noAnn
    
    1010
    +  noAnn = AnnList noAnn ListNone noAnn
    
    1011
    +
    
    1012
    +instance NoAnn AnnListLayout where
    
    1013
    +  noAnn = AnnListNoLayout
    
    997 1014
     
    
    998 1015
     instance NoAnn NameAnn where
    
    999 1016
       noAnn = NameAnnTrailing []
    
    ... ... @@ -1094,6 +1111,11 @@ instance Outputable AnnListBrackets where
    1094 1111
       ppr (ListBraces o c) = text "ListBraces" <+> ppr o <+> ppr c
    
    1095 1112
       ppr ListNone         = text "ListNone"
    
    1096 1113
     
    
    1114
    +instance Outputable AnnListLayout where
    
    1115
    +  ppr AnnListBraces     = text "AnnListBraces"
    
    1116
    +  ppr (AnnListLayout l) = text "AnnListLayout" <+> ppr l
    
    1117
    +  ppr AnnListNoLayout   = text "AnnListNoLayout"
    
    1118
    +
    
    1097 1119
     instance Outputable AnnCType where
    
    1098 1120
       ppr (AnnCType o c l ca)
    
    1099 1121
         = text "AnnCType" <+> ppr o <+> ppr c <+> ppr l
    

  • compiler/GHC/Parser/PostProcess.hs
    ... ... @@ -466,7 +466,7 @@ add_where w@(EpTok (EpaSpan (RealSrcSpan rs _))) (EpAnn a al cs) cs2
    466 466
       = (EpAnn (widenAnchorT a w) al (cs Semi.<> cs2), w)
    
    467 467
       | otherwise
    
    468 468
       = (EpAnn (patch_anchor rs a)
    
    469
    -           (al { al_anchor = (fmap (patch_anchor rs) (al_anchor al))})
    
    469
    +           (al { al_layout = patch_layout (al_layout al)})
    
    470 470
                (cs Semi.<> cs2), w)
    
    471 471
     add_where _ _ _ = panic "add_where"
    
    472 472
      -- EpaDelta should only be used for transformations
    
    ... ... @@ -484,6 +484,12 @@ patch_anchor r1 (EpaSpan (RealSrcSpan r0 mb)) = EpaSpan (RealSrcSpan r mb)
    484 484
         r = if srcSpanStartLine r0 < 0 then r1 else r0
    
    485 485
     patch_anchor _ (EpaSpan ss) = EpaSpan ss
    
    486 486
     
    
    487
    +-- If the decl list for where binds is empty, the anchor ends up
    
    488
    +-- invalid. Explicitly mark it as not having layout
    
    489
    +patch_layout :: AnnListLayout -> AnnListLayout
    
    490
    +patch_layout (AnnListLayout _) = AnnListNoLayout
    
    491
    +patch_layout lo = lo
    
    492
    +
    
    487 493
     -- | The anchor for a stmtlist is based on either the location or
    
    488 494
     -- the first semicolon annotion.
    
    489 495
     stmtsAnchor :: Located (OrdList (EpToken tok),a) -> Maybe EpaLocation
    

  • compiler/GHC/Unit/Env.hs
    ... ... @@ -443,13 +443,14 @@ The flow:
    443 443
     Closure Property
    
    444 444
     ----------------
    
    445 445
     
    
    446
    -You must perform a clean cut of the dependency graph.
    
    446
    +A unit environment must have the closure property:
    
    447 447
     
    
    448
    -> Any dependency which is not a home unit must not (transitively) depend on a home unit.
    
    448
    +    No used external unit depends on a home unit.
    
    449 449
     
    
    450
    -For example, if you have three packages p, q and r, then if p depends on q which
    
    451
    -depends on r then it is illegal to load both p and r as home units but not q,
    
    452
    -because q is a dependency of the home unit p which depends on another home unit r.
    
    450
    +More concretely, a unit environment has the closure property exactly if no home
    
    451
    +unit directly or indirectly depends on an external unit that directly or
    
    452
    +indirectly depends on a home unit. 'GHC.Driver.Downsweep.checkHomeUnitsClosed'
    
    453
    +checks whether a given unit environment indeed has this property.
    
    453 454
     
    
    454 455
     Offsetting Paths
    
    455 456
     ----------------
    

  • compiler/GHC/Unit/State.hs
    ... ... @@ -369,10 +369,15 @@ data UnitState = UnitState {
    369 369
       -- is always mentioned before the units it depends on.
    
    370 370
       preloadUnits      :: [UnitId],
    
    371 371
     
    
    372
    -  -- | Units which we explicitly depend on (from a command line flag).
    
    373
    -  -- We'll use this to generate version macros and the unused packages warning. The
    
    374
    -  -- original flag which was used to bring the unit into scope is recorded for the
    
    375
    -  -- -Wunused-packages warning.
    
    372
    +  -- | The units that can be used by the respective home unit. Despite the
    
    373
    +  -- identifier, this does not just cover units that are enabled explicitly
    
    374
    +  -- using flags but also units from the package database that are enabled
    
    375
    +  -- implicitly in case @-hide-all-packages@ is absent. The former are paired
    
    376
    +  -- with 'Just' applied to the respective flags, the latter are paired with
    
    377
    +  -- 'Nothing'.
    
    378
    +  --
    
    379
    +  -- This field is used for generating version macros and “unused packages”
    
    380
    +  -- warnings.
    
    376 381
       explicitUnits :: [(Unit, Maybe PackageArg)],
    
    377 382
     
    
    378 383
       homeUnitDepends    :: Set UnitId,
    
    ... ... @@ -907,7 +912,7 @@ mkUnitState logger unit_index cfg = do
    907 912
       let pkgname_map = listToUFM [ (unitPackageName p, unitInstanceOf p)
    
    908 913
                                   | p <- pkgs2
    
    909 914
                                   ]
    
    910
    -  -- The explicitUnits accurately reflects the set of units we have turned
    
    915
    +  -- The explicitUnits accurately reflects the set of units that are turned
    
    911 916
       -- on; as such, it also is the only way one can come up with requirements.
    
    912 917
       -- The requirement context is directly based off of this: we simply
    
    913 918
       -- look for nested unit IDs that are directly fed holes: the requirements
    

  • hadrian/ghci-multi-cabal.in
    ... ... @@ -10,4 +10,4 @@ export TOOL_OUTPUT=.hadrian_ghci_multi/ghci_args
    10 10
     # Replace newlines with spaces, as these otherwise break the ghci invocation on windows.
    
    11 11
     CABFLAGS=-v0 "hadrian/build-cabal" multi --build-root=.hadrian_ghci_multi --flavour=ghc-in-ghci $HADRIAN_ARGS
    
    12 12
     GHC_FLAGS="$GHC_FLAGS $(cat $TOOL_OUTPUT | tr '\n\r' ' ')"
    
    13
    -$RUN_GHC --interactive $GHC_FLAGS $@ -fno-code -fwrite-interface -O0 +RTS -A128m
    13
    +$RUN_GHC --interactive $GHC_FLAGS $@ -hide-all-packages -fno-code -fwrite-interface -O0 +RTS -A128m

  • testsuite/tests/driver/multipleHomeUnits/mhu-closure/Makefile
    ... ... @@ -3,39 +3,47 @@ include $(TOP)/mk/boilerplate.mk
    3 3
     include $(TOP)/mk/test.mk
    
    4 4
     
    
    5 5
     SETUP=../Setup -v0
    
    6
    +CONFIGURE=configure \
    
    7
    +	  $(CABAL_MINIMAL_BUILD) \
    
    8
    +	  --with-ghc='$(TEST_HC)' \
    
    9
    +	  --with-hc-pkg='$(GHC_PKG)' \
    
    10
    +	  --ghc-options='$(TEST_HC_OPTS)' \
    
    11
    +	  --package-db=../tmp.d
    
    12
    +TEST_BUILD='$(TEST_HC)' $(TEST_HC_OPTS) -fhide-source-paths -fforce-recomp
    
    13
    +ONLY_BASE=-hide-all-packages -package base
    
    6 14
     
    
    7
    -mhu-closure: clean
    
    8
    -	$(MAKE) -s --no-print-directory clean
    
    15
    +mhu-closure: clean pkg-database
    
    16
    +	! $(TEST_BUILD) -unit @unitP
    
    17
    +	! $(TEST_BUILD) -unit @unitP -unit @unitQ
    
    18
    +	! $(TEST_BUILD) -unit @unitP -unit @unitR
    
    19
    +	! $(TEST_BUILD) -unit @unitP -unit @unitR1
    
    20
    +	$(TEST_BUILD) -unit @unitP -unit @unitQ -unit @unitR
    
    21
    +	! $(TEST_BUILD) -unit @unitP -unit @unitQ -unit @unitR1
    
    22
    +	$(TEST_BUILD) $(ONLY_BASE) -unit @unitP
    
    23
    +	$(TEST_BUILD) $(ONLY_BASE) -unit @unitP -unit @unitQ
    
    24
    +	! $(TEST_BUILD) $(ONLY_BASE) -unit @unitP -unit @unitR
    
    25
    +	! $(TEST_BUILD) $(ONLY_BASE) -unit @unitP -unit @unitR1
    
    26
    +	$(TEST_BUILD) $(ONLY_BASE) -unit @unitP -unit @unitQ -unit @unitR
    
    27
    +	$(TEST_BUILD) $(ONLY_BASE) -unit @unitP -unit @unitQ -unit @unitR1
    
    28
    +
    
    29
    +.PHONY: pkg-database
    
    30
    +pkg-database:
    
    9 31
     	'$(GHC_PKG)' init tmp.d
    
    10 32
     	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Setup
    
    11
    -	cd p && $(SETUP) clean
    
    12
    -	cd p && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --ipid=p-0.1.0.0 --with-ghc='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d
    
    33
    +	cd p && $(SETUP) $(CONFIGURE) --ipid=p-0.1.0.0
    
    13 34
     	cd p && $(SETUP) build
    
    14 35
     	cd p && $(SETUP) register --inplace
    
    15
    -	cd q && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --ipid=q-0.1.0.0 --with-ghc='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d
    
    36
    +	cd q && $(SETUP) $(CONFIGURE) --ipid=q-0.1.0.0
    
    16 37
     	cd q && $(SETUP) build
    
    17 38
     	cd q && $(SETUP) register --inplace
    
    18
    -	cd r && $(SETUP) configure $(CABAL_MINIMAL_BUILD) --ipid=r-0.1.0.0 --with-ghc='$(TEST_HC)' --with-hc-pkg='$(GHC_PKG)' --ghc-options='$(TEST_HC_OPTS)' --package-db=../tmp.d
    
    39
    +	cd r && $(SETUP) $(CONFIGURE) --ipid=r-0.1.0.0
    
    19 40
     	cd r && $(SETUP) build
    
    20 41
     	cd r && $(SETUP) register --inplace
    
    21
    -	# This should work
    
    22
    -	'$(TEST_HC)' $(TEST_HC_OPTS) -fhide-source-paths -fforce-recomp -unit @unitP
    
    23
    -	# So should this
    
    24
    -	'$(TEST_HC)' $(TEST_HC_OPTS) -fhide-source-paths -fforce-recomp -unit @unitP -unit @unitQ
    
    25
    -	# So should this
    
    26
    -	'$(TEST_HC)' $(TEST_HC_OPTS) -fhide-source-paths -fforce-recomp -unit @unitP -unit @unitQ -unit @unitR
    
    27
    -	# This should error with a closure message
    
    28
    -	! '$(TEST_HC)' $(TEST_HC_OPTS) -fhide-source-paths -fforce-recomp -unit @unitP -unit @unitR
    
    29
    -	# This should work, even though r1 is not in the package db
    
    30
    -	'$(TEST_HC)' $(TEST_HC_OPTS) -fhide-source-paths -fforce-recomp -unit @unitP -unit @unitQ -unit @unitR1
    
    31
    -	# This should fail, even though r1 is not in the package db
    
    32
    -	! '$(TEST_HC)' $(TEST_HC_OPTS) -fhide-source-paths -fforce-recomp -unit @unitP -unit @unitR1
    
    33 42
     
    
    43
    +.PHONY: clean
    
    44
    +clean:
    
    45
    +	$(RM) -r tmp.d Setup$(exeext) */dist* *.hi *.o */*.hi */*.o
    
    34 46
     
    
    35 47
     ifeq "$(CLEANUP)" "1"
    
    36 48
     	$(MAKE) -s --no-print-directory clean
    
    37 49
     endif
    38
    -
    
    39
    -clean :
    
    40
    -	 $(RM) -r tmp*.d inst-* *.o *.hi */*.o */*.hi */Setup$(exeext) */dist Setup$(exeext)
    
    41
    -

  • testsuite/tests/driver/multipleHomeUnits/mhu-closure/mhu-closure.stderr
    1 1
     
    
    2
    -<command line>: error: [GHC-03271]
    
    3
    -    Home units are not closed.
    
    4
    -    It is necessary to also load the following units:
    
    5
    -    - q-0.1.0.0
    
    6
    -
    
    7
    -<command line>: error: [GHC-03271]
    
    8
    -    Home units are not closed.
    
    9
    -    It is necessary to also load the following units:
    
    10
    -    - q-0.1.0.0
    2
    +<no location info>: error: [GHC-03271]
    
    3
    +    Some units are not loaded but depend on loaded units.
    
    4
    +        q-0.1.0.0 -> p-0.1.0.0
    
    5
    +
    
    6
    +<no location info>: error: [GHC-03271]
    
    7
    +    Some units are not loaded but depend on loaded units.
    
    8
    +        r-0.1.0.0 -> q-0.1.0.0
    
    9
    +
    
    10
    +<no location info>: error: [GHC-03271]
    
    11
    +    Some units are not loaded but depend on loaded units.
    
    12
    +        q-0.1.0.0 -> p-0.1.0.0
    
    13
    +
    
    14
    +<no location info>: error: [GHC-03271]
    
    15
    +    Some units are not loaded but depend on loaded units.
    
    16
    +        q-0.1.0.0 -> p-0.1.0.0
    
    17
    +
    
    18
    +<no location info>: error: [GHC-03271]
    
    19
    +    Some units are not loaded but depend on loaded units.
    
    20
    +        r-0.1.0.0 -> q-0.1.0.0
    
    21
    +
    
    22
    +<no location info>: error: [GHC-03271]
    
    23
    +    Some units are not loaded but depend on loaded units.
    
    24
    +        q-0.1.0.0 -> p-0.1.0.0
    
    25
    +
    
    26
    +<no location info>: error: [GHC-03271]
    
    27
    +    Some units are not loaded but depend on loaded units.
    
    28
    +        q-0.1.0.0 -> p-0.1.0.0

  • testsuite/tests/driver/multipleHomeUnits/mhu-closure/mhu-closure.stdout
    1
    +[1 of 3] Compiling P[p-0.1.0.0]
    
    2
    +[2 of 3] Compiling Q[q-0.1.0.0]
    
    3
    +[3 of 3] Compiling R[r-0.1.0.0]
    
    1 4
     [1 of 1] Compiling P
    
    2 5
     [1 of 2] Compiling P[p-0.1.0.0]
    
    3 6
     [2 of 2] Compiling Q[q-0.1.0.0]
    

  • testsuite/tests/ghc-api/exactprint/T22919.stderr
    ... ... @@ -70,7 +70,7 @@
    70 70
            ((,)
    
    71 71
             (FromSource)
    
    72 72
             (AnnList
    
    73
    -         (Nothing)
    
    73
    +         (AnnListNoLayout)
    
    74 74
              (ListNone)
    
    75 75
              []))
    
    76 76
            (L
    

  • testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr
    ... ... @@ -82,7 +82,7 @@
    82 82
            ((,)
    
    83 83
             (FromSource)
    
    84 84
             (AnnList
    
    85
    -         (Nothing)
    
    85
    +         (AnnListNoLayout)
    
    86 86
              (ListNone)
    
    87 87
              []))
    
    88 88
            (L
    

  • testsuite/tests/module/mod185.stderr
    ... ... @@ -97,7 +97,7 @@
    97 97
            ((,)
    
    98 98
             (FromSource)
    
    99 99
             (AnnList
    
    100
    -         (Nothing)
    
    100
    +         (AnnListNoLayout)
    
    101 101
              (ListNone)
    
    102 102
              []))
    
    103 103
            (L
    

  • testsuite/tests/parser/should_compile/DumpParsedAst.stderr
    ... ... @@ -2223,7 +2223,7 @@
    2223 2223
            ((,)
    
    2224 2224
             (FromSource)
    
    2225 2225
             (AnnList
    
    2226
    -         (Nothing)
    
    2226
    +         (AnnListNoLayout)
    
    2227 2227
              (ListNone)
    
    2228 2228
              []))
    
    2229 2229
            (L
    

  • testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
    ... ... @@ -90,7 +90,7 @@
    90 90
            ((,)
    
    91 91
             (FromSource)
    
    92 92
             (AnnList
    
    93
    -         (Nothing)
    
    93
    +         (AnnListNoLayout)
    
    94 94
              (ListNone)
    
    95 95
              []))
    
    96 96
            (L
    
    ... ... @@ -213,7 +213,7 @@
    213 213
            ((,)
    
    214 214
             (FromSource)
    
    215 215
             (AnnList
    
    216
    -         (Nothing)
    
    216
    +         (AnnListNoLayout)
    
    217 217
              (ListNone)
    
    218 218
              []))
    
    219 219
            (L
    
    ... ... @@ -291,7 +291,7 @@
    291 291
                      ((,)
    
    292 292
                       (Right
    
    293 293
                        (AnnList
    
    294
    -                    (Just
    
    294
    +                    (AnnListLayout
    
    295 295
                          (EpaSpan { DumpParsedAstComments.hs:16:3 }))
    
    296 296
                         (ListNone)
    
    297 297
                         []))
    
    ... ... @@ -361,7 +361,7 @@
    361 361
            ((,)
    
    362 362
             (FromSource)
    
    363 363
             (AnnList
    
    364
    -         (Nothing)
    
    364
    +         (AnnListNoLayout)
    
    365 365
              (ListNone)
    
    366 366
              []))
    
    367 367
            (L
    

  • testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
    ... ... @@ -30,7 +30,7 @@
    30 30
                ((,)
    
    31 31
                 (FromSource)
    
    32 32
                 (AnnList
    
    33
    -             (Nothing)
    
    33
    +             (AnnListNoLayout)
    
    34 34
                  (ListNone)
    
    35 35
                  []))
    
    36 36
                (L
    

  • testsuite/tests/parser/should_compile/DumpSemis.stderr
    ... ... @@ -261,7 +261,7 @@
    261 261
            ((,)
    
    262 262
             (FromSource)
    
    263 263
             (AnnList
    
    264
    -         (Nothing)
    
    264
    +         (AnnListNoLayout)
    
    265 265
              (ListNone)
    
    266 266
              []))
    
    267 267
            (L
    
    ... ... @@ -333,7 +333,7 @@
    333 333
                      ((,)
    
    334 334
                       (Right
    
    335 335
                        (AnnList
    
    336
    -                    (Just
    
    336
    +                    (AnnListLayout
    
    337 337
                          (EpaSpan { DumpSemis.hs:(11,3)-(12,3) }))
    
    338 338
                         (ListNone)
    
    339 339
                         []))
    
    ... ... @@ -364,7 +364,7 @@
    364 364
                            ((,)
    
    365 365
                             (Right
    
    366 366
                              (AnnList
    
    367
    -                          (Just
    
    367
    +                          (AnnListLayout
    
    368 368
                                (EpaSpan { DumpSemis.hs:11:8-13 }))
    
    369 369
                               (ListBraces
    
    370 370
                                (EpTok (EpaSpan { DumpSemis.hs:11:6 }))
    
    ... ... @@ -555,7 +555,7 @@
    555 555
            ((,)
    
    556 556
             (FromSource)
    
    557 557
             (AnnList
    
    558
    -         (Nothing)
    
    558
    +         (AnnListNoLayout)
    
    559 559
              (ListNone)
    
    560 560
              []))
    
    561 561
            (L
    
    ... ... @@ -627,7 +627,7 @@
    627 627
                      ((,)
    
    628 628
                       (Right
    
    629 629
                        (AnnList
    
    630
    -                    (Just
    
    630
    +                    (AnnListLayout
    
    631 631
                          (EpaSpan { DumpSemis.hs:(16,5)-(18,5) }))
    
    632 632
                         (ListBraces
    
    633 633
                          (EpTok (EpaSpan { DumpSemis.hs:16:3 }))
    
    ... ... @@ -808,7 +808,7 @@
    808 808
            ((,)
    
    809 809
             (FromSource)
    
    810 810
             (AnnList
    
    811
    -         (Nothing)
    
    811
    +         (AnnListNoLayout)
    
    812 812
              (ListNone)
    
    813 813
              []))
    
    814 814
            (L
    
    ... ... @@ -880,7 +880,7 @@
    880 880
                      ((,)
    
    881 881
                       (Right
    
    882 882
                        (AnnList
    
    883
    -                    (Just
    
    883
    +                    (AnnListLayout
    
    884 884
                          (EpaSpan { DumpSemis.hs:22:12-28 }))
    
    885 885
                         (ListBraces
    
    886 886
                          (EpTok (EpaSpan { DumpSemis.hs:22:10 }))
    
    ... ... @@ -1017,7 +1017,7 @@
    1017 1017
            ((,)
    
    1018 1018
             (FromSource)
    
    1019 1019
             (AnnList
    
    1020
    -         (Nothing)
    
    1020
    +         (AnnListNoLayout)
    
    1021 1021
              (ListNone)
    
    1022 1022
              []))
    
    1023 1023
            (L
    
    ... ... @@ -1122,7 +1122,7 @@
    1122 1122
            ((,)
    
    1123 1123
             (FromSource)
    
    1124 1124
             (AnnList
    
    1125
    -         (Nothing)
    
    1125
    +         (AnnListNoLayout)
    
    1126 1126
              (ListNone)
    
    1127 1127
              []))
    
    1128 1128
            (L
    
    ... ... @@ -1229,7 +1229,7 @@
    1229 1229
            ((,)
    
    1230 1230
             (FromSource)
    
    1231 1231
             (AnnList
    
    1232
    -         (Nothing)
    
    1232
    +         (AnnListNoLayout)
    
    1233 1233
              (ListNone)
    
    1234 1234
              []))
    
    1235 1235
            (L
    
    ... ... @@ -1731,7 +1731,7 @@
    1731 1731
            ((,)
    
    1732 1732
             (FromSource)
    
    1733 1733
             (AnnList
    
    1734
    -         (Nothing)
    
    1734
    +         (AnnListNoLayout)
    
    1735 1735
              (ListNone)
    
    1736 1736
              []))
    
    1737 1737
            (L
    
    ... ... @@ -1857,7 +1857,7 @@
    1857 1857
            ((,)
    
    1858 1858
             (FromSource)
    
    1859 1859
             (AnnList
    
    1860
    -         (Nothing)
    
    1860
    +         (AnnListNoLayout)
    
    1861 1861
              (ListNone)
    
    1862 1862
              []))
    
    1863 1863
            (L
    
    ... ... @@ -1936,7 +1936,7 @@
    1936 1936
                        (EpAnn
    
    1937 1937
                         (EpaSpan { DumpSemis.hs:34:13-31 })
    
    1938 1938
                         (AnnList
    
    1939
    -                     (Just
    
    1939
    +                     (AnnListLayout
    
    1940 1940
                           (EpaSpan { DumpSemis.hs:34:18-30 }))
    
    1941 1941
                          (ListBraces
    
    1942 1942
                           (EpTok (EpaSpan { DumpSemis.hs:34:13 }))
    
    ... ... @@ -1984,7 +1984,7 @@
    1984 1984
                             ((,)
    
    1985 1985
                              (FromSource)
    
    1986 1986
                              (AnnList
    
    1987
    -                          (Nothing)
    
    1987
    +                          (AnnListNoLayout)
    
    1988 1988
                               (ListNone)
    
    1989 1989
                               []))
    
    1990 1990
                             (L
    
    ... ... @@ -2097,7 +2097,7 @@
    2097 2097
                             ((,)
    
    2098 2098
                              (FromSource)
    
    2099 2099
                              (AnnList
    
    2100
    -                          (Nothing)
    
    2100
    +                          (AnnListNoLayout)
    
    2101 2101
                               (ListNone)
    
    2102 2102
                               []))
    
    2103 2103
                             (L
    
    ... ... @@ -2222,7 +2222,7 @@
    2222 2222
            ((,)
    
    2223 2223
             (FromSource)
    
    2224 2224
             (AnnList
    
    2225
    -         (Nothing)
    
    2225
    +         (AnnListNoLayout)
    
    2226 2226
              (ListNone)
    
    2227 2227
              []))
    
    2228 2228
            (L
    
    ... ... @@ -2333,7 +2333,7 @@
    2333 2333
                       ((,)
    
    2334 2334
                        (FromSource)
    
    2335 2335
                        (AnnList
    
    2336
    -                    (Just
    
    2336
    +                    (AnnListLayout
    
    2337 2337
                          (EpaSpan { DumpSemis.hs:(38,6)-(43,13) }))
    
    2338 2338
                         (ListBraces
    
    2339 2339
                          (EpTok (EpaSpan { DumpSemis.hs:38:4 }))
    

  • testsuite/tests/parser/should_compile/KindSigs.stderr
    ... ... @@ -1000,7 +1000,7 @@
    1000 1000
            ((,)
    
    1001 1001
             (FromSource)
    
    1002 1002
             (AnnList
    
    1003
    -         (Nothing)
    
    1003
    +         (AnnListNoLayout)
    
    1004 1004
              (ListNone)
    
    1005 1005
              []))
    
    1006 1006
            (L
    
    ... ... @@ -1719,7 +1719,7 @@
    1719 1719
            ((,)
    
    1720 1720
             (FromSource)
    
    1721 1721
             (AnnList
    
    1722
    -         (Nothing)
    
    1722
    +         (AnnListNoLayout)
    
    1723 1723
              (ListNone)
    
    1724 1724
              []))
    
    1725 1725
            (L
    

  • testsuite/tests/parser/should_compile/T15279.stderr
    ... ... @@ -8,14 +8,15 @@
    8 8
        (EpAnn
    
    9 9
         (EpaSpan { T15279.hs:1:1 })
    
    10 10
         (AnnsModule
    
    11
    -     (NoEpTok)
    
    11
    +     (EpTok
    
    12
    +      (EpaSpan { <no location info> }))
    
    12 13
          (EpTok
    
    13 14
           (EpaSpan { T15279.hs:3:1-6 }))
    
    14 15
          (EpTok
    
    15 16
           (EpaSpan { T15279.hs:3:15-19 }))
    
    16 17
          ((,,)
    
    17
    -      (NoEpTok)
    
    18
    -      (NoEpTok)
    
    18
    +      (EpTok (EpaSpan { <no location info> }))
    
    19
    +      (EpTok (EpaSpan { <no location info> }))
    
    19 20
           [])
    
    20 21
          []
    
    21 22
          []
    
    ... ... @@ -100,7 +101,8 @@
    100 101
                  (EpaComments
    
    101 102
                   []))
    
    102 103
                 (HsTyVar
    
    103
    -             (NoEpTok)
    
    104
    +             (EpTok
    
    105
    +              (EpaSpan { <no location info> }))
    
    104 106
                  (NotPromoted)
    
    105 107
                  (L
    
    106 108
                   (EpAnn
    
    ... ... @@ -118,7 +120,8 @@
    118 120
                  (EpaComments
    
    119 121
                   []))
    
    120 122
                 (HsTyVar
    
    121
    -             (NoEpTok)
    
    123
    +             (EpTok
    
    124
    +              (EpaSpan { <no location info> }))
    
    122 125
                  (NotPromoted)
    
    123 126
                  (L
    
    124 127
                   (EpAnn
    
    ... ... @@ -152,7 +155,7 @@
    152 155
            ((,)
    
    153 156
             (FromSource)
    
    154 157
             (AnnList
    
    155
    -         (Nothing)
    
    158
    +         (AnnListNoLayout)
    
    156 159
              (ListNone)
    
    157 160
              []))
    
    158 161
            (L
    
    ... ... @@ -182,7 +185,8 @@
    182 185
                 (Prefix)
    
    183 186
                 (NoSrcStrict)
    
    184 187
                 (AnnFunRhs
    
    185
    -             (NoEpTok)
    
    188
    +             (EpTok
    
    189
    +              (EpaSpan { <no location info> }))
    
    186 190
                  []
    
    187 191
                  []))
    
    188 192
                (L
    
    ... ... @@ -258,7 +262,8 @@
    258 262
                 (Prefix)
    
    259 263
                 (NoSrcStrict)
    
    260 264
                 (AnnFunRhs
    
    261
    -             (NoEpTok)
    
    265
    +             (EpTok
    
    266
    +              (EpaSpan { <no location info> }))
    
    262 267
                  []
    
    263 268
                  []))
    
    264 269
                (L
    
    ... ... @@ -334,7 +339,8 @@
    334 339
                 (Prefix)
    
    335 340
                 (NoSrcStrict)
    
    336 341
                 (AnnFunRhs
    
    337
    -             (NoEpTok)
    
    342
    +             (EpTok
    
    343
    +              (EpaSpan { <no location info> }))
    
    338 344
                  []
    
    339 345
                  []))
    
    340 346
                (L
    

  • testsuite/tests/parser/should_compile/T20718.stderr
    ... ... @@ -104,7 +104,7 @@
    104 104
            ((,)
    
    105 105
             (FromSource)
    
    106 106
             (AnnList
    
    107
    -         (Nothing)
    
    107
    +         (AnnListNoLayout)
    
    108 108
              (ListNone)
    
    109 109
              []))
    
    110 110
            (L
    

  • testsuite/tests/parser/should_compile/T20846.stderr
    ... ... @@ -94,7 +94,7 @@
    94 94
            ((,)
    
    95 95
             (FromSource)
    
    96 96
             (AnnList
    
    97
    -         (Nothing)
    
    97
    +         (AnnListNoLayout)
    
    98 98
              (ListNone)
    
    99 99
              []))
    
    100 100
            (L
    

  • testsuite/tests/printer/Test20297.stdout
    ... ... @@ -70,7 +70,7 @@
    70 70
            ((,)
    
    71 71
             (FromSource)
    
    72 72
             (AnnList
    
    73
    -         (Nothing)
    
    73
    +         (AnnListNoLayout)
    
    74 74
              (ListNone)
    
    75 75
              []))
    
    76 76
            (L
    
    ... ... @@ -161,8 +161,7 @@
    161 161
                   (EpAnn
    
    162 162
                    (EpaSpan { <no location info> })
    
    163 163
                    (AnnList
    
    164
    -                (Just
    
    165
    -                 (EpaSpan { Test20297.hs:7:3-7 }))
    
    164
    +                (AnnListNoLayout)
    
    166 165
                     (ListNone)
    
    167 166
                     [])
    
    168 167
                    (EpaComments
    
    ... ... @@ -201,7 +200,7 @@
    201 200
            ((,)
    
    202 201
             (FromSource)
    
    203 202
             (AnnList
    
    204
    -         (Nothing)
    
    203
    +         (AnnListNoLayout)
    
    205 204
              (ListNone)
    
    206 205
              []))
    
    207 206
            (L
    
    ... ... @@ -286,7 +285,7 @@
    286 285
                   (EpAnn
    
    287 286
                    (EpaSpan { Test20297.hs:(10,3)-(11,26) })
    
    288 287
                    (AnnList
    
    289
    -                (Just
    
    288
    +                (AnnListLayout
    
    290 289
                      (EpaSpan { Test20297.hs:11:9-26 }))
    
    291 290
                     (ListNone)
    
    292 291
                     [])
    
    ... ... @@ -324,7 +323,7 @@
    324 323
                        ((,)
    
    325 324
                         (FromSource)
    
    326 325
                         (AnnList
    
    327
    -                     (Nothing)
    
    326
    +                     (AnnListNoLayout)
    
    328 327
                          (ListNone)
    
    329 328
                          []))
    
    330 329
                        (L
    
    ... ... @@ -396,7 +395,7 @@
    396 395
                                  ((,)
    
    397 396
                                   (Right
    
    398 397
                                    (AnnList
    
    399
    -                                (Just
    
    398
    +                                (AnnListLayout
    
    400 399
                                      (EpaSpan { Test20297.hs:11:22-26 }))
    
    401 400
                                     (ListNone)
    
    402 401
                                     []))
    
    ... ... @@ -513,7 +512,7 @@
    513 512
            ((,)
    
    514 513
             (FromSource)
    
    515 514
             (AnnList
    
    516
    -         (Nothing)
    
    515
    +         (AnnListNoLayout)
    
    517 516
              (ListNone)
    
    518 517
              []))
    
    519 518
            (L
    
    ... ... @@ -598,8 +597,7 @@
    598 597
                   (EpAnn
    
    599 598
                    (EpaSpan { <no location info> })
    
    600 599
                    (AnnList
    
    601
    -                (Just
    
    602
    -                 (EpaSpan { Test20297.ppr.hs:5:3-7 }))
    
    600
    +                (AnnListNoLayout)
    
    603 601
                     (ListNone)
    
    604 602
                     [])
    
    605 603
                    (EpaComments
    
    ... ... @@ -632,7 +630,7 @@
    632 630
            ((,)
    
    633 631
             (FromSource)
    
    634 632
             (AnnList
    
    635
    -         (Nothing)
    
    633
    +         (AnnListNoLayout)
    
    636 634
              (ListNone)
    
    637 635
              []))
    
    638 636
            (L
    
    ... ... @@ -717,7 +715,7 @@
    717 715
                   (EpAnn
    
    718 716
                    (EpaSpan { Test20297.ppr.hs:(8,3)-(9,24) })
    
    719 717
                    (AnnList
    
    720
    -                (Just
    
    718
    +                (AnnListLayout
    
    721 719
                      (EpaSpan { Test20297.ppr.hs:9:7-24 }))
    
    722 720
                     (ListNone)
    
    723 721
                     [])
    
    ... ... @@ -749,7 +747,7 @@
    749 747
                        ((,)
    
    750 748
                         (FromSource)
    
    751 749
                         (AnnList
    
    752
    -                     (Nothing)
    
    750
    +                     (AnnListNoLayout)
    
    753 751
                          (ListNone)
    
    754 752
                          []))
    
    755 753
                        (L
    
    ... ... @@ -821,7 +819,7 @@
    821 819
                                  ((,)
    
    822 820
                                   (Right
    
    823 821
                                    (AnnList
    
    824
    -                                (Just
    
    822
    +                                (AnnListLayout
    
    825 823
                                      (EpaSpan { Test20297.ppr.hs:9:20-24 }))
    
    826 824
                                     (ListNone)
    
    827 825
                                     []))
    

  • testsuite/tests/printer/Test24533.stdout
    ... ... @@ -534,7 +534,7 @@
    534 534
                 ((,)
    
    535 535
                  (FromSource)
    
    536 536
                  (AnnList
    
    537
    -              (Nothing)
    
    537
    +              (AnnListNoLayout)
    
    538 538
                   (ListNone)
    
    539 539
                   []))
    
    540 540
                 (L
    
    ... ... @@ -1121,7 +1121,7 @@
    1121 1121
                 ((,)
    
    1122 1122
                  (FromSource)
    
    1123 1123
                  (AnnList
    
    1124
    -              (Nothing)
    
    1124
    +              (AnnListNoLayout)
    
    1125 1125
                   (ListNone)
    
    1126 1126
                   []))
    
    1127 1127
                 (L
    

  • utils/check-exact/ExactPrint.hs
    ... ... @@ -231,7 +231,7 @@ setAnchorAn (L (EpAnn _ an _) a) anc ts cs = (L (EpAnn anc (setTrailing an ts) c
    231 231
          -- `debug` ("setAnchorAn: anc=" ++ showAst anc)
    
    232 232
     
    
    233 233
     setAnchorEpaL :: EpAnn AnnList -> EpaLocation -> [TrailingAnn] -> EpAnnComments -> EpAnn AnnList
    
    234
    -setAnchorEpaL (EpAnn _ an _) anc ts cs = EpAnn anc (setTrailing (an {al_anchor = Nothing}) ts) cs
    
    234
    +setAnchorEpaL (EpAnn _ an _) anc ts cs = EpAnn anc (setTrailing (an {al_layout = AnnListNoLayout}) ts) cs
    
    235 235
     
    
    236 236
     -- ---------------------------------------------------------------------
    
    237 237
     
    
    ... ... @@ -2672,8 +2672,8 @@ instance ExactPrint (HsLocalBinds GhcPs) where
    2672 2672
       exact (HsValBinds (an0, w) valbinds) = do
    
    2673 2673
         w' <- markEpToken w -- 'where'
    
    2674 2674
     
    
    2675
    -    case al_anchor $ anns an0 of
    
    2676
    -      Just anc -> do
    
    2675
    +    case al_layout $ anns an0 of
    
    2676
    +      AnnListLayout anc -> do
    
    2677 2677
             when (not $ isEmptyValBinds valbinds) $ setExtraDP (Just anc)
    
    2678 2678
           _ -> return ()
    
    2679 2679
     
    
    ... ... @@ -2684,7 +2684,7 @@ instance ExactPrint (HsLocalBinds GhcPs) where
    2684 2684
                  Nothing -> return an1
    
    2685 2685
                  Just (ss,dp) -> do
    
    2686 2686
                      setExtraDPReturn Nothing
    
    2687
    -                 return $ an1 { anns = (anns an1) { al_anchor = Just (EpaDelta ss dp []) }}
    
    2687
    +                 return $ an1 { anns = (anns an1) { al_layout = AnnListLayout (EpaDelta ss dp []) }}
    
    2688 2688
         return (HsValBinds (an2, w') valbinds')
    
    2689 2689
     
    
    2690 2690
       exact (HsIPBinds (an,w) bs) = do
    

  • utils/check-exact/Main.hs
    ... ... @@ -521,8 +521,8 @@ changeLocalDecls libdir (L l p) = do
    521 521
             let oldDecls' = captureLineSpacing oldDecls
    
    522 522
             let (VbSig o:oldBinds)  = map wrapValBind oldDecls'
    
    523 523
                 o' = setEntryDP o (DifferentLine 2 0)
    
    524
    -        let (EpAnn anc (AnnList (Just _) a b) cs) = van
    
    525
    -        let van' = (EpAnn anc (AnnList (Just (EpaDelta noSrcSpan (DifferentLine 1 4) [])) a b) cs)
    
    524
    +        let (EpAnn anc (AnnList (AnnListLayout _) a b) cs) = van
    
    525
    +        let van' = (EpAnn anc (AnnList (AnnListLayout (EpaDelta noSrcSpan (DifferentLine 1 4) [])) a b) cs)
    
    526 526
             let binds' = (HsValBinds (van',w)
    
    527 527
                               (ValBinds noExtField (VbSig sig':VbBind decl':VbSig o':oldBinds)))
    
    528 528
             return (L lm (Match an mln pats (GRHSs emptyComments rhs binds')))
    
    ... ... @@ -548,7 +548,7 @@ changeLocalDecls2 libdir (L l p) = do
    548 548
             let anc = (EpaDelta noSrcSpan (DifferentLine 1 2) [])
    
    549 549
             let anc2 = (EpaDelta noSrcSpan (DifferentLine 1 4) [])
    
    550 550
             let an = (EpAnn anc
    
    551
    -                        (AnnList (Just anc2) ListNone
    
    551
    +                        (AnnList (AnnListLayout anc2) ListNone
    
    552 552
                                      [])
    
    553 553
                             emptyComments, EpTok (EpaDelta noSrcSpan (SameLine 0) []))
    
    554 554
             let decls = [VbSig sig', VbBind decl']
    

  • utils/check-exact/Transform.hs
    ... ... @@ -1046,7 +1046,7 @@ newWhereAnnotation ww = (an, w)
    1046 1046
         WithWhere -> EpTok (EpaDelta noSrcSpan (SameLine 0) [])
    
    1047 1047
         WithoutWhere -> noEpTok
    
    1048 1048
       an = EpAnn anc
    
    1049
    -              (AnnList (Just anc2) ListNone [])
    
    1049
    +              (AnnList (AnnListLayout anc2) ListNone [])
    
    1050 1050
                   emptyComments
    
    1051 1051
     
    
    1052 1052
     -- ---------------------------------------------------------------------