@@ -113,7 +113,6 @@ impl<'a> Arguments<'a> {
113113 /// Arguments structure. The compiler inserts an `unsafe` block to call this,
114114 /// which is valid because the compiler performs all necessary validation to
115115 /// ensure that the resulting call to format/write would be safe.
116- #[ cfg( not( stage0) ) ]
117116 #[ doc( hidden) ] #[ inline]
118117 pub unsafe fn new < ' a > ( pieces : & ' static [ & ' static str ] ,
119118 args : & ' a [ Argument < ' a > ] ) -> Arguments < ' a > {
@@ -127,7 +126,6 @@ impl<'a> Arguments<'a> {
127126 /// This function is used to specify nonstandard formatting parameters.
128127 /// The `pieces` array must be at least as long as `fmt` to construct
129128 /// a valid Arguments structure.
130- #[ cfg( not( stage0) ) ]
131129 #[ doc( hidden) ] #[ inline]
132130 pub unsafe fn with_placeholders < ' a > ( pieces : & ' static [ & ' static str ] ,
133131 fmt : & ' static [ rt:: Argument < ' static > ] ,
@@ -138,13 +136,6 @@ impl<'a> Arguments<'a> {
138136 args : args
139137 }
140138 }
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- }
148139}
149140
150141/// This structure represents a safely precompiled version of a format string
@@ -156,7 +147,6 @@ impl<'a> Arguments<'a> {
156147/// and pass it to a function or closure, passed as the first argument. The
157148/// macro validates the format string at compile-time so usage of the `write`
158149/// and `format` functions can be safely performed.
159- #[ cfg( not( stage0) ) ]
160150pub struct Arguments < ' a > {
161151 // Format string pieces to print.
162152 pieces : & ' a [ & ' a str ] ,
@@ -169,12 +159,6 @@ pub struct Arguments<'a> {
169159 args : & ' a [ Argument < ' a > ] ,
170160}
171161
172- #[ cfg( stage0) ] #[ doc( hidden) ]
173- pub struct Arguments < ' a > {
174- fmt : & ' a [ rt:: Piece < ' a > ] ,
175- args : & ' a [ Argument < ' a > ] ,
176- }
177-
178162impl < ' a > Show for Arguments < ' a > {
179163 fn fmt ( & self , fmt : & mut Formatter ) -> Result {
180164 write ( fmt. buf , self )
@@ -296,7 +280,6 @@ uniform_fn_call_workaround! {
296280 secret_upper_exp, UpperExp ;
297281}
298282
299- #[ cfg( not( stage0) ) ]
300283static DEFAULT_ARGUMENT : rt:: Argument < ' static > = rt:: Argument {
301284 position : rt:: ArgumentNext ,
302285 format : rt:: FormatSpec {
@@ -316,7 +299,6 @@ static DEFAULT_ARGUMENT: rt::Argument<'static> = rt::Argument {
316299///
317300/// * output - the buffer to write output to
318301/// * args - the precompiled arguments generated by `format_args!`
319- #[ cfg( not( stage0) ) ]
320302pub fn write ( output : & mut FormatWriter , args : & Arguments ) -> Result {
321303 let mut formatter = Formatter {
322304 flags : 0 ,
@@ -360,30 +342,11 @@ pub fn write(output: &mut FormatWriter, args: &Arguments) -> Result {
360342 Ok ( ( ) )
361343}
362344
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-
381345impl < ' a > Formatter < ' a > {
382346
383347 // First up is the collection of functions used to execute a format string
384348 // at runtime. This consumes all of the compile-time statics generated by
385349 // the format! syntax extension.
386- #[ cfg( not( stage0) ) ]
387350 fn run ( & mut self , arg : & rt:: Argument ) -> Result {
388351 // Fill in the format parameters into the formatter
389352 self . fill = arg. format . fill ;
@@ -402,30 +365,6 @@ impl<'a> Formatter<'a> {
402365 ( value. formatter ) ( value. value , self )
403366 }
404367
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-
429368 fn getcount ( & mut self , cnt : & rt:: Count ) -> Option < uint > {
430369 match * cnt {
431370 rt:: CountIs ( n) => { Some ( n) }
0 commit comments