Fix missing IntConvertible.

Replaced IntConvertible with ToPrimitive and FromPrimitive.
https://github.com/mozilla/rust/pull/9250