Rollup merge of #60098 - Centril:libcore-deny-more, r=varkor
libcore: deny `elided_lifetimes_in_paths` r? @varkor
This commit is contained in:
commit
3ad9fcccbb
@ -338,7 +338,7 @@ pub struct LayoutErr {
|
||||
// (we need this for downstream impl of trait Error)
|
||||
#[stable(feature = "alloc_layout", since = "1.28.0")]
|
||||
impl fmt::Display for LayoutErr {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str("invalid parameters to Layout::from_size_align")
|
||||
}
|
||||
}
|
||||
@ -354,7 +354,7 @@ pub struct AllocErr;
|
||||
// (we need this for downstream impl of trait Error)
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
impl fmt::Display for AllocErr {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str("memory allocation failed")
|
||||
}
|
||||
}
|
||||
@ -376,7 +376,7 @@ impl CannotReallocInPlace {
|
||||
// (we need this for downstream impl of trait Error)
|
||||
#[unstable(feature = "allocator_api", issue = "32838")]
|
||||
impl fmt::Display for CannotReallocInPlace {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}", self.description())
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ impl<T: 'static + ?Sized > Any for T {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Debug for dyn Any {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("Any")
|
||||
}
|
||||
}
|
||||
@ -117,14 +117,14 @@ impl fmt::Debug for dyn Any {
|
||||
// dispatch works with upcasting.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Debug for dyn Any + Send {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("Any")
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "any_send_sync_methods", since = "1.28.0")]
|
||||
impl fmt::Debug for dyn Any + Send + Sync {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("Any")
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ pub struct TryFromSliceError(());
|
||||
|
||||
impl fmt::Display for TryFromSliceError {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Display::fmt(self.__description(), f)
|
||||
}
|
||||
}
|
||||
@ -184,7 +184,7 @@ macro_rules! array_impls {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: fmt::Debug> fmt::Debug for [T; $N] {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Debug::fmt(&&self[..], f)
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ impl FusedIterator for EscapeDefault {}
|
||||
|
||||
#[stable(feature = "std_debug", since = "1.16.0")]
|
||||
impl fmt::Debug for EscapeDefault {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("EscapeDefault { .. }")
|
||||
}
|
||||
}
|
||||
|
@ -577,14 +577,14 @@ pub struct BorrowError {
|
||||
|
||||
#[stable(feature = "try_borrow", since = "1.13.0")]
|
||||
impl Debug for BorrowError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("BorrowError").finish()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "try_borrow", since = "1.13.0")]
|
||||
impl Display for BorrowError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
Display::fmt("already mutably borrowed", f)
|
||||
}
|
||||
}
|
||||
@ -597,14 +597,14 @@ pub struct BorrowMutError {
|
||||
|
||||
#[stable(feature = "try_borrow", since = "1.13.0")]
|
||||
impl Debug for BorrowMutError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("BorrowMutError").finish()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "try_borrow", since = "1.13.0")]
|
||||
impl Display for BorrowMutError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
Display::fmt("already borrowed", f)
|
||||
}
|
||||
}
|
||||
@ -788,7 +788,7 @@ impl<T: ?Sized> RefCell<T> {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn borrow(&self) -> Ref<T> {
|
||||
pub fn borrow(&self) -> Ref<'_, T> {
|
||||
self.try_borrow().expect("already mutably borrowed")
|
||||
}
|
||||
|
||||
@ -819,7 +819,7 @@ impl<T: ?Sized> RefCell<T> {
|
||||
/// ```
|
||||
#[stable(feature = "try_borrow", since = "1.13.0")]
|
||||
#[inline]
|
||||
pub fn try_borrow(&self) -> Result<Ref<T>, BorrowError> {
|
||||
pub fn try_borrow(&self) -> Result<Ref<'_, T>, BorrowError> {
|
||||
match BorrowRef::new(&self.borrow) {
|
||||
Some(b) => Ok(Ref {
|
||||
value: unsafe { &*self.value.get() },
|
||||
@ -869,7 +869,7 @@ impl<T: ?Sized> RefCell<T> {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn borrow_mut(&self) -> RefMut<T> {
|
||||
pub fn borrow_mut(&self) -> RefMut<'_, T> {
|
||||
self.try_borrow_mut().expect("already borrowed")
|
||||
}
|
||||
|
||||
@ -897,7 +897,7 @@ impl<T: ?Sized> RefCell<T> {
|
||||
/// ```
|
||||
#[stable(feature = "try_borrow", since = "1.13.0")]
|
||||
#[inline]
|
||||
pub fn try_borrow_mut(&self) -> Result<RefMut<T>, BorrowMutError> {
|
||||
pub fn try_borrow_mut(&self) -> Result<RefMut<'_, T>, BorrowMutError> {
|
||||
match BorrowRefMut::new(&self.borrow) {
|
||||
Some(b) => Ok(RefMut {
|
||||
value: unsafe { &mut *self.value.get() },
|
||||
@ -1245,7 +1245,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b,
|
||||
|
||||
#[stable(feature = "std_guard_impls", since = "1.20.0")]
|
||||
impl<T: ?Sized + fmt::Display> fmt::Display for Ref<'_, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.value.fmt(f)
|
||||
}
|
||||
}
|
||||
@ -1402,7 +1402,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefM
|
||||
|
||||
#[stable(feature = "std_guard_impls", since = "1.20.0")]
|
||||
impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.value.fmt(f)
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ enum CharErrorKind {
|
||||
|
||||
#[stable(feature = "char_from_str", since = "1.20.0")]
|
||||
impl fmt::Display for ParseCharError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(f)
|
||||
}
|
||||
}
|
||||
@ -240,7 +240,7 @@ pub struct CharTryFromError(());
|
||||
|
||||
#[stable(feature = "try_from", since = "1.34.0")]
|
||||
impl fmt::Display for CharTryFromError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
"converted integer out of range for `char`".fmt(f)
|
||||
}
|
||||
}
|
||||
@ -316,4 +316,3 @@ pub fn from_digit(num: u32, radix: u32) -> Option<char> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ impl DecodeUtf16Error {
|
||||
|
||||
#[stable(feature = "decode_utf16", since = "1.9.0")]
|
||||
impl fmt::Display for DecodeUtf16Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "unpaired surrogate found: {:x}", self.code)
|
||||
}
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ impl FusedIterator for EscapeUnicode {}
|
||||
|
||||
#[stable(feature = "char_struct_display", since = "1.16.0")]
|
||||
impl fmt::Display for EscapeUnicode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
for c in self.clone() {
|
||||
f.write_char(c)?;
|
||||
}
|
||||
@ -333,7 +333,7 @@ impl FusedIterator for EscapeDefault {}
|
||||
|
||||
#[stable(feature = "char_struct_display", since = "1.16.0")]
|
||||
impl fmt::Display for EscapeDefault {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
for c in self.clone() {
|
||||
f.write_char(c)?;
|
||||
}
|
||||
@ -367,7 +367,7 @@ impl FusedIterator for EscapeDebug {}
|
||||
|
||||
#[stable(feature = "char_escape_debug", since = "1.20.0")]
|
||||
impl fmt::Display for EscapeDebug {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Display::fmt(&self.0, f)
|
||||
}
|
||||
}
|
||||
@ -482,7 +482,7 @@ impl Iterator for CaseMappingIter {
|
||||
}
|
||||
|
||||
impl fmt::Display for CaseMappingIter {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
CaseMappingIter::Three(a, b, c) => {
|
||||
f.write_char(a)?;
|
||||
@ -503,14 +503,14 @@ impl fmt::Display for CaseMappingIter {
|
||||
|
||||
#[stable(feature = "char_struct_display", since = "1.16.0")]
|
||||
impl fmt::Display for ToLowercase {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Display::fmt(&self.0, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "char_struct_display", since = "1.16.0")]
|
||||
impl fmt::Display for ToUppercase {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Display::fmt(&self.0, f)
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ pub enum c_void {
|
||||
|
||||
#[stable(feature = "std_debug", since = "1.16.0")]
|
||||
impl fmt::Debug for c_void {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("c_void")
|
||||
}
|
||||
}
|
||||
@ -62,7 +62,7 @@ extern {
|
||||
all(target_arch = "aarch64", target_os = "ios"),
|
||||
windows))]
|
||||
impl fmt::Debug for VaListImpl {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "va_list* {:p}", self)
|
||||
}
|
||||
}
|
||||
@ -212,7 +212,7 @@ impl<'a> VaList<'a> {
|
||||
extern "rust-intrinsic" {
|
||||
/// Destroy the arglist `ap` after initialization with `va_start` or
|
||||
/// `va_copy`.
|
||||
fn va_end(ap: &mut VaList);
|
||||
fn va_end(ap: &mut VaList<'_>);
|
||||
|
||||
/// Copies the current location of arglist `src` to the arglist `dst`.
|
||||
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
|
||||
@ -222,9 +222,9 @@ extern "rust-intrinsic" {
|
||||
fn va_copy<'a>(src: &VaList<'a>) -> VaList<'a>;
|
||||
#[cfg(all(any(target_arch = "aarch64", target_arch = "powerpc", target_arch = "x86_64"),
|
||||
not(windows), not(all(target_arch = "aarch64", target_os = "ios"))))]
|
||||
fn va_copy(src: &VaList) -> VaListImpl;
|
||||
fn va_copy(src: &VaList<'_>) -> VaListImpl;
|
||||
|
||||
/// Loads an argument of type `T` from the `va_list` `ap` and increment the
|
||||
/// argument `ap` points to.
|
||||
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaList) -> T;
|
||||
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaList<'_>) -> T;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ struct PadAdapter<'a> {
|
||||
}
|
||||
|
||||
impl<'a> PadAdapter<'a> {
|
||||
fn wrap<'b, 'c: 'a+'b>(fmt: &'c mut fmt::Formatter, slot: &'b mut Option<Self>)
|
||||
fn wrap<'b, 'c: 'a+'b>(fmt: &'c mut fmt::Formatter<'_>, slot: &'b mut Option<Self>)
|
||||
-> fmt::Formatter<'b> {
|
||||
fmt.wrap_buf(move |buf| {
|
||||
*slot = Some(PadAdapter {
|
||||
|
@ -5,13 +5,13 @@ use crate::num::flt2dec;
|
||||
// Don't inline this so callers don't use the stack space this function
|
||||
// requires unless they have to.
|
||||
#[inline(never)]
|
||||
fn float_to_decimal_common_exact<T>(fmt: &mut Formatter, num: &T,
|
||||
fn float_to_decimal_common_exact<T>(fmt: &mut Formatter<'_>, num: &T,
|
||||
sign: flt2dec::Sign, precision: usize) -> Result
|
||||
where T: flt2dec::DecodableFloat
|
||||
{
|
||||
unsafe {
|
||||
let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part; 4]>::uninit();
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 4]>::uninit();
|
||||
// FIXME(#53491): Technically, this is calling `get_mut` on an uninitialized
|
||||
// `MaybeUninit` (here and elsewhere in this file). Revisit this once
|
||||
// we decided whether that is valid or not.
|
||||
@ -26,14 +26,14 @@ fn float_to_decimal_common_exact<T>(fmt: &mut Formatter, num: &T,
|
||||
// Don't inline this so callers that call both this and the above won't wind
|
||||
// up using the combined stack space of both functions in some cases.
|
||||
#[inline(never)]
|
||||
fn float_to_decimal_common_shortest<T>(fmt: &mut Formatter, num: &T,
|
||||
fn float_to_decimal_common_shortest<T>(fmt: &mut Formatter<'_>, num: &T,
|
||||
sign: flt2dec::Sign, precision: usize) -> Result
|
||||
where T: flt2dec::DecodableFloat
|
||||
{
|
||||
unsafe {
|
||||
// enough for f32 and f64
|
||||
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninit();
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part; 4]>::uninit();
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 4]>::uninit();
|
||||
// FIXME(#53491)
|
||||
let formatted = flt2dec::to_shortest_str(flt2dec::strategy::grisu::format_shortest, *num,
|
||||
sign, precision, false, buf.get_mut(),
|
||||
@ -43,7 +43,7 @@ fn float_to_decimal_common_shortest<T>(fmt: &mut Formatter, num: &T,
|
||||
}
|
||||
|
||||
// Common code of floating point Debug and Display.
|
||||
fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T,
|
||||
fn float_to_decimal_common<T>(fmt: &mut Formatter<'_>, num: &T,
|
||||
negative_zero: bool, min_precision: usize) -> Result
|
||||
where T: flt2dec::DecodableFloat
|
||||
{
|
||||
@ -65,14 +65,14 @@ fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T,
|
||||
// Don't inline this so callers don't use the stack space this function
|
||||
// requires unless they have to.
|
||||
#[inline(never)]
|
||||
fn float_to_exponential_common_exact<T>(fmt: &mut Formatter, num: &T,
|
||||
fn float_to_exponential_common_exact<T>(fmt: &mut Formatter<'_>, num: &T,
|
||||
sign: flt2dec::Sign, precision: usize,
|
||||
upper: bool) -> Result
|
||||
where T: flt2dec::DecodableFloat
|
||||
{
|
||||
unsafe {
|
||||
let mut buf = MaybeUninit::<[u8; 1024]>::uninit(); // enough for f32 and f64
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part; 6]>::uninit();
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 6]>::uninit();
|
||||
// FIXME(#53491)
|
||||
let formatted = flt2dec::to_exact_exp_str(flt2dec::strategy::grisu::format_exact,
|
||||
*num, sign, precision,
|
||||
@ -84,7 +84,7 @@ fn float_to_exponential_common_exact<T>(fmt: &mut Formatter, num: &T,
|
||||
// Don't inline this so callers that call both this and the above won't wind
|
||||
// up using the combined stack space of both functions in some cases.
|
||||
#[inline(never)]
|
||||
fn float_to_exponential_common_shortest<T>(fmt: &mut Formatter,
|
||||
fn float_to_exponential_common_shortest<T>(fmt: &mut Formatter<'_>,
|
||||
num: &T, sign: flt2dec::Sign,
|
||||
upper: bool) -> Result
|
||||
where T: flt2dec::DecodableFloat
|
||||
@ -92,7 +92,7 @@ fn float_to_exponential_common_shortest<T>(fmt: &mut Formatter,
|
||||
unsafe {
|
||||
// enough for f32 and f64
|
||||
let mut buf = MaybeUninit::<[u8; flt2dec::MAX_SIG_DIGITS]>::uninit();
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part; 6]>::uninit();
|
||||
let mut parts = MaybeUninit::<[flt2dec::Part<'_>; 6]>::uninit();
|
||||
// FIXME(#53491)
|
||||
let formatted = flt2dec::to_shortest_exp_str(flt2dec::strategy::grisu::format_shortest,
|
||||
*num, sign, (0, 0), upper,
|
||||
@ -102,7 +102,7 @@ fn float_to_exponential_common_shortest<T>(fmt: &mut Formatter,
|
||||
}
|
||||
|
||||
// Common code of floating point LowerExp and UpperExp.
|
||||
fn float_to_exponential_common<T>(fmt: &mut Formatter, num: &T, upper: bool) -> Result
|
||||
fn float_to_exponential_common<T>(fmt: &mut Formatter<'_>, num: &T, upper: bool) -> Result
|
||||
where T: flt2dec::DecodableFloat
|
||||
{
|
||||
let force_sign = fmt.sign_plus();
|
||||
@ -123,28 +123,28 @@ macro_rules! floating {
|
||||
($ty:ident) => (
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Debug for $ty {
|
||||
fn fmt(&self, fmt: &mut Formatter) -> Result {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
|
||||
float_to_decimal_common(fmt, self, true, 1)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Display for $ty {
|
||||
fn fmt(&self, fmt: &mut Formatter) -> Result {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
|
||||
float_to_decimal_common(fmt, self, false, 0)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl LowerExp for $ty {
|
||||
fn fmt(&self, fmt: &mut Formatter) -> Result {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
|
||||
float_to_exponential_common(fmt, self, false)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl UpperExp for $ty {
|
||||
fn fmt(&self, fmt: &mut Formatter) -> Result {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
|
||||
float_to_exponential_common(fmt, self, true)
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ pub mod rt {
|
||||
/// }
|
||||
///
|
||||
/// impl fmt::Display for Triangle {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// write!(f, "({}, {}, {})", self.a, self.b, self.c)
|
||||
/// }
|
||||
/// }
|
||||
@ -191,7 +191,7 @@ pub trait Write {
|
||||
/// assert_eq!(&buf, "world");
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn write_fmt(mut self: &mut Self, args: Arguments) -> Result {
|
||||
fn write_fmt(mut self: &mut Self, args: Arguments<'_>) -> Result {
|
||||
write(&mut self, args)
|
||||
}
|
||||
}
|
||||
@ -206,7 +206,7 @@ impl<W: Write + ?Sized> Write for &mut W {
|
||||
(**self).write_char(c)
|
||||
}
|
||||
|
||||
fn write_fmt(&mut self, args: Arguments) -> Result {
|
||||
fn write_fmt(&mut self, args: Arguments<'_>) -> Result {
|
||||
(**self).write_fmt(args)
|
||||
}
|
||||
}
|
||||
@ -238,7 +238,7 @@ pub struct Formatter<'a> {
|
||||
}
|
||||
|
||||
// NB. Argument is essentially an optimized partially applied formatting function,
|
||||
// equivalent to `exists T.(&T, fn(&T, &mut Formatter) -> Result`.
|
||||
// equivalent to `exists T.(&T, fn(&T, &mut Formatter<'_>) -> Result`.
|
||||
|
||||
struct Void {
|
||||
_priv: (),
|
||||
@ -263,12 +263,12 @@ struct Void {
|
||||
#[doc(hidden)]
|
||||
pub struct ArgumentV1<'a> {
|
||||
value: &'a Void,
|
||||
formatter: fn(&Void, &mut Formatter) -> Result,
|
||||
formatter: fn(&Void, &mut Formatter<'_>) -> Result,
|
||||
}
|
||||
|
||||
impl<'a> ArgumentV1<'a> {
|
||||
#[inline(never)]
|
||||
fn show_usize(x: &usize, f: &mut Formatter) -> Result {
|
||||
fn show_usize(x: &usize, f: &mut Formatter<'_>) -> Result {
|
||||
Display::fmt(x, f)
|
||||
}
|
||||
|
||||
@ -276,7 +276,7 @@ impl<'a> ArgumentV1<'a> {
|
||||
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
|
||||
issue = "0")]
|
||||
pub fn new<'b, T>(x: &'b T,
|
||||
f: fn(&T, &mut Formatter) -> Result) -> ArgumentV1<'b> {
|
||||
f: fn(&T, &mut Formatter<'_>) -> Result) -> ArgumentV1<'b> {
|
||||
unsafe {
|
||||
ArgumentV1 {
|
||||
formatter: mem::transmute(f),
|
||||
@ -288,7 +288,7 @@ impl<'a> ArgumentV1<'a> {
|
||||
#[doc(hidden)]
|
||||
#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
|
||||
issue = "0")]
|
||||
pub fn from_usize(x: &usize) -> ArgumentV1 {
|
||||
pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
|
||||
ArgumentV1::new(x, ArgumentV1::show_usize)
|
||||
}
|
||||
|
||||
@ -406,14 +406,14 @@ pub struct Arguments<'a> {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Debug for Arguments<'_> {
|
||||
fn fmt(&self, fmt: &mut Formatter) -> Result {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
|
||||
Display::fmt(self, fmt)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Display for Arguments<'_> {
|
||||
fn fmt(&self, fmt: &mut Formatter) -> Result {
|
||||
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
|
||||
write(fmt.buf, *self)
|
||||
}
|
||||
}
|
||||
@ -463,7 +463,7 @@ impl Display for Arguments<'_> {
|
||||
/// }
|
||||
///
|
||||
/// impl fmt::Debug for Point {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// write!(f, "Point {{ x: {}, y: {} }}", self.x, self.y)
|
||||
/// }
|
||||
/// }
|
||||
@ -533,7 +533,7 @@ pub trait Debug {
|
||||
/// }
|
||||
///
|
||||
/// impl fmt::Debug for Position {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// write!(f, "({:?}, {:?})", self.longitude, self.latitude)
|
||||
/// }
|
||||
/// }
|
||||
@ -542,7 +542,7 @@ pub trait Debug {
|
||||
/// format!("{:?}", Position { longitude: 1.987, latitude: 2.983, }));
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// Format trait for an empty format, `{}`.
|
||||
@ -569,7 +569,7 @@ pub trait Debug {
|
||||
/// }
|
||||
///
|
||||
/// impl fmt::Display for Point {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// write!(f, "({}, {})", self.x, self.y)
|
||||
/// }
|
||||
/// }
|
||||
@ -605,7 +605,7 @@ pub trait Display {
|
||||
/// }
|
||||
///
|
||||
/// impl fmt::Display for Position {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// write!(f, "({}, {})", self.longitude, self.latitude)
|
||||
/// }
|
||||
/// }
|
||||
@ -614,7 +614,7 @@ pub trait Display {
|
||||
/// format!("{}", Position { longitude: 1.987, latitude: 2.983, }));
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// `o` formatting.
|
||||
@ -651,7 +651,7 @@ pub trait Display {
|
||||
/// struct Length(i32);
|
||||
///
|
||||
/// impl fmt::Octal for Length {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// let val = self.0;
|
||||
///
|
||||
/// write!(f, "{:o}", val) // delegate to i32's implementation
|
||||
@ -666,7 +666,7 @@ pub trait Display {
|
||||
pub trait Octal {
|
||||
/// Formats the value using the given formatter.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// `b` formatting.
|
||||
@ -701,7 +701,7 @@ pub trait Octal {
|
||||
/// struct Length(i32);
|
||||
///
|
||||
/// impl fmt::Binary for Length {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// let val = self.0;
|
||||
///
|
||||
/// write!(f, "{:b}", val) // delegate to i32's implementation
|
||||
@ -722,7 +722,7 @@ pub trait Octal {
|
||||
pub trait Binary {
|
||||
/// Formats the value using the given formatter.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// `x` formatting.
|
||||
@ -760,7 +760,7 @@ pub trait Binary {
|
||||
/// struct Length(i32);
|
||||
///
|
||||
/// impl fmt::LowerHex for Length {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// let val = self.0;
|
||||
///
|
||||
/// write!(f, "{:x}", val) // delegate to i32's implementation
|
||||
@ -775,7 +775,7 @@ pub trait Binary {
|
||||
pub trait LowerHex {
|
||||
/// Formats the value using the given formatter.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// `X` formatting.
|
||||
@ -813,7 +813,7 @@ pub trait LowerHex {
|
||||
/// struct Length(i32);
|
||||
///
|
||||
/// impl fmt::UpperHex for Length {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// let val = self.0;
|
||||
///
|
||||
/// write!(f, "{:X}", val) // delegate to i32's implementation
|
||||
@ -828,7 +828,7 @@ pub trait LowerHex {
|
||||
pub trait UpperHex {
|
||||
/// Formats the value using the given formatter.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// `p` formatting.
|
||||
@ -858,7 +858,7 @@ pub trait UpperHex {
|
||||
/// struct Length(i32);
|
||||
///
|
||||
/// impl fmt::Pointer for Length {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// // use `as` to convert to a `*const T`, which implements Pointer, which we can use
|
||||
///
|
||||
/// write!(f, "{:p}", self as *const Length)
|
||||
@ -873,7 +873,7 @@ pub trait UpperHex {
|
||||
pub trait Pointer {
|
||||
/// Formats the value using the given formatter.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// `e` formatting.
|
||||
@ -902,7 +902,7 @@ pub trait Pointer {
|
||||
/// struct Length(i32);
|
||||
///
|
||||
/// impl fmt::LowerExp for Length {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// let val = self.0;
|
||||
/// write!(f, "{}e1", val / 10)
|
||||
/// }
|
||||
@ -916,7 +916,7 @@ pub trait Pointer {
|
||||
pub trait LowerExp {
|
||||
/// Formats the value using the given formatter.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// `E` formatting.
|
||||
@ -945,7 +945,7 @@ pub trait LowerExp {
|
||||
/// struct Length(i32);
|
||||
///
|
||||
/// impl fmt::UpperExp for Length {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// let val = self.0;
|
||||
/// write!(f, "{}E1", val / 10)
|
||||
/// }
|
||||
@ -959,7 +959,7 @@ pub trait LowerExp {
|
||||
pub trait UpperExp {
|
||||
/// Formats the value using the given formatter.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result;
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
|
||||
}
|
||||
|
||||
/// The `write` function takes an output stream, and an `Arguments` struct
|
||||
@ -994,7 +994,7 @@ pub trait UpperExp {
|
||||
///
|
||||
/// [`write!`]: ../../std/macro.write.html
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn write(output: &mut dyn Write, args: Arguments) -> Result {
|
||||
pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
|
||||
let mut formatter = Formatter {
|
||||
flags: 0,
|
||||
width: None,
|
||||
@ -1183,7 +1183,7 @@ impl<'a> Formatter<'a> {
|
||||
|
||||
// Writes the sign if it exists, and then the prefix if it was requested
|
||||
#[inline(never)]
|
||||
fn write_prefix(f: &mut Formatter, sign: Option<char>, prefix: Option<&str>) -> Result {
|
||||
fn write_prefix(f: &mut Formatter<'_>, sign: Option<char>, prefix: Option<&str>) -> Result {
|
||||
if let Some(c) = sign {
|
||||
f.buf.write_char(c)?;
|
||||
}
|
||||
@ -1331,7 +1331,7 @@ impl<'a> Formatter<'a> {
|
||||
/// Takes the formatted parts and applies the padding.
|
||||
/// Assumes that the caller already has rendered the parts with required precision,
|
||||
/// so that `self.precision` can be ignored.
|
||||
fn pad_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
|
||||
fn pad_formatted_parts(&mut self, formatted: &flt2dec::Formatted<'_>) -> Result {
|
||||
if let Some(mut width) = self.width {
|
||||
// for the sign-aware zero padding, we render the sign first and
|
||||
// behave as if we had no sign from the beginning.
|
||||
@ -1370,7 +1370,7 @@ impl<'a> Formatter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn write_formatted_parts(&mut self, formatted: &flt2dec::Formatted) -> Result {
|
||||
fn write_formatted_parts(&mut self, formatted: &flt2dec::Formatted<'_>) -> Result {
|
||||
fn write_bytes(buf: &mut dyn Write, s: &[u8]) -> Result {
|
||||
buf.write_str(unsafe { str::from_utf8_unchecked(s) })
|
||||
}
|
||||
@ -1453,7 +1453,7 @@ impl<'a> Formatter<'a> {
|
||||
/// assert_eq!(&format!("{:0>8}", Foo(2)), "Foo 2");
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn write_fmt(&mut self, fmt: Arguments) -> Result {
|
||||
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result {
|
||||
write(self.buf, fmt)
|
||||
}
|
||||
|
||||
@ -1892,14 +1892,14 @@ impl Write for Formatter<'_> {
|
||||
self.buf.write_char(c)
|
||||
}
|
||||
|
||||
fn write_fmt(&mut self, args: Arguments) -> Result {
|
||||
fn write_fmt(&mut self, args: Arguments<'_>) -> Result {
|
||||
write(self.buf, args)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Display for Error {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Display::fmt("an error occurred when formatting an argument", f)
|
||||
}
|
||||
}
|
||||
@ -1911,11 +1911,11 @@ macro_rules! fmt_refs {
|
||||
$(
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized + $tr> $tr for &T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result { $tr::fmt(&**self, f) }
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized + $tr> $tr for &mut T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) }
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result { $tr::fmt(&**self, f) }
|
||||
}
|
||||
)*
|
||||
}
|
||||
@ -1925,14 +1925,14 @@ fmt_refs! { Debug, Display, Octal, Binary, LowerHex, UpperHex, LowerExp, UpperEx
|
||||
|
||||
#[unstable(feature = "never_type", issue = "35121")]
|
||||
impl Debug for ! {
|
||||
fn fmt(&self, _: &mut Formatter) -> Result {
|
||||
fn fmt(&self, _: &mut Formatter<'_>) -> Result {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "never_type", issue = "35121")]
|
||||
impl Display for ! {
|
||||
fn fmt(&self, _: &mut Formatter) -> Result {
|
||||
fn fmt(&self, _: &mut Formatter<'_>) -> Result {
|
||||
*self
|
||||
}
|
||||
}
|
||||
@ -1940,21 +1940,21 @@ impl Display for ! {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Debug for bool {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Display::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Display for bool {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Display::fmt(if *self { "true" } else { "false" }, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Debug for str {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.write_char('"')?;
|
||||
let mut from = 0;
|
||||
for (i, c) in self.char_indices() {
|
||||
@ -1975,14 +1975,14 @@ impl Debug for str {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Display for str {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.pad(self)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Debug for char {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.write_char('\'')?;
|
||||
for c in self.escape_debug() {
|
||||
f.write_char(c)?
|
||||
@ -1993,7 +1993,7 @@ impl Debug for char {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Display for char {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
if f.width.is_none() && f.precision.is_none() {
|
||||
f.write_char(*self)
|
||||
} else {
|
||||
@ -2004,7 +2004,7 @@ impl Display for char {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Pointer for *const T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
let old_width = f.width;
|
||||
let old_flags = f.flags;
|
||||
|
||||
@ -2032,21 +2032,21 @@ impl<T: ?Sized> Pointer for *const T {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Pointer for *mut T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Pointer::fmt(&(*self as *const T), f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Pointer for &T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Pointer::fmt(&(*self as *const T), f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Pointer for &mut T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Pointer::fmt(&(&**self as *const T), f)
|
||||
}
|
||||
}
|
||||
@ -2055,11 +2055,11 @@ impl<T: ?Sized> Pointer for &mut T {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Debug for *const T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result { Pointer::fmt(self, f) }
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Debug for *mut T {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result { Pointer::fmt(self, f) }
|
||||
}
|
||||
|
||||
macro_rules! peel {
|
||||
@ -2072,7 +2072,7 @@ macro_rules! tuple {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<$($name:Debug),*> Debug for ($($name,)*) where last_type!($($name,)+): ?Sized {
|
||||
#[allow(non_snake_case, unused_assignments)]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
let mut builder = f.debug_tuple("");
|
||||
let ($(ref $name,)*) = *self;
|
||||
$(
|
||||
@ -2095,7 +2095,7 @@ tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: Debug> Debug for [T] {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.debug_list().entries(self.iter()).finish()
|
||||
}
|
||||
}
|
||||
@ -2103,20 +2103,20 @@ impl<T: Debug> Debug for [T] {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl Debug for () {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.pad("()")
|
||||
}
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized> Debug for PhantomData<T> {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.pad("PhantomData")
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: Copy + Debug> Debug for Cell<T> {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.debug_struct("Cell")
|
||||
.field("value", &self.get())
|
||||
.finish()
|
||||
@ -2125,7 +2125,7 @@ impl<T: Copy + Debug> Debug for Cell<T> {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized + Debug> Debug for RefCell<T> {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
match self.try_borrow() {
|
||||
Ok(borrow) => {
|
||||
f.debug_struct("RefCell")
|
||||
@ -2138,7 +2138,7 @@ impl<T: ?Sized + Debug> Debug for RefCell<T> {
|
||||
struct BorrowedPlaceholder;
|
||||
|
||||
impl Debug for BorrowedPlaceholder {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.write_str("<borrowed>")
|
||||
}
|
||||
}
|
||||
@ -2153,21 +2153,21 @@ impl<T: ?Sized + Debug> Debug for RefCell<T> {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized + Debug> Debug for Ref<'_, T> {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Debug::fmt(&**self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: ?Sized + Debug> Debug for RefMut<'_, T> {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
Debug::fmt(&*(self.deref()), f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: ?Sized + Debug> Debug for UnsafeCell<T> {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
|
||||
f.pad("UnsafeCell")
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ trait GenericRadix {
|
||||
fn digit(x: u8) -> u8;
|
||||
|
||||
/// Format an integer using the radix using a formatter.
|
||||
fn fmt_int<T: Int>(&self, mut x: T, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt_int<T: Int>(&self, mut x: T, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
// The radix can be as low as 2, so we need a buffer of at least 128
|
||||
// characters for a base 2 number.
|
||||
let zero = T::zero();
|
||||
@ -131,7 +131,7 @@ macro_rules! int_base {
|
||||
($Trait:ident for $T:ident as $U:ident -> $Radix:ident) => {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::$Trait for $T {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
$Radix.fmt_int(*self as $U, f)
|
||||
}
|
||||
}
|
||||
@ -143,7 +143,7 @@ macro_rules! debug {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Debug for $T {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if f.debug_lower_hex() {
|
||||
fmt::LowerHex::fmt(self, f)
|
||||
} else if f.debug_upper_hex() {
|
||||
@ -188,7 +188,7 @@ static DEC_DIGITS_LUT: &[u8; 200] =
|
||||
|
||||
macro_rules! impl_Display {
|
||||
($($t:ident),* as $u:ident via $conv_fn:ident named $name:ident) => {
|
||||
fn $name(mut n: $u, is_nonnegative: bool, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn $name(mut n: $u, is_nonnegative: bool, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let mut buf = uninitialized_array![u8; 39];
|
||||
let mut curr = buf.len() as isize;
|
||||
let buf_ptr = MaybeUninit::first_ptr_mut(&mut buf);
|
||||
@ -243,7 +243,7 @@ macro_rules! impl_Display {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for $t {
|
||||
#[allow(unused_comparisons)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let is_nonnegative = *self >= 0;
|
||||
let n = if is_nonnegative {
|
||||
self.$conv_fn()
|
||||
|
@ -500,7 +500,7 @@ pub struct BuildHasherDefault<H>(marker::PhantomData<H>);
|
||||
|
||||
#[stable(since = "1.9.0", feature = "core_impl_debug")]
|
||||
impl<H> fmt::Debug for BuildHasherDefault<H> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("BuildHasherDefault")
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ impl<I: Clone, U: Clone + IntoIterator, F: Clone> Clone for FlatMap<I, U, F>
|
||||
impl<I: fmt::Debug, U: IntoIterator, F> fmt::Debug for FlatMap<I, U, F>
|
||||
where U::IntoIter: fmt::Debug
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("FlatMap").field("inner", &self.inner).finish()
|
||||
}
|
||||
}
|
||||
@ -120,7 +120,7 @@ impl<I, U> fmt::Debug for Flatten<I>
|
||||
where I: Iterator + fmt::Debug, U: Iterator + fmt::Debug,
|
||||
I::Item: IntoIterator<IntoIter = U, Item = U::Item>,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Flatten").field("inner", &self.inner).finish()
|
||||
}
|
||||
}
|
||||
@ -328,4 +328,3 @@ impl<I, U> DoubleEndedIterator for FlattenCompat<I, U>
|
||||
.rfold(init, |acc, iter| iter.rfold(acc, &mut fold))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -553,7 +553,7 @@ impl<I, F> Map<I, F> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<I: fmt::Debug, F> fmt::Debug for Map<I, F> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Map")
|
||||
.field("iter", &self.iter)
|
||||
.finish()
|
||||
@ -669,7 +669,7 @@ impl<I, P> Filter<I, P> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<I: fmt::Debug, P> fmt::Debug for Filter<I, P> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Filter")
|
||||
.field("iter", &self.iter)
|
||||
.finish()
|
||||
@ -793,7 +793,7 @@ impl<I, F> FilterMap<I, F> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<I: fmt::Debug, F> fmt::Debug for FilterMap<I, F> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("FilterMap")
|
||||
.field("iter", &self.iter)
|
||||
.finish()
|
||||
@ -1232,7 +1232,7 @@ impl<I, P> SkipWhile<I, P> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<I: fmt::Debug, P> fmt::Debug for SkipWhile<I, P> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SkipWhile")
|
||||
.field("iter", &self.iter)
|
||||
.field("flag", &self.flag)
|
||||
@ -1320,7 +1320,7 @@ impl<I, P> TakeWhile<I, P> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<I: fmt::Debug, P> fmt::Debug for TakeWhile<I, P> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("TakeWhile")
|
||||
.field("iter", &self.iter)
|
||||
.field("flag", &self.flag)
|
||||
@ -1644,7 +1644,7 @@ impl<I, St, F> Scan<I, St, F> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<I: fmt::Debug, St: fmt::Debug, F> fmt::Debug for Scan<I, St, F> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Scan")
|
||||
.field("iter", &self.iter)
|
||||
.field("state", &self.state)
|
||||
@ -1954,7 +1954,7 @@ impl<I, F> Inspect<I, F> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<I: fmt::Debug, F> fmt::Debug for Inspect<I, F> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Inspect")
|
||||
.field("iter", &self.iter)
|
||||
.finish()
|
||||
|
@ -200,7 +200,7 @@ pub struct Empty<T>(marker::PhantomData<T>);
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T> fmt::Debug for Empty<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("Empty")
|
||||
}
|
||||
}
|
||||
@ -558,7 +558,7 @@ impl<T, F> Iterator for FromFn<F>
|
||||
|
||||
#[stable(feature = "iter_from_fn", since = "1.34.0")]
|
||||
impl<F> fmt::Debug for FromFn<F> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("FromFn").finish()
|
||||
}
|
||||
}
|
||||
@ -631,7 +631,7 @@ impl<T, F> FusedIterator for Successors<T, F>
|
||||
|
||||
#[stable(feature = "iter_successors", since = "1.34.0")]
|
||||
impl<T: fmt::Debug, F> fmt::Debug for Successors<T, F> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Successors")
|
||||
.field("next", &self.next)
|
||||
.finish()
|
||||
|
@ -65,7 +65,6 @@
|
||||
|
||||
#![deny(rust_2018_idioms)]
|
||||
#![allow(explicit_outlives_requirements)]
|
||||
#![allow(elided_lifetimes_in_paths)]
|
||||
|
||||
#![feature(allow_internal_unstable)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
|
@ -862,7 +862,7 @@ impl<T> hash::Hash for Discriminant<T> {
|
||||
|
||||
#[stable(feature = "discriminant_value", since = "1.21.0")]
|
||||
impl<T> fmt::Debug for Discriminant<T> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt.debug_tuple("Discriminant")
|
||||
.field(&self.0)
|
||||
.finish()
|
||||
|
@ -459,7 +459,7 @@ macro_rules! define_bignum {
|
||||
}
|
||||
|
||||
impl crate::fmt::Debug for $name {
|
||||
fn fmt(&self, f: &mut crate::fmt::Formatter) -> crate::fmt::Result {
|
||||
fn fmt(&self, f: &mut crate::fmt::Formatter<'_>) -> crate::fmt::Result {
|
||||
use crate::mem;
|
||||
|
||||
let sz = if self.size < 1 {1} else {self.size};
|
||||
|
@ -196,7 +196,7 @@ impl ParseFloatError {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for ParseFloatError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(f)
|
||||
}
|
||||
}
|
||||
@ -244,7 +244,7 @@ fn dec2flt<T: RawFloat>(s: &str) -> Result<T, ParseFloatError> {
|
||||
|
||||
/// The main workhorse for the decimal-to-float conversion: Orchestrate all the preprocessing
|
||||
/// and figure out which algorithm should do the actual conversion.
|
||||
fn convert<T: RawFloat>(mut decimal: Decimal) -> Result<T, ParseFloatError> {
|
||||
fn convert<T: RawFloat>(mut decimal: Decimal<'_>) -> Result<T, ParseFloatError> {
|
||||
simplify(&mut decimal);
|
||||
if let Some(x) = trivial_cases(&decimal) {
|
||||
return Ok(x);
|
||||
@ -281,7 +281,7 @@ fn convert<T: RawFloat>(mut decimal: Decimal) -> Result<T, ParseFloatError> {
|
||||
|
||||
/// Strip zeros where possible, even when this requires changing the exponent
|
||||
#[inline(always)]
|
||||
fn simplify(decimal: &mut Decimal) {
|
||||
fn simplify(decimal: &mut Decimal<'_>) {
|
||||
let is_zero = &|&&d: &&u8| -> bool { d == b'0' };
|
||||
// Trimming these zeros does not change anything but may enable the fast path (< 15 digits).
|
||||
let leading_zeros = decimal.integral.iter().take_while(is_zero).count();
|
||||
@ -306,7 +306,7 @@ fn simplify(decimal: &mut Decimal) {
|
||||
|
||||
/// Returns a quick-an-dirty upper bound on the size (log10) of the largest value that Algorithm R
|
||||
/// and Algorithm M will compute while working on the given decimal.
|
||||
fn bound_intermediate_digits(decimal: &Decimal, e: i64) -> u64 {
|
||||
fn bound_intermediate_digits(decimal: &Decimal<'_>, e: i64) -> u64 {
|
||||
// We don't need to worry too much about overflow here thanks to trivial_cases() and the
|
||||
// parser, which filter out the most extreme inputs for us.
|
||||
let f_len: u64 = decimal.integral.len() as u64 + decimal.fractional.len() as u64;
|
||||
@ -325,7 +325,7 @@ fn bound_intermediate_digits(decimal: &Decimal, e: i64) -> u64 {
|
||||
}
|
||||
|
||||
/// Detects obvious overflows and underflows without even looking at the decimal digits.
|
||||
fn trivial_cases<T: RawFloat>(decimal: &Decimal) -> Option<T> {
|
||||
fn trivial_cases<T: RawFloat>(decimal: &Decimal<'_>) -> Option<T> {
|
||||
// There were zeros but they were stripped by simplify()
|
||||
if decimal.integral.is_empty() && decimal.fractional.is_empty() {
|
||||
return Some(T::ZERO);
|
||||
|
@ -44,7 +44,7 @@ pub enum ParseResult<'a> {
|
||||
|
||||
/// Checks if the input string is a valid floating point number and if so, locate the integral
|
||||
/// part, the fractional part, and the exponent in it. Does not handle signs.
|
||||
pub fn parse_decimal(s: &str) -> ParseResult {
|
||||
pub fn parse_decimal(s: &str) -> ParseResult<'_> {
|
||||
if s.is_empty() {
|
||||
return Invalid;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ macro_rules! impl_nonzero_fmt {
|
||||
#[$stability]
|
||||
impl fmt::$Trait for $Ty {
|
||||
#[inline]
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.get().fmt(f)
|
||||
}
|
||||
}
|
||||
@ -164,42 +164,42 @@ pub struct Wrapping<T>(#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<T: fmt::Debug> fmt::Debug for Wrapping<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "wrapping_display", since = "1.10.0")]
|
||||
impl<T: fmt::Display> fmt::Display for Wrapping<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "wrapping_fmt", since = "1.11.0")]
|
||||
impl<T: fmt::Binary> fmt::Binary for Wrapping<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "wrapping_fmt", since = "1.11.0")]
|
||||
impl<T: fmt::Octal> fmt::Octal for Wrapping<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "wrapping_fmt", since = "1.11.0")]
|
||||
impl<T: fmt::LowerHex> fmt::LowerHex for Wrapping<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "wrapping_fmt", since = "1.11.0")]
|
||||
impl<T: fmt::UpperHex> fmt::UpperHex for Wrapping<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
@ -4423,7 +4423,7 @@ impl TryFromIntError {
|
||||
|
||||
#[stable(feature = "try_from", since = "1.34.0")]
|
||||
impl fmt::Display for TryFromIntError {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(fmt)
|
||||
}
|
||||
}
|
||||
@ -4820,7 +4820,7 @@ impl ParseIntError {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for ParseIntError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.__description().fmt(f)
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ pub struct RangeFull;
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Debug for RangeFull {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "..")
|
||||
}
|
||||
}
|
||||
@ -84,7 +84,7 @@ pub struct Range<Idx> {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.start.fmt(fmt)?;
|
||||
write!(fmt, "..")?;
|
||||
self.end.fmt(fmt)?;
|
||||
@ -186,7 +186,7 @@ pub struct RangeFrom<Idx> {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.start.fmt(fmt)?;
|
||||
write!(fmt, "..")?;
|
||||
Ok(())
|
||||
@ -270,7 +270,7 @@ pub struct RangeTo<Idx> {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl<Idx: fmt::Debug> fmt::Debug for RangeTo<Idx> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "..")?;
|
||||
self.end.fmt(fmt)?;
|
||||
Ok(())
|
||||
@ -473,7 +473,7 @@ impl<Idx> RangeInclusive<Idx> {
|
||||
|
||||
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
||||
impl<Idx: fmt::Debug> fmt::Debug for RangeInclusive<Idx> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.start.fmt(fmt)?;
|
||||
write!(fmt, "..=")?;
|
||||
self.end.fmt(fmt)?;
|
||||
@ -611,7 +611,7 @@ pub struct RangeToInclusive<Idx> {
|
||||
|
||||
#[stable(feature = "inclusive_range", since = "1.26.0")]
|
||||
impl<Idx: fmt::Debug> fmt::Debug for RangeToInclusive<Idx> {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "..=")?;
|
||||
self.end.fmt(fmt)?;
|
||||
Ok(())
|
||||
|
@ -538,7 +538,7 @@ impl<T> Option<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn iter(&self) -> Iter<T> {
|
||||
pub fn iter(&self) -> Iter<'_, T> {
|
||||
Iter { inner: Item { opt: self.as_ref() } }
|
||||
}
|
||||
|
||||
@ -559,7 +559,7 @@ impl<T> Option<T> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn iter_mut(&mut self) -> IterMut<T> {
|
||||
pub fn iter_mut(&mut self) -> IterMut<'_, T> {
|
||||
IterMut { inner: Item { opt: self.as_mut() } }
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ impl<'a> PanicInfo<'a> {
|
||||
///
|
||||
/// [`fmt::write`]: ../fmt/fn.write.html
|
||||
#[unstable(feature = "panic_info_message", issue = "44489")]
|
||||
pub fn message(&self) -> Option<&fmt::Arguments> {
|
||||
pub fn message(&self) -> Option<&fmt::Arguments<'_>> {
|
||||
self.message
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ impl<'a> PanicInfo<'a> {
|
||||
/// panic!("Normal panic");
|
||||
/// ```
|
||||
#[stable(feature = "panic_hooks", since = "1.10.0")]
|
||||
pub fn location(&self) -> Option<&Location> {
|
||||
pub fn location(&self) -> Option<&Location<'_>> {
|
||||
// NOTE: If this is changed to sometimes return None,
|
||||
// deal with that case in std::panicking::default_hook and std::panicking::begin_panic_fmt.
|
||||
Some(&self.location)
|
||||
@ -124,7 +124,7 @@ impl<'a> PanicInfo<'a> {
|
||||
|
||||
#[stable(feature = "panic_hook_display", since = "1.26.0")]
|
||||
impl fmt::Display for PanicInfo<'_> {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
formatter.write_str("panicked at ")?;
|
||||
if let Some(message) = self.message {
|
||||
write!(formatter, "'{}', ", message)?
|
||||
@ -249,7 +249,7 @@ impl<'a> Location<'a> {
|
||||
|
||||
#[stable(feature = "panic_hook_display", since = "1.26.0")]
|
||||
impl fmt::Display for Location<'_> {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(formatter, "{}:{}:{}", self.file, self.line, self.col)
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ fn panic_bounds_check(file_line_col: &(&'static str, u32, u32),
|
||||
#[cold]
|
||||
#[cfg_attr(not(feature="panic_immediate_abort"),inline(never))]
|
||||
#[cfg_attr( feature="panic_immediate_abort" ,inline)]
|
||||
pub fn panic_fmt(fmt: fmt::Arguments, file_line_col: &(&'static str, u32, u32)) -> ! {
|
||||
pub fn panic_fmt(fmt: fmt::Arguments<'_>, file_line_col: &(&'static str, u32, u32)) -> ! {
|
||||
if cfg!(feature = "panic_immediate_abort") {
|
||||
unsafe { super::intrinsics::abort() }
|
||||
}
|
||||
@ -74,7 +74,7 @@ pub fn panic_fmt(fmt: fmt::Arguments, file_line_col: &(&'static str, u32, u32))
|
||||
#[allow(improper_ctypes)] // PanicInfo contains a trait object which is not FFI safe
|
||||
extern "Rust" {
|
||||
#[lang = "panic_impl"]
|
||||
fn panic_impl(pi: &PanicInfo) -> !;
|
||||
fn panic_impl(pi: &PanicInfo<'_>) -> !;
|
||||
}
|
||||
|
||||
let (file, line, col) = *file_line_col;
|
||||
|
@ -602,21 +602,21 @@ impl<P: Receiver> Receiver for Pin<P> {}
|
||||
|
||||
#[stable(feature = "pin", since = "1.33.0")]
|
||||
impl<P: fmt::Debug> fmt::Debug for Pin<P> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Debug::fmt(&self.pointer, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "pin", since = "1.33.0")]
|
||||
impl<P: fmt::Display> fmt::Display for Pin<P> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Display::fmt(&self.pointer, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "pin", since = "1.33.0")]
|
||||
impl<P: fmt::Pointer> fmt::Pointer for Pin<P> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&self.pointer, f)
|
||||
}
|
||||
}
|
||||
|
@ -2623,14 +2623,14 @@ macro_rules! fnptr_impls_safety_abi {
|
||||
|
||||
#[stable(feature = "fnptr_impls", since = "1.4.0")]
|
||||
impl<Ret, $($Arg),*> fmt::Pointer for $FnTy {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&(*self as *const ()), f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "fnptr_impls", since = "1.4.0")]
|
||||
impl<Ret, $($Arg),*> fmt::Debug for $FnTy {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&(*self as *const ()), f)
|
||||
}
|
||||
}
|
||||
@ -2776,7 +2776,7 @@ pub struct Unique<T: ?Sized> {
|
||||
|
||||
#[unstable(feature = "ptr_internals", issue = "0")]
|
||||
impl<T: ?Sized> fmt::Debug for Unique<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&self.as_ptr(), f)
|
||||
}
|
||||
}
|
||||
@ -2876,7 +2876,7 @@ impl<T: ?Sized, U: ?Sized> DispatchFromDyn<Unique<U>> for Unique<T> where T: Uns
|
||||
|
||||
#[unstable(feature = "ptr_internals", issue = "0")]
|
||||
impl<T: ?Sized> fmt::Pointer for Unique<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&self.as_ptr(), f)
|
||||
}
|
||||
}
|
||||
@ -3049,14 +3049,14 @@ impl<T: ?Sized, U: ?Sized> DispatchFromDyn<NonNull<U>> for NonNull<T> where T: U
|
||||
|
||||
#[stable(feature = "nonnull", since = "1.25.0")]
|
||||
impl<T: ?Sized> fmt::Debug for NonNull<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&self.as_ptr(), f)
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "nonnull", since = "1.25.0")]
|
||||
impl<T: ?Sized> fmt::Pointer for NonNull<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&self.as_ptr(), f)
|
||||
}
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ impl<T, E> Result<T, E> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn iter(&self) -> Iter<T> {
|
||||
pub fn iter(&self) -> Iter<'_, T> {
|
||||
Iter { inner: self.as_ref().ok() }
|
||||
}
|
||||
|
||||
@ -569,7 +569,7 @@ impl<T, E> Result<T, E> {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn iter_mut(&mut self) -> IterMut<T> {
|
||||
pub fn iter_mut(&mut self) -> IterMut<'_, T> {
|
||||
IterMut { inner: self.as_mut().ok() }
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn iter(&self) -> Iter<T> {
|
||||
pub fn iter(&self) -> Iter<'_, T> {
|
||||
unsafe {
|
||||
let ptr = self.as_ptr();
|
||||
assume(!ptr.is_null());
|
||||
@ -556,7 +556,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn iter_mut(&mut self) -> IterMut<T> {
|
||||
pub fn iter_mut(&mut self) -> IterMut<'_, T> {
|
||||
unsafe {
|
||||
let ptr = self.as_mut_ptr();
|
||||
assume(!ptr.is_null());
|
||||
@ -603,7 +603,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn windows(&self, size: usize) -> Windows<T> {
|
||||
pub fn windows(&self, size: usize) -> Windows<'_, T> {
|
||||
assert!(size != 0);
|
||||
Windows { v: self, size }
|
||||
}
|
||||
@ -637,7 +637,7 @@ impl<T> [T] {
|
||||
/// [`rchunks`]: #method.rchunks
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn chunks(&self, chunk_size: usize) -> Chunks<T> {
|
||||
pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
Chunks { v: self, chunk_size }
|
||||
}
|
||||
@ -675,7 +675,7 @@ impl<T> [T] {
|
||||
/// [`rchunks_mut`]: #method.rchunks_mut
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<T> {
|
||||
pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
ChunksMut { v: self, chunk_size }
|
||||
}
|
||||
@ -712,7 +712,7 @@ impl<T> [T] {
|
||||
/// [`rchunks_exact`]: #method.rchunks_exact
|
||||
#[stable(feature = "chunks_exact", since = "1.31.0")]
|
||||
#[inline]
|
||||
pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<T> {
|
||||
pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
let rem = self.len() % chunk_size;
|
||||
let len = self.len() - rem;
|
||||
@ -757,7 +757,7 @@ impl<T> [T] {
|
||||
/// [`rchunks_exact_mut`]: #method.rchunks_exact_mut
|
||||
#[stable(feature = "chunks_exact", since = "1.31.0")]
|
||||
#[inline]
|
||||
pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<T> {
|
||||
pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
let rem = self.len() % chunk_size;
|
||||
let len = self.len() - rem;
|
||||
@ -794,7 +794,7 @@ impl<T> [T] {
|
||||
/// [`chunks`]: #method.chunks
|
||||
#[stable(feature = "rchunks", since = "1.31.0")]
|
||||
#[inline]
|
||||
pub fn rchunks(&self, chunk_size: usize) -> RChunks<T> {
|
||||
pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
RChunks { v: self, chunk_size }
|
||||
}
|
||||
@ -832,7 +832,7 @@ impl<T> [T] {
|
||||
/// [`chunks_mut`]: #method.chunks_mut
|
||||
#[stable(feature = "rchunks", since = "1.31.0")]
|
||||
#[inline]
|
||||
pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<T> {
|
||||
pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
RChunksMut { v: self, chunk_size }
|
||||
}
|
||||
@ -871,7 +871,7 @@ impl<T> [T] {
|
||||
/// [`chunks_exact`]: #method.chunks_exact
|
||||
#[stable(feature = "rchunks", since = "1.31.0")]
|
||||
#[inline]
|
||||
pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<T> {
|
||||
pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
let rem = self.len() % chunk_size;
|
||||
let (fst, snd) = self.split_at(rem);
|
||||
@ -916,7 +916,7 @@ impl<T> [T] {
|
||||
/// [`chunks_exact_mut`]: #method.chunks_exact_mut
|
||||
#[stable(feature = "rchunks", since = "1.31.0")]
|
||||
#[inline]
|
||||
pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<T> {
|
||||
pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T> {
|
||||
assert!(chunk_size != 0);
|
||||
let rem = self.len() % chunk_size;
|
||||
let (fst, snd) = self.split_at_mut(rem);
|
||||
@ -1042,7 +1042,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn split<F>(&self, pred: F) -> Split<T, F>
|
||||
pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
Split {
|
||||
@ -1067,7 +1067,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<T, F>
|
||||
pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
SplitMut { v: self, pred, finished: false }
|
||||
@ -1102,7 +1102,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "slice_rsplit", since = "1.27.0")]
|
||||
#[inline]
|
||||
pub fn rsplit<F>(&self, pred: F) -> RSplit<T, F>
|
||||
pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
RSplit { inner: self.split(pred) }
|
||||
@ -1127,7 +1127,7 @@ impl<T> [T] {
|
||||
///
|
||||
#[stable(feature = "slice_rsplit", since = "1.27.0")]
|
||||
#[inline]
|
||||
pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<T, F>
|
||||
pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
RSplitMut { inner: self.split_mut(pred) }
|
||||
@ -1154,7 +1154,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<T, F>
|
||||
pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
SplitN {
|
||||
@ -1184,7 +1184,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<T, F>
|
||||
pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
SplitNMut {
|
||||
@ -1217,7 +1217,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<T, F>
|
||||
pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
RSplitN {
|
||||
@ -1248,7 +1248,7 @@ impl<T> [T] {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<T, F>
|
||||
pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
|
||||
where F: FnMut(&T) -> bool
|
||||
{
|
||||
RSplitNMut {
|
||||
@ -3284,7 +3284,7 @@ pub struct Iter<'a, T: 'a> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_tuple("Iter")
|
||||
.field(&self.as_slice())
|
||||
.finish()
|
||||
@ -3386,7 +3386,7 @@ pub struct IterMut<'a, T: 'a> {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_tuple("IterMut")
|
||||
.field(&self.make_slice())
|
||||
.finish()
|
||||
@ -3493,7 +3493,7 @@ pub struct Split<'a, T:'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for Split<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Split")
|
||||
.field("v", &self.v)
|
||||
.field("finished", &self.finished)
|
||||
@ -3584,7 +3584,7 @@ pub struct SplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for SplitMut<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SplitMut")
|
||||
.field("v", &self.v)
|
||||
.field("finished", &self.finished)
|
||||
@ -3681,7 +3681,7 @@ pub struct RSplit<'a, T:'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "slice_rsplit", since = "1.27.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for RSplit<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("RSplit")
|
||||
.field("v", &self.inner.v)
|
||||
.field("finished", &self.inner.finished)
|
||||
@ -3737,7 +3737,7 @@ pub struct RSplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "slice_rsplit", since = "1.27.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for RSplitMut<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("RSplitMut")
|
||||
.field("v", &self.inner.v)
|
||||
.field("finished", &self.inner.finished)
|
||||
@ -3823,7 +3823,7 @@ pub struct SplitN<'a, T: 'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for SplitN<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SplitN")
|
||||
.field("inner", &self.inner)
|
||||
.finish()
|
||||
@ -3845,7 +3845,7 @@ pub struct RSplitN<'a, T: 'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for RSplitN<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("RSplitN")
|
||||
.field("inner", &self.inner)
|
||||
.finish()
|
||||
@ -3866,7 +3866,7 @@ pub struct SplitNMut<'a, T: 'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for SplitNMut<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SplitNMut")
|
||||
.field("inner", &self.inner)
|
||||
.finish()
|
||||
@ -3888,7 +3888,7 @@ pub struct RSplitNMut<'a, T: 'a, P> where P: FnMut(&T) -> bool {
|
||||
|
||||
#[stable(feature = "core_impl_debug", since = "1.9.0")]
|
||||
impl<T: fmt::Debug, P> fmt::Debug for RSplitNMut<'_, T, P> where P: FnMut(&T) -> bool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("RSplitNMut")
|
||||
.field("inner", &self.inner)
|
||||
.finish()
|
||||
|
@ -18,7 +18,7 @@ impl Utf8Lossy {
|
||||
unsafe { mem::transmute(bytes) }
|
||||
}
|
||||
|
||||
pub fn chunks(&self) -> Utf8LossyChunksIter {
|
||||
pub fn chunks(&self) -> Utf8LossyChunksIter<'_> {
|
||||
Utf8LossyChunksIter { source: &self.bytes }
|
||||
}
|
||||
}
|
||||
@ -138,7 +138,7 @@ impl<'a> Iterator for Utf8LossyChunksIter<'a> {
|
||||
|
||||
|
||||
impl fmt::Display for Utf8Lossy {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
// If we're the empty string then our iterator won't actually yield
|
||||
// anything, so perform the formatting manually
|
||||
if self.bytes.len() == 0 {
|
||||
@ -164,7 +164,7 @@ impl fmt::Display for Utf8Lossy {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Utf8Lossy {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_char('"')?;
|
||||
|
||||
for Utf8LossyChunk { valid, broken } in self.chunks() {
|
||||
|
@ -146,7 +146,7 @@ pub struct ParseBoolError { _priv: () }
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for ParseBoolError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
"provided string was not `true` or `false`".fmt(f)
|
||||
}
|
||||
}
|
||||
@ -439,7 +439,7 @@ pub unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str {
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Display for Utf8Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if let Some(error_len) = self.error_len {
|
||||
write!(f, "invalid utf-8 sequence of {} bytes from index {}",
|
||||
error_len, self.valid_up_to)
|
||||
@ -919,7 +919,7 @@ macro_rules! generate_pattern_iterators {
|
||||
impl<'a, P: Pattern<'a>> fmt::Debug for $forward_iterator<'a, P>
|
||||
where P::Searcher: fmt::Debug
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_tuple(stringify!($forward_iterator))
|
||||
.field(&self.0)
|
||||
.finish()
|
||||
@ -953,7 +953,7 @@ macro_rules! generate_pattern_iterators {
|
||||
impl<'a, P: Pattern<'a>> fmt::Debug for $reverse_iterator<'a, P>
|
||||
where P::Searcher: fmt::Debug
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_tuple(stringify!($reverse_iterator))
|
||||
.field(&self.0)
|
||||
.finish()
|
||||
@ -1038,7 +1038,7 @@ struct SplitInternal<'a, P: Pattern<'a>> {
|
||||
}
|
||||
|
||||
impl<'a, P: Pattern<'a>> fmt::Debug for SplitInternal<'a, P> where P::Searcher: fmt::Debug {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SplitInternal")
|
||||
.field("start", &self.start)
|
||||
.field("end", &self.end)
|
||||
@ -1155,7 +1155,7 @@ struct SplitNInternal<'a, P: Pattern<'a>> {
|
||||
}
|
||||
|
||||
impl<'a, P: Pattern<'a>> fmt::Debug for SplitNInternal<'a, P> where P::Searcher: fmt::Debug {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("SplitNInternal")
|
||||
.field("iter", &self.iter)
|
||||
.field("count", &self.count)
|
||||
@ -1211,7 +1211,7 @@ derive_pattern_clone!{
|
||||
struct MatchIndicesInternal<'a, P: Pattern<'a>>(P::Searcher);
|
||||
|
||||
impl<'a, P: Pattern<'a>> fmt::Debug for MatchIndicesInternal<'a, P> where P::Searcher: fmt::Debug {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_tuple("MatchIndicesInternal")
|
||||
.field(&self.0)
|
||||
.finish()
|
||||
@ -1262,7 +1262,7 @@ derive_pattern_clone!{
|
||||
struct MatchesInternal<'a, P: Pattern<'a>>(P::Searcher);
|
||||
|
||||
impl<'a, P: Pattern<'a>> fmt::Debug for MatchesInternal<'a, P> where P::Searcher: fmt::Debug {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_tuple("MatchesInternal")
|
||||
.field(&self.0)
|
||||
.finish()
|
||||
@ -2564,7 +2564,7 @@ impl str {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn chars(&self) -> Chars {
|
||||
pub fn chars(&self) -> Chars<'_> {
|
||||
Chars{iter: self.as_bytes().iter()}
|
||||
}
|
||||
|
||||
@ -2619,7 +2619,7 @@ impl str {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn char_indices(&self) -> CharIndices {
|
||||
pub fn char_indices(&self) -> CharIndices<'_> {
|
||||
CharIndices { front_offset: 0, iter: self.chars() }
|
||||
}
|
||||
|
||||
@ -2644,7 +2644,7 @@ impl str {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn bytes(&self) -> Bytes {
|
||||
pub fn bytes(&self) -> Bytes<'_> {
|
||||
Bytes(self.as_bytes().iter().cloned())
|
||||
}
|
||||
|
||||
@ -2687,7 +2687,7 @@ impl str {
|
||||
/// ```
|
||||
#[stable(feature = "split_whitespace", since = "1.1.0")]
|
||||
#[inline]
|
||||
pub fn split_whitespace(&self) -> SplitWhitespace {
|
||||
pub fn split_whitespace(&self) -> SplitWhitespace<'_> {
|
||||
SplitWhitespace { inner: self.split(IsWhitespace).filter(IsNotEmpty) }
|
||||
}
|
||||
|
||||
@ -2728,7 +2728,7 @@ impl str {
|
||||
/// ```
|
||||
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
|
||||
#[inline]
|
||||
pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace {
|
||||
pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_> {
|
||||
let inner = self
|
||||
.as_bytes()
|
||||
.split(IsAsciiWhitespace)
|
||||
@ -2775,7 +2775,7 @@ impl str {
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn lines(&self) -> Lines {
|
||||
pub fn lines(&self) -> Lines<'_> {
|
||||
Lines(self.split_terminator('\n').map(LinesAnyMap))
|
||||
}
|
||||
|
||||
@ -2784,7 +2784,7 @@ impl str {
|
||||
#[rustc_deprecated(since = "1.4.0", reason = "use lines() instead now")]
|
||||
#[inline]
|
||||
#[allow(deprecated)]
|
||||
pub fn lines_any(&self) -> LinesAny {
|
||||
pub fn lines_any(&self) -> LinesAny<'_> {
|
||||
LinesAny(self.lines())
|
||||
}
|
||||
|
||||
@ -2803,7 +2803,7 @@ impl str {
|
||||
/// assert!(utf16_len <= utf8_len);
|
||||
/// ```
|
||||
#[stable(feature = "encode_utf16", since = "1.8.0")]
|
||||
pub fn encode_utf16(&self) -> EncodeUtf16 {
|
||||
pub fn encode_utf16(&self) -> EncodeUtf16<'_> {
|
||||
EncodeUtf16 { chars: self.chars(), extra: 0 }
|
||||
}
|
||||
|
||||
@ -4023,7 +4023,7 @@ impl str {
|
||||
/// assert_eq!("❤\n!".escape_debug().to_string(), "❤\\n!");
|
||||
/// ```
|
||||
#[stable(feature = "str_escape", since = "1.34.0")]
|
||||
pub fn escape_debug(&self) -> EscapeDebug {
|
||||
pub fn escape_debug(&self) -> EscapeDebug<'_> {
|
||||
let mut chars = self.chars();
|
||||
EscapeDebug {
|
||||
inner: chars.next()
|
||||
@ -4068,7 +4068,7 @@ impl str {
|
||||
/// assert_eq!("❤\n!".escape_default().to_string(), "\\u{2764}\\n!");
|
||||
/// ```
|
||||
#[stable(feature = "str_escape", since = "1.34.0")]
|
||||
pub fn escape_default(&self) -> EscapeDefault {
|
||||
pub fn escape_default(&self) -> EscapeDefault<'_> {
|
||||
EscapeDefault { inner: self.chars().flat_map(CharEscapeDefault) }
|
||||
}
|
||||
|
||||
@ -4106,7 +4106,7 @@ impl str {
|
||||
/// assert_eq!("❤\n!".escape_unicode().to_string(), "\\u{2764}\\u{a}\\u{21}");
|
||||
/// ```
|
||||
#[stable(feature = "str_escape", since = "1.34.0")]
|
||||
pub fn escape_unicode(&self) -> EscapeUnicode {
|
||||
pub fn escape_unicode(&self) -> EscapeUnicode<'_> {
|
||||
EscapeUnicode { inner: self.chars().flat_map(CharEscapeUnicode) }
|
||||
}
|
||||
}
|
||||
@ -4272,7 +4272,7 @@ pub struct EncodeUtf16<'a> {
|
||||
|
||||
#[stable(feature = "collection_debug", since = "1.17.0")]
|
||||
impl fmt::Debug for EncodeUtf16<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.pad("EncodeUtf16 { .. }")
|
||||
}
|
||||
}
|
||||
@ -4346,7 +4346,7 @@ macro_rules! escape_types_impls {
|
||||
($( $Name: ident ),+) => {$(
|
||||
#[stable(feature = "str_escape", since = "1.34.0")]
|
||||
impl<'a> fmt::Display for $Name<'a> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.clone().try_for_each(|c| f.write_char(c))
|
||||
}
|
||||
}
|
||||
|
@ -658,7 +658,7 @@ pub struct CharPredicateSearcher<'a, F>(<MultiCharEqPattern<F> as Pattern<'a>>::
|
||||
impl<F> fmt::Debug for CharPredicateSearcher<'_, F>
|
||||
where F: FnMut(char) -> bool
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("CharPredicateSearcher")
|
||||
.field("haystack", &self.0.haystack)
|
||||
.field("char_indices", &self.0.char_indices)
|
||||
|
@ -1193,7 +1193,7 @@ macro_rules! atomic_int {
|
||||
|
||||
#[$stable_debug]
|
||||
impl fmt::Debug for $atomic_type {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Debug::fmt(&self.load(Ordering::SeqCst), f)
|
||||
}
|
||||
}
|
||||
@ -2506,7 +2506,7 @@ pub fn compiler_fence(order: Ordering) {
|
||||
#[cfg(target_has_atomic = "8")]
|
||||
#[stable(feature = "atomic_debug", since = "1.3.0")]
|
||||
impl fmt::Debug for AtomicBool {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Debug::fmt(&self.load(Ordering::SeqCst), f)
|
||||
}
|
||||
}
|
||||
@ -2514,7 +2514,7 @@ impl fmt::Debug for AtomicBool {
|
||||
#[cfg(target_has_atomic = "ptr")]
|
||||
#[stable(feature = "atomic_debug", since = "1.3.0")]
|
||||
impl<T> fmt::Debug for AtomicPtr<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Debug::fmt(&self.load(Ordering::SeqCst), f)
|
||||
}
|
||||
}
|
||||
@ -2522,7 +2522,7 @@ impl<T> fmt::Debug for AtomicPtr<T> {
|
||||
#[cfg(target_has_atomic = "ptr")]
|
||||
#[stable(feature = "atomic_pointer", since = "1.24.0")]
|
||||
impl<T> fmt::Pointer for AtomicPtr<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Pointer::fmt(&self.load(Ordering::SeqCst), f)
|
||||
}
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ impl<'a> Context<'a> {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Context<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Context")
|
||||
.field("waker", &self.waker)
|
||||
.finish()
|
||||
@ -283,7 +283,7 @@ impl Drop for Waker {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Waker {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let vtable_ptr = self.waker.vtable as *const RawWakerVTable;
|
||||
f.debug_struct("Waker")
|
||||
.field("data", &self.waker.data)
|
||||
|
@ -847,7 +847,7 @@ impl<'a> Sum<&'a Duration> for Duration {
|
||||
|
||||
#[stable(feature = "duration_debug_impl", since = "1.27.0")]
|
||||
impl fmt::Debug for Duration {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
/// Formats a floating point number in decimal notation.
|
||||
///
|
||||
/// The number is given as the `integer_part` and a fractional part.
|
||||
@ -859,7 +859,7 @@ impl fmt::Debug for Duration {
|
||||
/// of 10, everything else doesn't make sense. `fractional_part` has
|
||||
/// to be less than `10 * divisor`!
|
||||
fn fmt_decimal(
|
||||
f: &mut fmt::Formatter,
|
||||
f: &mut fmt::Formatter<'_>,
|
||||
mut integer_part: u64,
|
||||
mut fractional_part: u32,
|
||||
mut divisor: u32,
|
||||
|
Loading…
x
Reference in New Issue
Block a user