@@ -250,37 +250,6 @@ pub trait UpperExp for Sized? {
250
250
fn fmt ( & self , & mut Formatter ) -> Result ;
251
251
}
252
252
253
- // NOTE(stage0): Remove macro after next snapshot
254
- #[ cfg( stage0) ]
255
- macro_rules! uniform_fn_call_workaround {
256
- ( $( $name: ident, $trait_: ident; ) * ) => {
257
- $(
258
- #[ doc( hidden) ]
259
- pub fn $name<Sized ? T : $trait_>( x: & T , fmt: & mut Formatter ) -> Result {
260
- x. fmt( fmt)
261
- }
262
- ) *
263
- }
264
- }
265
- // NOTE(stage0): Remove macro after next snapshot
266
- #[ cfg( stage0) ]
267
- uniform_fn_call_workaround ! {
268
- secret_show, Show ;
269
- secret_bool, Bool ;
270
- secret_char, Char ;
271
- secret_signed, Signed ;
272
- secret_unsigned, Unsigned ;
273
- secret_octal, Octal ;
274
- secret_binary, Binary ;
275
- secret_lower_hex, LowerHex ;
276
- secret_upper_hex, UpperHex ;
277
- secret_string, String ;
278
- secret_pointer, Pointer ;
279
- secret_float, Float ;
280
- secret_lower_exp, LowerExp ;
281
- secret_upper_exp, UpperExp ;
282
- }
283
-
284
253
static DEFAULT_ARGUMENT : rt:: Argument < ' static > = rt:: Argument {
285
254
position : rt:: ArgumentNext ,
286
255
format : rt:: FormatSpec {
@@ -570,33 +539,13 @@ pub fn argument<'a, T>(f: extern "Rust" fn(&T, &mut Formatter) -> Result,
570
539
571
540
/// When the compiler determines that the type of an argument *must* be a string
572
541
/// (such as for select), then it invokes this method.
573
- // NOTE(stage0): remove function after a snapshot
574
- #[ cfg( stage0) ]
575
- #[ doc( hidden) ] #[ inline]
576
- pub fn argumentstr < ' a > ( s : & ' a & str ) -> Argument < ' a > {
577
- argument ( secret_string, s)
578
- }
579
-
580
- /// When the compiler determines that the type of an argument *must* be a string
581
- /// (such as for select), then it invokes this method.
582
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
583
542
#[ doc( hidden) ] #[ inline]
584
543
pub fn argumentstr < ' a > ( s : & ' a & str ) -> Argument < ' a > {
585
544
argument ( String :: fmt, s)
586
545
}
587
546
588
547
/// When the compiler determines that the type of an argument *must* be a uint
589
548
/// (such as for plural), then it invokes this method.
590
- // NOTE(stage0): remove function after a snapshot
591
- #[ cfg( stage0) ]
592
- #[ doc( hidden) ] #[ inline]
593
- pub fn argumentuint < ' a > ( s : & ' a uint ) -> Argument < ' a > {
594
- argument ( secret_unsigned, s)
595
- }
596
-
597
- /// When the compiler determines that the type of an argument *must* be a uint
598
- /// (such as for plural), then it invokes this method.
599
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
600
549
#[ doc( hidden) ] #[ inline]
601
550
pub fn argumentuint < ' a > ( s : & ' a uint ) -> Argument < ' a > {
602
551
argument ( Unsigned :: fmt, s)
@@ -614,15 +563,6 @@ impl<'a> Show for &'a Show+'a {
614
563
fn fmt ( & self , f : & mut Formatter ) -> Result { ( * self ) . fmt ( f) }
615
564
}
616
565
617
- // NOTE(stage0): remove impl after a snapshot
618
- #[ cfg( stage0) ]
619
- impl Bool for bool {
620
- fn fmt ( & self , f : & mut Formatter ) -> Result {
621
- secret_string ( & ( if * self { "true" } else { "false" } ) , f)
622
- }
623
- }
624
-
625
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
626
566
impl Bool for bool {
627
567
fn fmt ( & self , f : & mut Formatter ) -> Result {
628
568
String :: fmt ( if * self { "true" } else { "false" } , f)
@@ -641,20 +581,6 @@ impl String for str {
641
581
}
642
582
}
643
583
644
- // NOTE(stage0): remove impl after a snapshot
645
- #[ cfg( stage0) ]
646
- impl Char for char {
647
- fn fmt ( & self , f : & mut Formatter ) -> Result {
648
- use char:: Char ;
649
-
650
- let mut utf8 = [ 0u8 , ..4 ] ;
651
- let amt = self . encode_utf8 ( utf8) . unwrap_or ( 0 ) ;
652
- let s: & str = unsafe { mem:: transmute ( utf8[ ..amt] ) } ;
653
- secret_string ( & s, f)
654
- }
655
- }
656
-
657
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
658
584
impl Char for char {
659
585
fn fmt ( & self , f : & mut Formatter ) -> Result {
660
586
use char:: Char ;
@@ -666,62 +592,25 @@ impl Char for char {
666
592
}
667
593
}
668
594
669
- // NOTE(stage0): remove impl after a snapshot
670
- #[ cfg( stage0) ]
671
- impl < T > Pointer for * const T {
672
- fn fmt ( & self , f : & mut Formatter ) -> Result {
673
- f. flags |= 1 << ( rt:: FlagAlternate as uint ) ;
674
- secret_lower_hex :: < uint > ( & ( * self as uint ) , f)
675
- }
676
- }
677
-
678
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
679
595
impl < T > Pointer for * const T {
680
596
fn fmt ( & self , f : & mut Formatter ) -> Result {
681
597
f. flags |= 1 << ( rt:: FlagAlternate as uint ) ;
682
598
LowerHex :: fmt ( & ( * self as uint ) , f)
683
599
}
684
600
}
685
601
686
- // NOTE(stage0): remove impl after a snapshot
687
- #[ cfg( stage0) ]
688
- impl < T > Pointer for * mut T {
689
- fn fmt ( & self , f : & mut Formatter ) -> Result {
690
- secret_pointer :: < * const T > ( & ( * self as * const T ) , f)
691
- }
692
- }
693
-
694
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
695
602
impl < T > Pointer for * mut T {
696
603
fn fmt ( & self , f : & mut Formatter ) -> Result {
697
604
Pointer :: fmt ( & ( * self as * const T ) , f)
698
605
}
699
606
}
700
607
701
- // NOTE(stage0): remove impl after a snapshot
702
- #[ cfg( stage0) ]
703
- impl < ' a , T > Pointer for & ' a T {
704
- fn fmt ( & self , f : & mut Formatter ) -> Result {
705
- secret_pointer :: < * const T > ( & ( & * * self as * const T ) , f)
706
- }
707
- }
708
-
709
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
710
608
impl < ' a , T > Pointer for & ' a T {
711
609
fn fmt ( & self , f : & mut Formatter ) -> Result {
712
610
Pointer :: fmt ( & ( * self as * const T ) , f)
713
611
}
714
612
}
715
613
716
- // NOTE(stage0): remove impl after a snapshot
717
- #[ cfg( stage0) ]
718
- impl < ' a , T > Pointer for & ' a mut T {
719
- fn fmt ( & self , f : & mut Formatter ) -> Result {
720
- secret_pointer :: < * const T > ( & ( & * * self as * const T ) , f)
721
- }
722
- }
723
-
724
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
725
614
impl < ' a , T > Pointer for & ' a mut T {
726
615
fn fmt ( & self , f : & mut Formatter ) -> Result {
727
616
Pointer :: fmt ( & ( & * * self as * const T ) , f)
@@ -797,65 +686,23 @@ floating!(f64)
797
686
798
687
// Implementation of Show for various core types
799
688
800
- // NOTE(stage0): remove macro after a snapshot
801
- #[ cfg( stage0) ]
802
- macro_rules! delegate( ( $ty: ty to $other: ident) => {
803
- impl Show for $ty {
804
- fn fmt( & self , f: & mut Formatter ) -> Result {
805
- ( concat_idents!( secret_, $other) ( self , f) )
806
- }
807
- }
808
- } )
809
-
810
- // NOTE(stage0): remove these macros after a snapshot
811
- #[ cfg( stage0) ]
812
- delegate ! ( str to string)
813
- #[ cfg( stage0) ]
814
- delegate ! ( bool to bool )
815
- #[ cfg( stage0) ]
816
- delegate ! ( char to char )
817
- #[ cfg( stage0) ]
818
- delegate ! ( f32 to float)
819
- #[ cfg( stage0) ]
820
- delegate ! ( f64 to float)
821
-
822
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
823
689
macro_rules! delegate( ( $ty: ty to $other: ident) => {
824
690
impl Show for $ty {
825
691
fn fmt( & self , f: & mut Formatter ) -> Result {
826
692
$other:: fmt( self , f)
827
693
}
828
694
}
829
695
} )
830
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
831
696
delegate ! ( str to String )
832
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
833
697
delegate ! ( bool to Bool )
834
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
835
698
delegate ! ( char to Char )
836
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
837
699
delegate ! ( f32 to Float )
838
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
839
700
delegate ! ( f64 to Float )
840
701
841
- // NOTE(stage0): remove impl after a snapshot
842
- #[ cfg( stage0) ]
843
- impl < T > Show for * const T {
844
- fn fmt ( & self , f : & mut Formatter ) -> Result { secret_pointer ( self , f) }
845
- }
846
-
847
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
848
702
impl < T > Show for * const T {
849
703
fn fmt ( & self , f : & mut Formatter ) -> Result { Pointer :: fmt ( self , f) }
850
704
}
851
705
852
- // NOTE(stage0): remove impl after a snapshot
853
- #[ cfg( stage0) ]
854
- impl < T > Show for * mut T {
855
- fn fmt ( & self , f : & mut Formatter ) -> Result { secret_pointer ( self , f) }
856
- }
857
-
858
- #[ cfg( not( stage0) ) ] // NOTE(stage0): remove cfg after a snapshot
859
706
impl < T > Show for * mut T {
860
707
fn fmt ( & self , f : & mut Formatter ) -> Result { Pointer :: fmt ( self , f) }
861
708
}
0 commit comments