Chris Morgan
›
Git
›
anymap
› commitdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
patch
|
inline
| side by side (parent:
7606e75
)
commit
grep
author
committer
pickaxe
?
search:
re
Implement Debug for Map and RawMap.
author
Chris Morgan
<me@chrismorgan.info>
Sat, 25 Apr 2015 09:28:12 +0000
committer
Chris Morgan
<me@chrismorgan.info>
Tue, 9 Jun 2015 23:02:10 +0000
src/any.rs
patch
|
blob
|
history
src/lib.rs
patch
|
blob
|
history
diff --git
a/src/any.rs
b/src/any.rs
index 45ad5cccc98dd59ba7309fcde048469e062d261d..5b5e6e65f936d11f5df8f6cbe2d99229a2cb3fce 100644
(file)
--- a/
src/any.rs
+++ b/
src/any.rs
@@
-116,15
+116,9
@@
pub trait IntoBox<A: ?Sized + UncheckedAnyExt>: Any {
macro_rules! implement {
($base:ident, $(+ $bounds:ident)*) => {
macro_rules! implement {
($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)*)))
- }
- }
-
- impl<'a> fmt::Debug for Box<$base $(+ $bounds)*> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- f.pad(stringify!(Box<$base $(+ $bounds)*>))
+ f.pad(stringify!($base $(+ $bounds)*))
}
}
}
}
diff --git
a/src/lib.rs
b/src/lib.rs
index 8e83babc6336be0b566c0dc8bf7cdb98f9c2ed3e..4bc330f9d0c02097ed36fffc0b094604b0d59d1b 100644
(file)
--- a/
src/lib.rs
+++ b/
src/lib.rs
@@
-427,10
+427,15
@@
mod tests {
fn assert_send<T: Send>() { }
fn assert_sync<T: Sync>() { }
fn assert_clone<T: Clone>() { }
fn assert_send<T: Send>() { }
fn assert_sync<T: Sync>() { }
fn assert_clone<T: Clone>() { }
+ fn assert_debug<T: ::std::fmt::Debug>() { }
assert_send::<Map<Any + Send>>();
assert_send::<Map<Any + Send + Sync>>();
assert_sync::<Map<Any + Sync>>();
assert_sync::<Map<Any + Send + Sync>>();
assert_send::<Map<Any + Send>>();
assert_send::<Map<Any + Send + Sync>>();
assert_sync::<Map<Any + 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 + Sync>>();
assert_sync::<Map<CloneAny + Sync>>();
assert_send::<Map<CloneAny + Send>>();
assert_send::<Map<CloneAny + Send + Sync>>();
assert_sync::<Map<CloneAny + Sync>>();
@@
-439,5
+444,9
@@
mod tests {
assert_clone::<Map<CloneAny + Send + Sync>>();
assert_clone::<Map<CloneAny + Sync>>();
assert_clone::<Map<CloneAny + Send + Sync>>();
assert_clone::<Map<CloneAny + Send + Sync>>();
assert_clone::<Map<CloneAny + 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>>();
}
}
}
}