[Git][ghc/ghc][wip/T25989] Don't emit unprintable characters when printing Uniques

Ben Gamari pushed to branch wip/T25989 at Glasgow Haskell Compiler / GHC Commits: d27adfc6 by Ben Gamari at 2025-04-24T13:40:00-04:00 Don't emit unprintable characters when printing Uniques When faced with an unprintable tag we now instead print the codepoint number. Fixes #25989. (cherry picked from commit e832b1fadee66e8d6dd7b019368974756f8f8c46) - - - - - 1 changed file: - compiler/GHC/Types/Unique.hs Changes: ===================================== compiler/GHC/Types/Unique.hs ===================================== @@ -302,8 +302,12 @@ instance Uniquable Unique where showUnique :: Unique -> String showUnique uniq - = case unpkUnique uniq of - (tag, u) -> tag : w64ToBase62 u + = tagStr ++ w64ToBase62 u + where + (tag, u) = unpkUnique uniq + tagStr + | tag < 'A' || tag > 'z' = show (ord tag) ++ "_" + | otherwise = [tag] pprUniqueAlways :: IsLine doc => Unique -> doc -- The "always" means regardless of -dsuppress-uniques View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d27adfc62710035204a30795cd092eff... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d27adfc62710035204a30795cd092eff... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Ben Gamari (@bgamari)