File tree Expand file tree Collapse file tree 4 files changed +10
-19
lines changed Expand file tree Collapse file tree 4 files changed +10
-19
lines changed Original file line number Diff line number Diff line change 21
21
//! the extension traits (`*Ext`) for the full details.
22
22
23
23
use cast:: { transmute, transmute_copy} ;
24
- use fmt;
25
24
use option:: { Option , Some , None } ;
26
25
use owned:: Box ;
27
26
use raw:: TraitObject ;
@@ -145,22 +144,6 @@ impl AnyOwnExt for Box<Any> {
145
144
}
146
145
}
147
146
148
- ///////////////////////////////////////////////////////////////////////////////
149
- // Trait implementations
150
- ///////////////////////////////////////////////////////////////////////////////
151
-
152
- impl fmt:: Show for Box < Any > {
153
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
154
- f. pad ( "Box<Any>" )
155
- }
156
- }
157
-
158
- impl < ' a > fmt:: Show for & ' a Any {
159
- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
160
- f. pad ( "&Any" )
161
- }
162
- }
163
-
164
147
#[ cfg( test) ]
165
148
mod tests {
166
149
use prelude:: * ;
Original file line number Diff line number Diff line change @@ -37,5 +37,6 @@ pub mod container;
37
37
38
38
/* Core types and methods on primitives */
39
39
40
+ pub mod any;
40
41
pub mod finally;
41
42
pub mod char;
Original file line number Diff line number Diff line change @@ -1242,6 +1242,14 @@ impl<T> Show for *mut T {
1242
1242
fn fmt ( & self , f : & mut Formatter ) -> Result { secret_pointer ( self , f) }
1243
1243
}
1244
1244
1245
+ impl Show for Box < any:: Any > {
1246
+ fn fmt ( & self , f : & mut Formatter ) -> Result { f. pad ( "Box<Any>" ) }
1247
+ }
1248
+
1249
+ impl < ' a > Show for & ' a any:: Any {
1250
+ fn fmt ( & self , f : & mut Formatter ) -> Result { f. pad ( "&Any" ) }
1251
+ }
1252
+
1245
1253
impl Show for TypeId {
1246
1254
fn fmt ( & self , f : & mut Formatter ) -> Result {
1247
1255
write ! ( f. buf, "TypeId \\ { {} \\ }" , self . hash( ) )
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ extern crate core;
137
137
#[ cfg( not( test) ) ] pub use ops = core:: ops;
138
138
#[ cfg( not( test) ) ] pub use ty = core:: ty;
139
139
140
+ pub use core:: any;
140
141
pub use core:: cast;
141
142
pub use core:: char;
142
143
pub use core:: container;
@@ -218,8 +219,6 @@ pub mod iter;
218
219
pub mod to_str;
219
220
pub mod clone;
220
221
pub mod hash;
221
- pub mod default;
222
- pub mod any;
223
222
224
223
/* Common data structures */
225
224
You can’t perform that action at this time.
0 commit comments