[Git][ghc/ghc][wip/spj-reinstallable-base2] tweaks
Rodrigo Mesquita pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC Commits: 6558f6c0 by Rodrigo Mesquita at 2026-05-11T16:31:36+01:00 tweaks - - - - - 4 changed files: - compiler/GHC/Builtin/WiredIn/Prim.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/Tc/Module.hs Changes: ===================================== compiler/GHC/Builtin/WiredIn/Prim.hs ===================================== @@ -879,7 +879,7 @@ generator never has to manipulate a value of type 'a :: TYPE rr'. * error :: forall (rr::RuntimeRep) (a::TYPE rr). String -> a Code generator never has to manipulate the return value. -* unsafeCoerce#, defined in Desugar.mkUnsafeCoercePair: +* unsafeCoerce#, defined in Desugar.mkUnsafeCoercePrimPair: Always inlined to be a no-op unsafeCoerce# :: forall (r1 :: RuntimeRep) (r2 :: RuntimeRep) (a :: TYPE r1) (b :: TYPE r2). ===================================== compiler/GHC/HsToCore.hs ===================================== @@ -599,6 +599,8 @@ even if we need pure access; note that wiring-in an Id requires all entities used in its definition *also* to be wired in, transitively and recursively. This can be a huge pain. The little trick documented here allows us to have the best of both worlds. +(This has been improved with the new known-occ/keys work. + See Note [Overview of known entities] in GHC.Builtin.) Motivating example: unsafeCoerce#. See [Wiring in unsafeCoerce#] for the details. ===================================== compiler/GHC/HsToCore/Monad.hs ===================================== @@ -616,7 +616,7 @@ dsLookupKnownOccId uniq = tyThingId <$> dsLookupKnownOccThing uniq -------------------------------------- -- Lookups for known-key things -dsLookupKnownKeyName :: KnownKey -> DsM Name +dsLookupKnownKeyName :: HasDebugCallStack => KnownKey -> DsM Name dsLookupKnownKeyName uniq = do { rebindable_src <- dsGetKnownKeySource ; dsToIfL $ ===================================== compiler/GHC/Tc/Module.hs ===================================== @@ -2566,7 +2566,7 @@ tcGhciStmts stmts -- We use Any rather than a dummy type such as () because of -- the rules of unsafeCoerce#; see Unsafe/Coerce.hs for the details. - ; AnId unsafe_coerce_id <- tcLookupKnownKeyGlobal unsafeCoercePrimIdKey + ; unsafe_coerce_id <- tcLookupKnownKeyId unsafeCoercePrimIdKey -- We use unsafeCoerce# here because of (U11) in -- Note [Implementing unsafeCoerce] in base:Unsafe.Coerce View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6558f6c055728d16a246cca8b2b16714... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6558f6c055728d16a246cca8b2b16714... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Rodrigo Mesquita (@alt-romes)