@@ -649,6 +649,8 @@ impl DoubleEndedIterator for ArgsOs {
649
649
/// Constants associated with the current target
650
650
#[ stable( feature = "env" , since = "1.0.0" ) ]
651
651
pub mod consts {
652
+ use sys:: env:: os;
653
+
652
654
/// A string describing the architecture of the CPU that is currently
653
655
/// in use.
654
656
///
@@ -673,7 +675,7 @@ pub mod consts {
673
675
/// - unix
674
676
/// - windows
675
677
#[ stable( feature = "env" , since = "1.0.0" ) ]
676
- pub const FAMILY : & ' static str = super :: os:: FAMILY ;
678
+ pub const FAMILY : & ' static str = os:: FAMILY ;
677
679
678
680
/// A string describing the specific operating system in use.
679
681
/// Example value is `linux`.
@@ -692,7 +694,7 @@ pub mod consts {
692
694
/// - android
693
695
/// - windows
694
696
#[ stable( feature = "env" , since = "1.0.0" ) ]
695
- pub const OS : & ' static str = super :: os:: OS ;
697
+ pub const OS : & ' static str = os:: OS ;
696
698
697
699
/// Specifies the filename prefix used for shared libraries on this
698
700
/// platform. Example value is `lib`.
@@ -702,7 +704,7 @@ pub mod consts {
702
704
/// - lib
703
705
/// - `""` (an empty string)
704
706
#[ stable( feature = "env" , since = "1.0.0" ) ]
705
- pub const DLL_PREFIX : & ' static str = super :: os:: DLL_PREFIX ;
707
+ pub const DLL_PREFIX : & ' static str = os:: DLL_PREFIX ;
706
708
707
709
/// Specifies the filename suffix used for shared libraries on this
708
710
/// platform. Example value is `.so`.
@@ -713,7 +715,7 @@ pub mod consts {
713
715
/// - .dylib
714
716
/// - .dll
715
717
#[ stable( feature = "env" , since = "1.0.0" ) ]
716
- pub const DLL_SUFFIX : & ' static str = super :: os:: DLL_SUFFIX ;
718
+ pub const DLL_SUFFIX : & ' static str = os:: DLL_SUFFIX ;
717
719
718
720
/// Specifies the file extension used for shared libraries on this
719
721
/// platform that goes after the dot. Example value is `so`.
@@ -724,7 +726,7 @@ pub mod consts {
724
726
/// - dylib
725
727
/// - dll
726
728
#[ stable( feature = "env" , since = "1.0.0" ) ]
727
- pub const DLL_EXTENSION : & ' static str = super :: os:: DLL_EXTENSION ;
729
+ pub const DLL_EXTENSION : & ' static str = os:: DLL_EXTENSION ;
728
730
729
731
/// Specifies the filename suffix used for executable binaries on this
730
732
/// platform. Example value is `.exe`.
@@ -736,7 +738,7 @@ pub mod consts {
736
738
/// - .pexe
737
739
/// - `""` (an empty string)
738
740
#[ stable( feature = "env" , since = "1.0.0" ) ]
739
- pub const EXE_SUFFIX : & ' static str = super :: os:: EXE_SUFFIX ;
741
+ pub const EXE_SUFFIX : & ' static str = os:: EXE_SUFFIX ;
740
742
741
743
/// Specifies the file extension, if any, used for executable binaries
742
744
/// on this platform. Example value is `exe`.
@@ -746,183 +748,7 @@ pub mod consts {
746
748
/// - exe
747
749
/// - `""` (an empty string)
748
750
#[ stable( feature = "env" , since = "1.0.0" ) ]
749
- pub const EXE_EXTENSION : & ' static str = super :: os:: EXE_EXTENSION ;
750
-
751
- }
752
-
753
- #[ cfg( target_os = "linux" ) ]
754
- mod os {
755
- pub const FAMILY : & ' static str = "unix" ;
756
- pub const OS : & ' static str = "linux" ;
757
- pub const DLL_PREFIX : & ' static str = "lib" ;
758
- pub const DLL_SUFFIX : & ' static str = ".so" ;
759
- pub const DLL_EXTENSION : & ' static str = "so" ;
760
- pub const EXE_SUFFIX : & ' static str = "" ;
761
- pub const EXE_EXTENSION : & ' static str = "" ;
762
- }
763
-
764
- #[ cfg( target_os = "macos" ) ]
765
- mod os {
766
- pub const FAMILY : & ' static str = "unix" ;
767
- pub const OS : & ' static str = "macos" ;
768
- pub const DLL_PREFIX : & ' static str = "lib" ;
769
- pub const DLL_SUFFIX : & ' static str = ".dylib" ;
770
- pub const DLL_EXTENSION : & ' static str = "dylib" ;
771
- pub const EXE_SUFFIX : & ' static str = "" ;
772
- pub const EXE_EXTENSION : & ' static str = "" ;
773
- }
774
-
775
- #[ cfg( target_os = "ios" ) ]
776
- mod os {
777
- pub const FAMILY : & ' static str = "unix" ;
778
- pub const OS : & ' static str = "ios" ;
779
- pub const DLL_PREFIX : & ' static str = "lib" ;
780
- pub const DLL_SUFFIX : & ' static str = ".dylib" ;
781
- pub const DLL_EXTENSION : & ' static str = "dylib" ;
782
- pub const EXE_SUFFIX : & ' static str = "" ;
783
- pub const EXE_EXTENSION : & ' static str = "" ;
784
- }
785
-
786
- #[ cfg( target_os = "freebsd" ) ]
787
- mod os {
788
- pub const FAMILY : & ' static str = "unix" ;
789
- pub const OS : & ' static str = "freebsd" ;
790
- pub const DLL_PREFIX : & ' static str = "lib" ;
791
- pub const DLL_SUFFIX : & ' static str = ".so" ;
792
- pub const DLL_EXTENSION : & ' static str = "so" ;
793
- pub const EXE_SUFFIX : & ' static str = "" ;
794
- pub const EXE_EXTENSION : & ' static str = "" ;
795
- }
796
-
797
- #[ cfg( target_os = "dragonfly" ) ]
798
- mod os {
799
- pub const FAMILY : & ' static str = "unix" ;
800
- pub const OS : & ' static str = "dragonfly" ;
801
- pub const DLL_PREFIX : & ' static str = "lib" ;
802
- pub const DLL_SUFFIX : & ' static str = ".so" ;
803
- pub const DLL_EXTENSION : & ' static str = "so" ;
804
- pub const EXE_SUFFIX : & ' static str = "" ;
805
- pub const EXE_EXTENSION : & ' static str = "" ;
806
- }
807
-
808
- #[ cfg( target_os = "bitrig" ) ]
809
- mod os {
810
- pub const FAMILY : & ' static str = "unix" ;
811
- pub const OS : & ' static str = "bitrig" ;
812
- pub const DLL_PREFIX : & ' static str = "lib" ;
813
- pub const DLL_SUFFIX : & ' static str = ".so" ;
814
- pub const DLL_EXTENSION : & ' static str = "so" ;
815
- pub const EXE_SUFFIX : & ' static str = "" ;
816
- pub const EXE_EXTENSION : & ' static str = "" ;
817
- }
818
-
819
- #[ cfg( target_os = "netbsd" ) ]
820
- mod os {
821
- pub const FAMILY : & ' static str = "unix" ;
822
- pub const OS : & ' static str = "netbsd" ;
823
- pub const DLL_PREFIX : & ' static str = "lib" ;
824
- pub const DLL_SUFFIX : & ' static str = ".so" ;
825
- pub const DLL_EXTENSION : & ' static str = "so" ;
826
- pub const EXE_SUFFIX : & ' static str = "" ;
827
- pub const EXE_EXTENSION : & ' static str = "" ;
828
- }
829
-
830
- #[ cfg( target_os = "openbsd" ) ]
831
- mod os {
832
- pub const FAMILY : & ' static str = "unix" ;
833
- pub const OS : & ' static str = "openbsd" ;
834
- pub const DLL_PREFIX : & ' static str = "lib" ;
835
- pub const DLL_SUFFIX : & ' static str = ".so" ;
836
- pub const DLL_EXTENSION : & ' static str = "so" ;
837
- pub const EXE_SUFFIX : & ' static str = "" ;
838
- pub const EXE_EXTENSION : & ' static str = "" ;
839
- }
840
-
841
- #[ cfg( target_os = "android" ) ]
842
- mod os {
843
- pub const FAMILY : & ' static str = "unix" ;
844
- pub const OS : & ' static str = "android" ;
845
- pub const DLL_PREFIX : & ' static str = "lib" ;
846
- pub const DLL_SUFFIX : & ' static str = ".so" ;
847
- pub const DLL_EXTENSION : & ' static str = "so" ;
848
- pub const EXE_SUFFIX : & ' static str = "" ;
849
- pub const EXE_EXTENSION : & ' static str = "" ;
850
- }
851
-
852
- #[ cfg( target_os = "solaris" ) ]
853
- mod os {
854
- pub const FAMILY : & ' static str = "unix" ;
855
- pub const OS : & ' static str = "solaris" ;
856
- pub const DLL_PREFIX : & ' static str = "lib" ;
857
- pub const DLL_SUFFIX : & ' static str = ".so" ;
858
- pub const DLL_EXTENSION : & ' static str = "so" ;
859
- pub const EXE_SUFFIX : & ' static str = "" ;
860
- pub const EXE_EXTENSION : & ' static str = "" ;
861
- }
862
-
863
- #[ cfg( target_os = "windows" ) ]
864
- mod os {
865
- pub const FAMILY : & ' static str = "windows" ;
866
- pub const OS : & ' static str = "windows" ;
867
- pub const DLL_PREFIX : & ' static str = "" ;
868
- pub const DLL_SUFFIX : & ' static str = ".dll" ;
869
- pub const DLL_EXTENSION : & ' static str = "dll" ;
870
- pub const EXE_SUFFIX : & ' static str = ".exe" ;
871
- pub const EXE_EXTENSION : & ' static str = "exe" ;
872
- }
873
-
874
- #[ cfg( all( target_os = "nacl" , not( target_arch = "le32" ) ) ) ]
875
- mod os {
876
- pub const FAMILY : & ' static str = "unix" ;
877
- pub const OS : & ' static str = "nacl" ;
878
- pub const DLL_PREFIX : & ' static str = "lib" ;
879
- pub const DLL_SUFFIX : & ' static str = ".so" ;
880
- pub const DLL_EXTENSION : & ' static str = "so" ;
881
- pub const EXE_SUFFIX : & ' static str = ".nexe" ;
882
- pub const EXE_EXTENSION : & ' static str = "nexe" ;
883
- }
884
- #[ cfg( all( target_os = "nacl" , target_arch = "le32" ) ) ]
885
- mod os {
886
- pub const FAMILY : & ' static str = "unix" ;
887
- pub const OS : & ' static str = "pnacl" ;
888
- pub const DLL_PREFIX : & ' static str = "lib" ;
889
- pub const DLL_SUFFIX : & ' static str = ".pso" ;
890
- pub const DLL_EXTENSION : & ' static str = "pso" ;
891
- pub const EXE_SUFFIX : & ' static str = ".pexe" ;
892
- pub const EXE_EXTENSION : & ' static str = "pexe" ;
893
- }
894
-
895
- #[ cfg( all( target_os = "emscripten" , target_arch = "asmjs" ) ) ]
896
- mod os {
897
- pub const FAMILY : & ' static str = "unix" ;
898
- pub const OS : & ' static str = "emscripten" ;
899
- pub const DLL_PREFIX : & ' static str = "lib" ;
900
- pub const DLL_SUFFIX : & ' static str = ".so" ;
901
- pub const DLL_EXTENSION : & ' static str = "so" ;
902
- pub const EXE_SUFFIX : & ' static str = ".js" ;
903
- pub const EXE_EXTENSION : & ' static str = "js" ;
904
- }
905
-
906
- #[ cfg( all( target_os = "emscripten" , target_arch = "wasm32" ) ) ]
907
- mod os {
908
- pub const FAMILY : & ' static str = "unix" ;
909
- pub const OS : & ' static str = "emscripten" ;
910
- pub const DLL_PREFIX : & ' static str = "lib" ;
911
- pub const DLL_SUFFIX : & ' static str = ".so" ;
912
- pub const DLL_EXTENSION : & ' static str = "so" ;
913
- pub const EXE_SUFFIX : & ' static str = ".js" ;
914
- pub const EXE_EXTENSION : & ' static str = "js" ;
915
- }
916
-
917
- #[ cfg( target_os = "haiku" ) ]
918
- mod os {
919
- pub const FAMILY : & ' static str = "unix" ;
920
- pub const OS : & ' static str = "haiku" ;
921
- pub const DLL_PREFIX : & ' static str = "lib" ;
922
- pub const DLL_SUFFIX : & ' static str = ".so" ;
923
- pub const DLL_EXTENSION : & ' static str = "so" ;
924
- pub const EXE_SUFFIX : & ' static str = "" ;
925
- pub const EXE_EXTENSION : & ' static str = "" ;
751
+ pub const EXE_EXTENSION : & ' static str = os:: EXE_EXTENSION ;
926
752
}
927
753
928
754
#[ cfg( target_arch = "x86" ) ]
0 commit comments