Avoid redundant pattern warning in Resource.hsc
With GHC MR !8478, GHC is able to spot a redundant pattern match when RLIM_SAVED_CUR == RLIM_SAVED_MAX, which it wasn't able to detect before. So we use considerAccessible to avoid a pattern match check. This unfortunately means we must change the SafeHaskell status of that module to TrustWorth, as considerAccessible is from GHC.Exts, which isn't safe. Alternatives: - we can't perform the equality test RLIM_SAVED_CUR == RLIM_SAVED_MAX using CPP macros, because one of the values might expand out to have casts; - turning off pattern match warnings impacts warnings across the whole module, instead of the single affected function, - adding a dummy equation such as "id True" to the first pattern match would work, but seems more ad-hoc.
Please register or sign in to comment