@@ -166,7 +166,9 @@ pub struct Formatter<'a> {
166
166
// NB. Argument is essentially an optimized partially applied formatting function,
167
167
// equivalent to `exists T.(&T, fn(&T, &mut Formatter) -> Result`.
168
168
169
- enum Void { }
169
+ struct Void {
170
+ _private : ( ) ,
171
+ }
170
172
171
173
/// This struct represents the generic "argument" which is taken by the Xprintf
172
174
/// family of functions. It contains a function to format the given value. At
@@ -178,9 +180,8 @@ enum Void {}
178
180
issue = "0" ) ]
179
181
#[ doc( hidden) ]
180
182
pub struct ArgumentV1 < ' a > {
181
- _ph : PhantomData < & ' a ( ) > ,
182
- value : * const Void ,
183
- formatter : fn ( * const Void , & mut Formatter ) -> Result ,
183
+ value : & ' a Void ,
184
+ formatter : fn ( & Void , & mut Formatter ) -> Result ,
184
185
}
185
186
186
187
#[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" ,
@@ -204,7 +205,6 @@ impl<'a> ArgumentV1<'a> {
204
205
f : fn ( & T , & mut Formatter ) -> Result ) -> ArgumentV1 < ' b > {
205
206
unsafe {
206
207
ArgumentV1 {
207
- _ph : PhantomData ,
208
208
formatter : mem:: transmute ( f) ,
209
209
value : mem:: transmute ( x)
210
210
}
@@ -220,7 +220,7 @@ impl<'a> ArgumentV1<'a> {
220
220
221
221
fn as_usize ( & self ) -> Option < usize > {
222
222
if self . formatter as usize == ArgumentV1 :: show_usize as usize {
223
- Some ( unsafe { * ( self . value as * const usize ) } )
223
+ Some ( unsafe { * ( self . value as * const _ as * const usize ) } )
224
224
} else {
225
225
None
226
226
}
0 commit comments