Skip to content

Commit d627df0

Browse files
committed
fix: add Safe Haskell pragmas to new ghc-internal modules
When modules from ghc-heap were moved to ghc-internal, they were missing Safe Haskell language pragmas. This caused ghc-internal to lose its trusted package status, resulting in testsuite failures for Safe Haskell tests (BadImport, Dep, ImpSafe, safePkg01, etc.). Add appropriate pragmas based on module content: Unsafe (uses FFI, MagicHash, Ptr, Storable): - GHC.Internal.Heap.Closures - GHC.Internal.Heap.InfoTable - GHC.Internal.Heap.InfoTable.Types - GHC.Internal.Heap.InfoTableProf - GHC.Internal.Stack.CloneStack - GHC.Internal.Stack.Decode Trustworthy (no unsafe features): - GHC.Internal.Heap.Constants - GHC.Internal.Heap.ProfInfo.Types - GHC.Internal.Stack.Annotation - GHC.Internal.Stack.Constants - GHC.Internal.Stack.ConstantsProf
1 parent c1565da commit d627df0

File tree

11 files changed

+13
-0
lines changed

11 files changed

+13
-0
lines changed

libraries/ghc-internal/src/GHC/Internal/Heap/Closures.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{-# LANGUAGE ForeignFunctionInterface #-}
33
{-# LANGUAGE GHCForeignImportPrim #-}
44
{-# LANGUAGE MagicHash #-}
5+
{-# LANGUAGE Unsafe #-}
56
{-# LANGUAGE RecordWildCards #-}
67
{-# LANGUAGE UnliftedFFITypes #-}
78
{-# LANGUAGE DeriveGeneric #-}

libraries/ghc-internal/src/GHC/Internal/Heap/Constants.hsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE Trustworthy #-}
23

34
module GHC.Internal.Heap.Constants
45
( wORD_SIZE

libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable.hsc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{-# LANGUAGE Unsafe #-}
2+
13
module GHC.Internal.Heap.InfoTable
24
( module GHC.Internal.Heap.InfoTable.Types
35
, itblSize

libraries/ghc-internal/src/GHC/Internal/Heap/InfoTable/Types.hsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE DeriveGeneric #-}
22
{-# LANGUAGE DerivingStrategies #-}
33
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4+
{-# LANGUAGE Unsafe #-}
45

56
module GHC.Internal.Heap.InfoTable.Types
67
( StgInfoTable(..)

libraries/ghc-internal/src/GHC/Internal/Heap/InfoTableProf.hsc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{-# LANGUAGE Unsafe #-}
2+
13
module GHC.Internal.Heap.InfoTableProf
24
( module GHC.Internal.Heap.InfoTable.Types
35
, itblSize

libraries/ghc-internal/src/GHC/Internal/Heap/ProfInfo/Types.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{-# LANGUAGE DeriveGeneric #-}
2+
{-# LANGUAGE Trustworthy #-}
23

34
module GHC.Internal.Heap.ProfInfo.Types where
45

libraries/ghc-internal/src/GHC/Internal/Stack/Annotation.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE GADTs #-}
22
{-# LANGUAGE ScopedTypeVariables #-}
3+
{-# LANGUAGE Trustworthy #-}
34
module GHC.Internal.Stack.Annotation where
45

56
import GHC.Internal.Base

libraries/ghc-internal/src/GHC/Internal/Stack/CloneStack.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{-# LANGUAGE UnboxedTuples #-}
44
{-# LANGUAGE UnliftedFFITypes#-}
55
{-# LANGUAGE GHCForeignImportPrim #-}
6+
{-# LANGUAGE Unsafe #-}
67

78
-- |
89
-- This module exposes an interface for capturing the state of a thread's

libraries/ghc-internal/src/GHC/Internal/Stack/Constants.hsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE DerivingStrategies #-}
33
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4+
{-# LANGUAGE Trustworthy #-}
45
module GHC.Internal.Stack.Constants where
56

67
import GHC.Internal.Base

libraries/ghc-internal/src/GHC/Internal/Stack/ConstantsProf.hsc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE DerivingStrategies #-}
33
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
4+
{-# LANGUAGE Trustworthy #-}
45
module GHC.Internal.Stack.ConstantsProf where
56

67
import GHC.Internal.Base

0 commit comments

Comments
 (0)