Implement Debug for Map and RawMap.
This commit is contained in:
parent
7606e75aa4
commit
ecb4c45060
10
src/any.rs
10
src/any.rs
|
@ -116,15 +116,9 @@ pub trait IntoBox<A: ?Sized + UncheckedAnyExt>: Any {
|
||||||
|
|
||||||
macro_rules! implement {
|
macro_rules! implement {
|
||||||
($base:ident, $(+ $bounds:ident)*) => {
|
($base:ident, $(+ $bounds:ident)*) => {
|
||||||
impl<'a> fmt::Debug for &'a ($base $(+ $bounds)*) {
|
impl fmt::Debug for $base $(+ $bounds)* {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.pad(stringify!(&($base $(+ $bounds)*)))
|
f.pad(stringify!($base $(+ $bounds)*))
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> fmt::Debug for Box<$base $(+ $bounds)*> {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
f.pad(stringify!(Box<$base $(+ $bounds)*>))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -427,10 +427,15 @@ mod tests {
|
||||||
fn assert_send<T: Send>() { }
|
fn assert_send<T: Send>() { }
|
||||||
fn assert_sync<T: Sync>() { }
|
fn assert_sync<T: Sync>() { }
|
||||||
fn assert_clone<T: Clone>() { }
|
fn assert_clone<T: Clone>() { }
|
||||||
|
fn assert_debug<T: ::std::fmt::Debug>() { }
|
||||||
assert_send::<Map<Any + Send>>();
|
assert_send::<Map<Any + Send>>();
|
||||||
assert_send::<Map<Any + Send + Sync>>();
|
assert_send::<Map<Any + Send + Sync>>();
|
||||||
assert_sync::<Map<Any + Sync>>();
|
assert_sync::<Map<Any + Sync>>();
|
||||||
assert_sync::<Map<Any + Send + Sync>>();
|
assert_sync::<Map<Any + Send + Sync>>();
|
||||||
|
assert_debug::<Map<Any>>();
|
||||||
|
assert_debug::<Map<Any + Send>>();
|
||||||
|
assert_debug::<Map<Any + Sync>>();
|
||||||
|
assert_debug::<Map<Any + Send + Sync>>();
|
||||||
assert_send::<Map<CloneAny + Send>>();
|
assert_send::<Map<CloneAny + Send>>();
|
||||||
assert_send::<Map<CloneAny + Send + Sync>>();
|
assert_send::<Map<CloneAny + Send + Sync>>();
|
||||||
assert_sync::<Map<CloneAny + Sync>>();
|
assert_sync::<Map<CloneAny + Sync>>();
|
||||||
|
@ -439,5 +444,9 @@ mod tests {
|
||||||
assert_clone::<Map<CloneAny + Send + Sync>>();
|
assert_clone::<Map<CloneAny + Send + Sync>>();
|
||||||
assert_clone::<Map<CloneAny + Sync>>();
|
assert_clone::<Map<CloneAny + Sync>>();
|
||||||
assert_clone::<Map<CloneAny + Send + Sync>>();
|
assert_clone::<Map<CloneAny + Send + Sync>>();
|
||||||
|
assert_debug::<Map<CloneAny>>();
|
||||||
|
assert_debug::<Map<CloneAny + Send>>();
|
||||||
|
assert_debug::<Map<CloneAny + Sync>>();
|
||||||
|
assert_debug::<Map<CloneAny + Send + Sync>>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue