Changes corresponding to ghc!12089 (merged)
Don't merge this MR until other MR is merged. See instructions in other MR for more details.