diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-06-26 21:06:01 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-06-27 14:58:14 -0400 |
commit | 469126b3cef2936d9831283a77d54330d0ff1ba8 (patch) | |
tree | 42a8881d5d64f869f28baca4014b88cea3a1586b | |
parent | 43bbf4b22190dd01bf5261b24bd3ef41da6a6407 (diff) | |
download | haskell-469126b3cef2936d9831283a77d54330d0ff1ba8.tar.gz |
Revert "Make reallyUnsafePtrEquality# levity-polymorphic"
This reverts commit d1f59540e8b7be96b55ab4b286539a70bc75416c.
This commit breaks the build of unordered-containers
```
[3 of 9] Compiling Data.HashMap.Internal.Array ( Data/HashMap/Internal/Array.hs, dist/build/Data/HashMap/Internal/Array.o, dist/build/Data/HashMap/Internal/Array.dyn_o )
*** Parser [Data.HashMap.Internal.Array]:
Parser [Data.HashMap.Internal.Array]: alloc=21043544 time=13.621
*** Renamer/typechecker [Data.HashMap.Internal.Array]:
Renamer/typechecker [Data.HashMap.Internal.Array]: alloc=151218672 time=187.083
*** Desugar [Data.HashMap.Internal.Array]:
ghc: panic! (the 'impossible' happened)
GHC version 9.3.20210625:
expectJust splitFunTy
CallStack (from HasCallStack):
error, called at compiler/GHC/Data/Maybe.hs:68:27 in ghc:GHC.Data.Maybe
expectJust, called at compiler/GHC/Core/Type.hs:1247:14 in ghc:GHC.Core.Type
```
Revert containers submodule update
-rw-r--r-- | compiler/GHC/Builtin/primops.txt.pp | 2 | ||||
-rw-r--r-- | docs/users_guide/9.4.1-notes.rst | 7 | ||||
m--------- | libraries/containers | 0 | ||||
-rw-r--r-- | libraries/ghc-prim/changelog.md | 9 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/LevPolyPtrEquality1.hs | 25 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/LevPolyPtrEquality1.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/LevPolyPtrEquality2.hs | 26 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/LevPolyPtrEquality2.stdout | 3 | ||||
-rw-r--r-- | testsuite/tests/primops/should_run/all.T | 3 |
9 files changed, 1 insertions, 76 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp index 145aed43a8..672b831ac7 100644 --- a/compiler/GHC/Builtin/primops.txt.pp +++ b/compiler/GHC/Builtin/primops.txt.pp @@ -3058,7 +3058,7 @@ section "Unsafe pointer equality" ------------------------------------------------------------------------ primop ReallyUnsafePtrEqualityOp "reallyUnsafePtrEquality#" GenPrimOp - v -> v -> Int# + a -> a -> Int# { Returns {\texttt 1\#} if the given pointers are equal and {\texttt 0\#} otherwise. } with can_fail = True -- See Note [reallyUnsafePtrEquality#] diff --git a/docs/users_guide/9.4.1-notes.rst b/docs/users_guide/9.4.1-notes.rst index 04b44dd0e6..68417b0a6b 100644 --- a/docs/users_guide/9.4.1-notes.rst +++ b/docs/users_guide/9.4.1-notes.rst @@ -41,13 +41,6 @@ Version 9.4.1 raise# :: forall (a :: Type) {r :: RuntimeRep} (b :: TYPE r). a -> b -- ``GHC.Exts.reallyUnsafePtrEquality#`` is now levity-polymorphic: :: - - reallyUnsafePtrEquality# :: forall {l :: Levity} (a :: TYPE (BoxedRep l)). a -> a -> Int# - - This means that ``GHC.Exts.reallyUnsafePtrEquality#`` now works on primitive arrays, - such as ``GHC.Exts.Array#`` and ``GHC.Exts.ByteArray#``. - ``ghc`` library ~~~~~~~~~~~~~~~ diff --git a/libraries/containers b/libraries/containers -Subproject f90e38cb170dcd68de8660dfd9d0e879921acc2 +Subproject 7fb91ca53b1aca7c077b36a0c1f8f785d177da3 diff --git a/libraries/ghc-prim/changelog.md b/libraries/ghc-prim/changelog.md index ec8df7904b..122856346f 100644 --- a/libraries/ghc-prim/changelog.md +++ b/libraries/ghc-prim/changelog.md @@ -39,15 +39,6 @@ raise# :: forall (a :: Type) {r :: RuntimeRep} (b :: TYPE r). a -> b ``` -- `reallyUnsafePtrEquality#` is now levity-polymorphic: - - ``` - reallyUnsafePtrEquality# :: forall {l :: Levity} (a :: TYPE (BoxedRep l)). a -> a -> Int# - ``` - - This means that `reallyUnsafePtrEquality#` now works on primitive arrays, - such as `Array#` and `ByteArray#`. - ## 0.8.0 (edit as necessary) diff --git a/testsuite/tests/primops/should_run/LevPolyPtrEquality1.hs b/testsuite/tests/primops/should_run/LevPolyPtrEquality1.hs deleted file mode 100644 index bbd4819c7d..0000000000 --- a/testsuite/tests/primops/should_run/LevPolyPtrEquality1.hs +++ /dev/null @@ -1,25 +0,0 @@ -{-# LANGUAGE BlockArguments #-} -{-# LANGUAGE MagicHash #-} -{-# LANGUAGE UnboxedTuples #-} - -module Main where - -import GHC.Exts -import GHC.IO - -data ByteArray = ByteArray ByteArray# - -mkTwoByteArrays :: IO ( ByteArray, ByteArray ) -mkTwoByteArrays = IO \ s1 -> case newPinnedByteArray# 32# s1 of - (# s2, mba1 #) -> case unsafeFreezeByteArray# mba1 s2 of - (# s3, ba1 #) -> case newPinnedByteArray# 32# s3 of - (# s4, mba2 #) -> case unsafeFreezeByteArray# mba2 s4 of - (# s5, ba2 #) -> (# s5, ( ByteArray ba1, ByteArray ba2 ) #) - -main :: IO () -main = do - ( ByteArray ba1, ByteArray ba2 ) <- mkTwoByteArrays - putStr "eq 1 2: " - print $ isTrue# ( reallyUnsafePtrEquality# ba1 ba2 ) - putStr "eq 1 1: " - print $ isTrue# ( reallyUnsafePtrEquality# ba1 ba1 ) diff --git a/testsuite/tests/primops/should_run/LevPolyPtrEquality1.stdout b/testsuite/tests/primops/should_run/LevPolyPtrEquality1.stdout deleted file mode 100644 index aaf2e46dcf..0000000000 --- a/testsuite/tests/primops/should_run/LevPolyPtrEquality1.stdout +++ /dev/null @@ -1,2 +0,0 @@ -eq 1 2: False -eq 1 1: True diff --git a/testsuite/tests/primops/should_run/LevPolyPtrEquality2.hs b/testsuite/tests/primops/should_run/LevPolyPtrEquality2.hs deleted file mode 100644 index 39be43ed29..0000000000 --- a/testsuite/tests/primops/should_run/LevPolyPtrEquality2.hs +++ /dev/null @@ -1,26 +0,0 @@ -{-# LANGUAGE GADTs #-} -{-# LANGUAGE MagicHash #-} -{-# LANGUAGE UnliftedDatatypes #-} - -module Main where - -import GHC.Exts -import GHC.Types - -data PEither a b :: UnliftedType where - PLeft :: a -> PEither a b - PRight :: b -> PEither a b - -main :: IO () -main = do - let - a, b, c :: PEither Bool Int - a = PRight 1 - b = case a of { PLeft a -> PLeft (not a) ; r -> r } - c = PLeft False - putStr "eq a b: " - print $ isTrue# ( reallyUnsafePtrEquality# a b ) - putStr "eq a c: " - print $ isTrue# ( reallyUnsafePtrEquality# a c ) - putStr "eq b c: " - print $ isTrue# ( reallyUnsafePtrEquality# b c ) diff --git a/testsuite/tests/primops/should_run/LevPolyPtrEquality2.stdout b/testsuite/tests/primops/should_run/LevPolyPtrEquality2.stdout deleted file mode 100644 index dfc7ac9454..0000000000 --- a/testsuite/tests/primops/should_run/LevPolyPtrEquality2.stdout +++ /dev/null @@ -1,3 +0,0 @@ -eq a b: True -eq a c: False -eq b c: False diff --git a/testsuite/tests/primops/should_run/all.T b/testsuite/tests/primops/should_run/all.T index ef046f34ae..cad58c1909 100644 --- a/testsuite/tests/primops/should_run/all.T +++ b/testsuite/tests/primops/should_run/all.T @@ -38,6 +38,3 @@ test('T14664', normal, compile_and_run, ['']) test('CStringLength', normal, compile_and_run, ['-O2']) test('NonNativeSwitch', normal, compile_and_run, ['-O2']) test('Sized', normal, compile_and_run, ['']) - -test('LevPolyPtrEquality1', normal, compile_and_run, ['']) -test('LevPolyPtrEquality2', normal, compile_and_run, ['']) |