 /// Various helper implementations for _BridgedStoredNSError
 extension _BridgedStoredNSError {
   public var code: Code {
-    return Code(rawValue: unsafeBinaryIntegerFromInt(_nsError.code))!
+    return Code(rawValue: numericCast(_nsError.code))!
   }
 
   /// Initialize an error within this domain with the given ``code``
   /// and ``userInfo``.
   public init(_ code: Code, userInfo: [String : Any] = [:]) {
     self.init(_nsError: NSError(domain: Self.errorDomain,
-                                code: unsafeBinaryIntegerToInt(code.rawValue),
+                                code: numericCast(code.rawValue),
                                 userInfo: _stringDictToAnyHashableDict(userInfo)))
   }
 

  public var _domain: String { return Self._nsErrorDomain }
}

extension _BridgedNSError where Self.RawValue: FixedWidthInteger {
  public var _code: Int { return Int(rawValue) }

  public init?(_bridgedNSError: NSError) {

  }
}

extension CustomNSError where Self: RawRepresentable, Self.RawValue: SignedInteger {
  // The error code of Error with integral raw values is the raw value.
  public var errorCode: Int {
    return numericCast(self.rawValue)
  }
}

extension CustomNSError where Self: RawRepresentable, Self.RawValue: UnsignedInteger {
  // The error code of Error with integral raw values is the raw value.
  public var errorCode: Int {
    return numericCast(self.rawValue)
  }
}

