mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Auto merge of #106677 - tbu-:pr_less_doc_hidden_pub, r=scottmcm
Remove a couple of `#[doc(hidden)] pub fn` and their `#[feature]` gates
This commit is contained in:
commit
d094016128
@ -991,12 +991,6 @@ impl IntoStringError {
|
||||
pub fn utf8_error(&self) -> Utf8Error {
|
||||
self.error
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[unstable(feature = "cstr_internals", issue = "none")]
|
||||
pub fn __source(&self) -> &Utf8Error {
|
||||
&self.error
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoStringError {
|
||||
@ -1141,6 +1135,6 @@ impl core::error::Error for IntoStringError {
|
||||
}
|
||||
|
||||
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
|
||||
Some(self.__source())
|
||||
Some(&self.error)
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,8 @@ pub struct TryFromSliceError(());
|
||||
impl fmt::Display for TryFromSliceError {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Display::fmt(self.__description(), f)
|
||||
#[allow(deprecated)]
|
||||
self.description().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,20 +140,6 @@ impl fmt::Display for TryFromSliceError {
|
||||
impl Error for TryFromSliceError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFromSliceError {
|
||||
#[unstable(
|
||||
feature = "array_error_internals",
|
||||
reason = "available through Error trait and this method should not \
|
||||
be exposed publicly",
|
||||
issue = "none"
|
||||
)]
|
||||
#[inline]
|
||||
#[doc(hidden)]
|
||||
pub fn __description(&self) -> &str {
|
||||
"could not convert slice to array"
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
use crate::char::TryFromCharError;
|
||||
use crate::convert::TryFrom;
|
||||
use crate::error::Error;
|
||||
use crate::fmt;
|
||||
use crate::mem::transmute;
|
||||
use crate::str::FromStr;
|
||||
@ -150,31 +151,28 @@ pub struct ParseCharError {
|
||||
kind: CharErrorKind,
|
||||
}
|
||||
|
||||
impl ParseCharError {
|
||||
#[unstable(
|
||||
feature = "char_error_internals",
|
||||
reason = "this method should not be available publicly",
|
||||
issue = "none"
|
||||
)]
|
||||
#[doc(hidden)]
|
||||
pub fn __description(&self) -> &str {
|
||||
match self.kind {
|
||||
CharErrorKind::EmptyString => "cannot parse char from empty string",
|
||||
CharErrorKind::TooManyChars => "too many characters in string",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
enum CharErrorKind {
|
||||
EmptyString,
|
||||
TooManyChars,
|
||||
}
|
||||
|
||||
#[stable(feature = "char_from_str", since = "1.20.0")]
|
||||
impl Error for ParseCharError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
match self.kind {
|
||||
CharErrorKind::EmptyString => "cannot parse char from empty string",
|
||||
CharErrorKind::TooManyChars => "too many characters in string",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "char_from_str", since = "1.20.0")]
|
||||
impl fmt::Display for ParseCharError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(f)
|
||||
#[allow(deprecated)]
|
||||
self.description().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -486,25 +486,9 @@ impl Error for crate::char::CharTryFromError {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "char_from_str", since = "1.20.0")]
|
||||
impl Error for crate::char::ParseCharError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "duration_checked_float", since = "1.66.0")]
|
||||
impl Error for crate::time::TryFromFloatSecsError {}
|
||||
|
||||
#[stable(feature = "frombyteswithnulerror_impls", since = "1.17.0")]
|
||||
impl Error for crate::ffi::FromBytesWithNulError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "cstr_from_bytes_until_nul", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl Error for crate::ffi::FromBytesUntilNulError {}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
use crate::cmp::Ordering;
|
||||
use crate::error::Error;
|
||||
use crate::ffi::c_char;
|
||||
use crate::fmt;
|
||||
use crate::intrinsics;
|
||||
@ -129,10 +130,12 @@ impl FromBytesWithNulError {
|
||||
const fn not_nul_terminated() -> FromBytesWithNulError {
|
||||
FromBytesWithNulError { kind: FromBytesWithNulErrorKind::NotNulTerminated }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[unstable(feature = "cstr_internals", issue = "none")]
|
||||
pub fn __description(&self) -> &str {
|
||||
#[stable(feature = "frombyteswithnulerror_impls", since = "1.17.0")]
|
||||
impl Error for FromBytesWithNulError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
match self.kind {
|
||||
FromBytesWithNulErrorKind::InteriorNul(..) => {
|
||||
"data provided contains an interior nul byte"
|
||||
@ -180,7 +183,7 @@ impl Default for &CStr {
|
||||
impl fmt::Display for FromBytesWithNulError {
|
||||
#[allow(deprecated, deprecated_in_future)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(self.__description())?;
|
||||
f.write_str(self.description())?;
|
||||
if let FromBytesWithNulErrorKind::InteriorNul(pos) = self.kind {
|
||||
write!(f, " at byte pos {pos}")?;
|
||||
}
|
||||
|
@ -75,6 +75,7 @@
|
||||
issue = "none"
|
||||
)]
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::fmt;
|
||||
use crate::str::FromStr;
|
||||
|
||||
@ -182,15 +183,10 @@ enum FloatErrorKind {
|
||||
Invalid,
|
||||
}
|
||||
|
||||
impl ParseFloatError {
|
||||
#[unstable(
|
||||
feature = "int_error_internals",
|
||||
reason = "available through Error trait and this method should \
|
||||
not be exposed publicly",
|
||||
issue = "none"
|
||||
)]
|
||||
#[doc(hidden)]
|
||||
pub fn __description(&self) -> &str {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Error for ParseFloatError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
match self.kind {
|
||||
FloatErrorKind::Empty => "cannot parse float from empty string",
|
||||
FloatErrorKind::Invalid => "invalid float literal",
|
||||
@ -201,7 +197,8 @@ impl ParseFloatError {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for ParseFloatError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(f)
|
||||
#[allow(deprecated)]
|
||||
self.description().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,23 +9,19 @@ use crate::fmt;
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub struct TryFromIntError(pub(crate) ());
|
||||
|
||||
impl TryFromIntError {
|
||||
#[unstable(
|
||||
feature = "int_error_internals",
|
||||
reason = "available through Error trait and this method should \
|
||||
not be exposed publicly",
|
||||
issue = "none"
|
||||
)]
|
||||
#[doc(hidden)]
|
||||
pub fn __description(&self) -> &str {
|
||||
"out of range integral type conversion attempted"
|
||||
#[stable(feature = "try_from", since = "1.34.0")]
|
||||
impl fmt::Display for TryFromIntError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
#[allow(deprecated)]
|
||||
self.description().fmt(fmt)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "try_from", since = "1.34.0")]
|
||||
impl fmt::Display for TryFromIntError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(fmt)
|
||||
impl Error for TryFromIntError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
"out of range integral type conversion attempted"
|
||||
}
|
||||
}
|
||||
|
||||
@ -121,14 +117,20 @@ impl ParseIntError {
|
||||
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",
|
||||
issue = "none"
|
||||
)]
|
||||
#[doc(hidden)]
|
||||
pub fn __description(&self) -> &str {
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for ParseIntError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
#[allow(deprecated)]
|
||||
self.description().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Error for ParseIntError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
match self.kind {
|
||||
IntErrorKind::Empty => "cannot parse integer from empty string",
|
||||
IntErrorKind::InvalidDigit => "invalid digit found in string",
|
||||
@ -138,26 +140,3 @@ impl ParseIntError {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for ParseIntError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Error for ParseIntError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "try_from", since = "1.34.0")]
|
||||
impl Error for TryFromIntError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
}
|
||||
}
|
||||
|
@ -9,9 +9,6 @@ use crate::mem;
|
||||
use crate::ops::{Add, Mul, Sub};
|
||||
use crate::str::FromStr;
|
||||
|
||||
#[cfg(not(no_fp_fmt_parse))]
|
||||
use crate::error::Error;
|
||||
|
||||
// Used because the `?` operator is not allowed in a const context.
|
||||
macro_rules! try_opt {
|
||||
($e:expr) => {
|
||||
@ -61,15 +58,6 @@ pub use wrapping::Wrapping;
|
||||
#[cfg(not(no_fp_fmt_parse))]
|
||||
pub use dec2flt::ParseFloatError;
|
||||
|
||||
#[cfg(not(no_fp_fmt_parse))]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Error for ParseFloatError {
|
||||
#[allow(deprecated)]
|
||||
fn description(&self) -> &str {
|
||||
self.__description()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub use error::ParseIntError;
|
||||
|
||||
|
@ -273,12 +273,9 @@
|
||||
#![feature(utf8_chunks)]
|
||||
//
|
||||
// Library features (core):
|
||||
#![feature(array_error_internals)]
|
||||
#![feature(atomic_mut_ptr)]
|
||||
#![feature(char_error_internals)]
|
||||
#![feature(char_internals)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(cstr_internals)]
|
||||
#![feature(duration_constants)]
|
||||
#![feature(error_generic_member_access)]
|
||||
#![feature(error_in_core)]
|
||||
@ -290,7 +287,6 @@
|
||||
#![feature(float_next_up_down)]
|
||||
#![feature(hasher_prefixfree_extras)]
|
||||
#![feature(hashmap_internals)]
|
||||
#![feature(int_error_internals)]
|
||||
#![feature(is_some_and)]
|
||||
#![feature(maybe_uninit_slice)]
|
||||
#![feature(maybe_uninit_write_slice)]
|
||||
|
@ -1,5 +0,0 @@
|
||||
# `char_error_internals`
|
||||
|
||||
This feature is internal to the Rust compiler and is not intended for general use.
|
||||
|
||||
------------------------
|
@ -1,5 +0,0 @@
|
||||
# `int_error_internals`
|
||||
|
||||
This feature is internal to the Rust compiler and is not intended for general use.
|
||||
|
||||
------------------------
|
Loading…
Reference in New Issue
Block a user