Skip to content
  • sheaf's avatar
    ed375426
    Avoid redundant pattern warning in Resource.hsc · ed375426
    sheaf authored and Bodigrim's avatar Bodigrim committed
    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.
    ed375426
    Avoid redundant pattern warning in Resource.hsc
    sheaf authored and Bodigrim's avatar Bodigrim committed
    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.
Loading