From fb094642e13fc7b41a55aa2eaba4361411cccf8f Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Wed, 22 Nov 2017 00:49:28 +0000 Subject: [PATCH] Add missing Debug impls to std_unicode Also adds #![deny(missing_debug_implementations)] so they don't get missed again. --- src/libstd_unicode/char.rs | 5 ++++- src/libstd_unicode/lib.rs | 1 + src/libstd_unicode/lossy.rs | 1 + src/libstd_unicode/u_str.rs | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libstd_unicode/char.rs b/src/libstd_unicode/char.rs index e20937c6c7b..0faf5bd9121 100644 --- a/src/libstd_unicode/char.rs +++ b/src/libstd_unicode/char.rs @@ -57,6 +57,7 @@ /// [`to_lowercase`]: ../../std/primitive.char.html#method.to_lowercase /// [`char`]: ../../std/primitive.char.html #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Debug)] pub struct ToLowercase(CaseMappingIter); #[stable(feature = "rust1", since = "1.0.0")] @@ -78,6 +79,7 @@ impl FusedIterator for ToLowercase {} /// [`to_uppercase`]: ../../std/primitive.char.html#method.to_uppercase /// [`char`]: ../../std/primitive.char.html #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Debug)] pub struct ToUppercase(CaseMappingIter); #[stable(feature = "rust1", since = "1.0.0")] @@ -91,6 +93,7 @@ fn next(&mut self) -> Option { #[unstable(feature = "fused", issue = "35602")] impl FusedIterator for ToUppercase {} +#[derive(Debug)] enum CaseMappingIter { Three(char, char, char), Two(char, char), @@ -1450,7 +1453,7 @@ pub fn is_ascii_control(&self) -> bool { /// An iterator that decodes UTF-16 encoded code points from an iterator of `u16`s. #[stable(feature = "decode_utf16", since = "1.9.0")] -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct DecodeUtf16 where I: Iterator { diff --git a/src/libstd_unicode/lib.rs b/src/libstd_unicode/lib.rs index 65058b6554a..22f8bdab2f7 100644 --- a/src/libstd_unicode/lib.rs +++ b/src/libstd_unicode/lib.rs @@ -28,6 +28,7 @@ issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/", test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))] #![deny(warnings)] +#![deny(missing_debug_implementations)] #![no_std] #![feature(ascii_ctype)] diff --git a/src/libstd_unicode/lossy.rs b/src/libstd_unicode/lossy.rs index 253dcb6a159..cc8e93308a5 100644 --- a/src/libstd_unicode/lossy.rs +++ b/src/libstd_unicode/lossy.rs @@ -38,6 +38,7 @@ pub fn chunks(&self) -> Utf8LossyChunksIter { /// Iterator over lossy UTF-8 string #[unstable(feature = "str_internals", issue = "0")] +#[allow(missing_debug_implementations)] pub struct Utf8LossyChunksIter<'a> { source: &'a [u8], } diff --git a/src/libstd_unicode/u_str.rs b/src/libstd_unicode/u_str.rs index 0046e3f7bd0..5d1611acb7e 100644 --- a/src/libstd_unicode/u_str.rs +++ b/src/libstd_unicode/u_str.rs @@ -76,6 +76,7 @@ fn trim_right(&self) -> &str { /// Iterator adaptor for encoding `char`s to UTF-16. #[derive(Clone)] +#[allow(missing_debug_implementations)] pub struct Utf16Encoder { chars: I, extra: u16, -- 2.44.0