diff options
| author | Ethan Brierley <ethanboxx@gmail.com> | 2018-11-06 08:34:30 +0000 |
|---|---|---|
| committer | Ethan Brierley <ethanboxx@gmail.com> | 2018-11-06 08:34:30 +0000 |
| commit | c3f0c9419e39a52758f99c156c41969341ff59da (patch) | |
| tree | 710bbf3c6e155030e95bdd931225ba8a5c367f0b | |
| parent | b60efc1574fdba2504fdc903990a00893fd6d295 (diff) | |
| download | rust-c3f0c9419e39a52758f99c156c41969341ff59da.tar.gz rust-c3f0c9419e39a52758f99c156c41969341ff59da.zip | |
Add very useful documentation
| -rw-r--r-- | src/libcore/num/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 7657b45f024..b8f291f6d05 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -4771,6 +4771,7 @@ pub struct ParseIntError { pub kind: IntErrorKind, } +/// Enum to store the various types of errors that can cause parsing an integer to fail. #[unstable(feature = "int_error_matching", reason = "it can be useful to match errors when making error messages \ for integer parsing", @@ -4778,9 +4779,16 @@ pub struct ParseIntError { #[derive(Debug, Clone, PartialEq, Eq)] #[non_exhaustive] pub enum IntErrorKind { + /// Value being parsed is empty. + /// Among other causes, this variant will be constructed when parsing an empty string. Empty, + /// Contains an invalid digit. + /// Among other causes, this variant will be constructed when parsing a string that + /// contains a letter. InvalidDigit, + /// Integer is too small to store in target integer type. Overflow, + /// Integer is too large to store in target integer type. Underflow, } |
