Skip to content

Commit edf9335

Browse files
committed
std: Hide some internal functions more aggressively
* Add `#[doc(hidden)]` * Rename away from `Error::description`
1 parent 252ef28 commit edf9335

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/libcore/num/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,8 @@ impl ParseIntError {
15141514
#[unstable(feature = "int_error_internals",
15151515
reason = "available through Error trait and this method should \
15161516
not be exposed publicly")]
1517-
pub fn description(&self) -> &str {
1517+
#[doc(hidden)]
1518+
pub fn __description(&self) -> &str {
15181519
match self.kind {
15191520
IntErrorKind::Empty => "cannot parse integer from empty string",
15201521
IntErrorKind::InvalidDigit => "invalid digit found in string",
@@ -1527,7 +1528,7 @@ impl ParseIntError {
15271528
#[stable(feature = "rust1", since = "1.0.0")]
15281529
impl fmt::Display for ParseIntError {
15291530
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1530-
self.description().fmt(f)
1531+
self.__description().fmt(f)
15311532
}
15321533
}
15331534

@@ -1544,6 +1545,7 @@ pub struct ParseFloatError {
15441545
#[derive(Debug, Clone, PartialEq)]
15451546
#[unstable(feature = "float_error_internals",
15461547
reason = "should not be exposed publicly")]
1548+
#[doc(hidden)]
15471549
pub enum FloatErrorKind {
15481550
Empty,
15491551
Invalid,

src/libstd/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl Error for str::Utf8Error {
140140
#[stable(feature = "rust1", since = "1.0.0")]
141141
impl Error for num::ParseIntError {
142142
fn description(&self) -> &str {
143-
self.description()
143+
self.__description()
144144
}
145145
}
146146

0 commit comments

Comments
 (0)