about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/num/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index a7b6d719c6a..e297050f1f0 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -4768,8 +4768,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
 #[derive(Debug, Clone, PartialEq, Eq)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct ParseIntError {
-    /// Stores the cause of parsing an integer failing
-    pub kind: IntErrorKind,
+    kind: IntErrorKind,
 }
 
 /// Enum to store the various types of errors that can cause parsing an integer to fail.
@@ -4796,6 +4795,10 @@ pub enum IntErrorKind {
 }
 
 impl ParseIntError {
+    /// Outputs the detailed cause of parsing an integer failing.
+    pub fn kind(self) -> IntErrorKind {
+        self.kind
+    }
     #[unstable(feature = "int_error_internals",
                reason = "available through Error trait and this method should \
                          not be exposed publicly",