@@ -113,7 +113,6 @@ impl<'a> Arguments<'a> {
113
113
/// Arguments structure. The compiler inserts an `unsafe` block to call this,
114
114
/// which is valid because the compiler performs all necessary validation to
115
115
/// ensure that the resulting call to format/write would be safe.
116
- #[ cfg( not( stage0) ) ]
117
116
#[ doc( hidden) ] #[ inline]
118
117
pub unsafe fn new < ' a > ( pieces : & ' static [ & ' static str ] ,
119
118
args : & ' a [ Argument < ' a > ] ) -> Arguments < ' a > {
@@ -127,7 +126,6 @@ impl<'a> Arguments<'a> {
127
126
/// This function is used to specify nonstandard formatting parameters.
128
127
/// The `pieces` array must be at least as long as `fmt` to construct
129
128
/// a valid Arguments structure.
130
- #[ cfg( not( stage0) ) ]
131
129
#[ doc( hidden) ] #[ inline]
132
130
pub unsafe fn with_placeholders < ' a > ( pieces : & ' static [ & ' static str ] ,
133
131
fmt : & ' static [ rt:: Argument < ' static > ] ,
@@ -138,13 +136,6 @@ impl<'a> Arguments<'a> {
138
136
args : args
139
137
}
140
138
}
141
-
142
- #[ cfg( stage0) ]
143
- #[ doc( hidden) ] #[ inline]
144
- pub unsafe fn new < ' a > ( fmt : & ' static [ rt:: Piece < ' static > ] ,
145
- args : & ' a [ Argument < ' a > ] ) -> Arguments < ' a > {
146
- Arguments { fmt : mem:: transmute ( fmt) , args : args }
147
- }
148
139
}
149
140
150
141
/// This structure represents a safely precompiled version of a format string
@@ -156,7 +147,6 @@ impl<'a> Arguments<'a> {
156
147
/// and pass it to a function or closure, passed as the first argument. The
157
148
/// macro validates the format string at compile-time so usage of the `write`
158
149
/// and `format` functions can be safely performed.
159
- #[ cfg( not( stage0) ) ]
160
150
pub struct Arguments < ' a > {
161
151
// Format string pieces to print.
162
152
pieces : & ' a [ & ' a str ] ,
@@ -169,12 +159,6 @@ pub struct Arguments<'a> {
169
159
args : & ' a [ Argument < ' a > ] ,
170
160
}
171
161
172
- #[ cfg( stage0) ] #[ doc( hidden) ]
173
- pub struct Arguments < ' a > {
174
- fmt : & ' a [ rt:: Piece < ' a > ] ,
175
- args : & ' a [ Argument < ' a > ] ,
176
- }
177
-
178
162
impl < ' a > Show for Arguments < ' a > {
179
163
fn fmt ( & self , fmt : & mut Formatter ) -> Result {
180
164
write ( fmt. buf , self )
@@ -296,7 +280,6 @@ uniform_fn_call_workaround! {
296
280
secret_upper_exp, UpperExp ;
297
281
}
298
282
299
- #[ cfg( not( stage0) ) ]
300
283
static DEFAULT_ARGUMENT : rt:: Argument < ' static > = rt:: Argument {
301
284
position : rt:: ArgumentNext ,
302
285
format : rt:: FormatSpec {
@@ -316,7 +299,6 @@ static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
316
299
///
317
300
/// * output - the buffer to write output to
318
301
/// * args - the precompiled arguments generated by `format_args!`
319
- #[ cfg( not( stage0) ) ]
320
302
pub fn write ( output : & mut FormatWriter , args : & Arguments ) -> Result {
321
303
let mut formatter = Formatter {
322
304
flags : 0 ,
@@ -360,30 +342,11 @@ pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
360
342
Ok ( ( ) )
361
343
}
362
344
363
- #[ cfg( stage0) ] #[ doc( hidden) ]
364
- pub fn write ( output : & mut FormatWriter , args : & Arguments ) -> Result {
365
- let mut formatter = Formatter {
366
- flags : 0 ,
367
- width : None ,
368
- precision : None ,
369
- buf : output,
370
- align : rt:: AlignUnknown ,
371
- fill : ' ' ,
372
- args : args. args ,
373
- curarg : args. args . iter ( ) ,
374
- } ;
375
- for piece in args. fmt . iter ( ) {
376
- try!( formatter. run ( piece) ) ;
377
- }
378
- Ok ( ( ) )
379
- }
380
-
381
345
impl < ' a > Formatter < ' a > {
382
346
383
347
// First up is the collection of functions used to execute a format string
384
348
// at runtime. This consumes all of the compile-time statics generated by
385
349
// the format! syntax extension.
386
- #[ cfg( not( stage0) ) ]
387
350
fn run ( & mut self , arg : & rt:: Argument ) -> Result {
388
351
// Fill in the format parameters into the formatter
389
352
self . fill = arg. format . fill ;
@@ -402,30 +365,6 @@ impl<'a> Formatter<'a> {
402
365
( value. formatter ) ( value. value , self )
403
366
}
404
367
405
- #[ cfg( stage0) ] #[ doc( hidden) ]
406
- fn run ( & mut self , piece : & rt:: Piece ) -> Result {
407
- match * piece {
408
- rt:: String ( s) => self . buf . write ( s. as_bytes ( ) ) ,
409
- rt:: Argument ( ref arg) => {
410
- // Fill in the format parameters into the formatter
411
- self . fill = arg. format . fill ;
412
- self . align = arg. format . align ;
413
- self . flags = arg. format . flags ;
414
- self . width = self . getcount ( & arg. format . width ) ;
415
- self . precision = self . getcount ( & arg. format . precision ) ;
416
-
417
- // Extract the correct argument
418
- let value = match arg. position {
419
- rt:: ArgumentNext => { * self . curarg . next ( ) . unwrap ( ) }
420
- rt:: ArgumentIs ( i) => self . args [ i] ,
421
- } ;
422
-
423
- // Then actually do some printing
424
- ( value. formatter ) ( value. value , self )
425
- }
426
- }
427
- }
428
-
429
368
fn getcount ( & mut self , cnt : & rt:: Count ) -> Option < uint > {
430
369
match * cnt {
431
370
rt:: CountIs ( n) => { Some ( n) }
0 commit comments