Skip to content

Commit c3f0c94

Browse files
committed
Add very useful documentation
1 parent b60efc1 commit c3f0c94

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libcore/num/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4771,16 +4771,24 @@ pub struct ParseIntError {
47714771
pub kind: IntErrorKind,
47724772
}
47734773

4774+
/// Enum to store the various types of errors that can cause parsing an integer to fail.
47744775
#[unstable(feature = "int_error_matching",
47754776
reason = "it can be useful to match errors when making error messages \
47764777
for integer parsing",
47774778
issue = "22639")]
47784779
#[derive(Debug, Clone, PartialEq, Eq)]
47794780
#[non_exhaustive]
47804781
pub enum IntErrorKind {
4782+
/// Value being parsed is empty.
4783+
/// Among other causes, this variant will be constructed when parsing an empty string.
47814784
Empty,
4785+
/// Contains an invalid digit.
4786+
/// Among other causes, this variant will be constructed when parsing a string that
4787+
/// contains a letter.
47824788
InvalidDigit,
4789+
/// Integer is too small to store in target integer type.
47834790
Overflow,
4791+
/// Integer is too large to store in target integer type.
47844792
Underflow,
47854793
}
47864794

0 commit comments

Comments
 (0)