Why is field `kind` of `ParseIntError` private?

Why is field kind of std::num::ParseIntError private? I would like to branch on it:

fn main() {
    let y = "1000000000000000".parse::<i32>();
    match y {
        Ok(y) => {println!("{}",y);}
        Err(e) => {
            match e.kind {
                Overflow => {},
                _ => {}
            }
        }
    }
}

I know that if you want to write your own parser, a trim/sanitizer/transformation should be run just before s.parse::<i32>(), as the syntax rules might differ. You don’t need to talk about that.

Good question, I can’t think of a good reason. You should request making it public (or adding a getter kind()) on github.

Note that this was purposefully done to avoid adding extra #[stable] surface for now. It should be able to expose this information through an enum in the future, for example.