diff options
-rw-r--r-- | libraries/ghc-prim/GHC/Prim/PtrEq.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/unsafeLibs/T21433.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/unsafeLibs/T21433.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/safeHaskell/unsafeLibs/all.T | 1 |
4 files changed, 14 insertions, 1 deletions
diff --git a/libraries/ghc-prim/GHC/Prim/PtrEq.hs b/libraries/ghc-prim/GHC/Prim/PtrEq.hs index ba58857868..34285a879a 100644 --- a/libraries/ghc-prim/GHC/Prim/PtrEq.hs +++ b/libraries/ghc-prim/GHC/Prim/PtrEq.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE Trustworthy #-} +{-# LANGUAGE Unsafe #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE MagicHash #-} diff --git a/testsuite/tests/safeHaskell/unsafeLibs/T21433.hs b/testsuite/tests/safeHaskell/unsafeLibs/T21433.hs new file mode 100644 index 0000000000..a5ebd98b92 --- /dev/null +++ b/testsuite/tests/safeHaskell/unsafeLibs/T21433.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE Haskell2010 #-} +{-# LANGUAGE Safe #-} + +module T21433 where + +import GHC.Prim.PtrEq + +f x y = reallyUnsafePtrEquality x y diff --git a/testsuite/tests/safeHaskell/unsafeLibs/T21433.stderr b/testsuite/tests/safeHaskell/unsafeLibs/T21433.stderr new file mode 100644 index 0000000000..1604b39c9b --- /dev/null +++ b/testsuite/tests/safeHaskell/unsafeLibs/T21433.stderr @@ -0,0 +1,4 @@ + +T21433.hs:6:1: error: + GHC.Prim.PtrEq: Can't be safely imported! + The module itself isn't safe. diff --git a/testsuite/tests/safeHaskell/unsafeLibs/all.T b/testsuite/tests/safeHaskell/unsafeLibs/all.T index 8bcda5f402..774143e4a6 100644 --- a/testsuite/tests/safeHaskell/unsafeLibs/all.T +++ b/testsuite/tests/safeHaskell/unsafeLibs/all.T @@ -23,6 +23,7 @@ test('BadImport06', normal, compile_fail, ['']) test('BadImport07', normal, compile_fail, ['']) test('BadImport08', normal, compile_fail, ['']) test('BadImport09', normal, compile_fail, ['']) +test('T21433', normal, compile_fail, ['']) # check safe modules are marked safe test('GoodImport01', normal, compile, ['']) |