From: Guillaume Gomez Date: Fri, 20 Jan 2017 12:09:19 +0000 (+0100) Subject: Remove specialization from Debug implementations X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=50d36fb80f1aabd100b597e903c8095743a32eb4;p=rust.git Remove specialization from Debug implementations --- diff --git a/src/librand/distributions/mod.rs b/src/librand/distributions/mod.rs index fb0c9f17cf3..eb9476efb7b 100644 --- a/src/librand/distributions/mod.rs +++ b/src/librand/distributions/mod.rs @@ -94,12 +94,6 @@ pub struct Weighted { pub item: T, } -impl fmt::Debug for Weighted { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("Weighted") - } -} - impl fmt::Debug for Weighted { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Weighted") @@ -212,12 +206,6 @@ fn ind_sample(&self, rng: &mut R) -> T { } } -impl<'a, T> fmt::Debug for WeightedChoice<'a, T> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("WeightedChoice") - } -} - impl<'a, T: fmt::Debug> fmt::Debug for WeightedChoice<'a, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("WeightedChoice") diff --git a/src/librand/distributions/range.rs b/src/librand/distributions/range.rs index 0df876fb16f..be238b0b1ab 100644 --- a/src/librand/distributions/range.rs +++ b/src/librand/distributions/range.rs @@ -58,12 +58,6 @@ fn ind_sample(&self, rng: &mut R) -> Sup { } } -impl fmt::Debug for Range { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("Range { .. }") - } -} - impl fmt::Debug for Range { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Range") diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 888f0bc9b55..f2b43a20f94 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -291,12 +291,6 @@ fn next(&mut self) -> Option { } } -impl<'a, T, R> fmt::Debug for Generator<'a, T, R> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("Generator { .. }") - } -} - impl<'a, T, R: fmt::Debug> fmt::Debug for Generator<'a, T, R> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Generator") @@ -323,12 +317,6 @@ fn next(&mut self) -> Option { } } -impl<'a, R> fmt::Debug for AsciiGenerator<'a, R> { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("AsciiGenerator { .. }") - } -} - impl<'a, R: fmt::Debug> fmt::Debug for AsciiGenerator<'a, R> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("AsciiGenerator") @@ -446,12 +434,6 @@ fn rand(rng: &mut R) -> XorShiftRng { /// `[0,1)`. pub struct Open01(pub F); -impl fmt::Debug for Open01 { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("Open01 { .. }") - } -} - impl fmt::Debug for Open01 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("Open01") @@ -468,12 +450,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { /// `[0,1)`. pub struct Closed01(pub F); -impl fmt::Debug for Closed01 { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("Closed01 { .. }") - } -} - impl fmt::Debug for Closed01 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("Closed01") diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs index 89ed53f76a1..21684e38f7b 100644 --- a/src/librand/reseeding.rs +++ b/src/librand/reseeding.rs @@ -95,14 +95,8 @@ fn from_seed((rsdr, seed): (Rsdr, S)) -> ReseedingRng { } } -impl fmt::Debug for ReseedingRng { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("ReseedingRng { .. }") - } -} - impl fmt::Debug for ReseedingRng { - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ReseedingRng") .field("rng", &self.rng) .field("generation_threshold", &self.generation_threshold)