@@ -21,6 +21,7 @@ use ffi::{OsStr, OsString};
2121use fmt;
2222use io;
2323use path:: { Path , PathBuf } ;
24+ use sys;
2425use sys:: os as os_imp;
2526
2627/// Returns the current working directory as a `PathBuf`.
@@ -557,7 +558,7 @@ pub struct Args { inner: ArgsOs }
557558///
558559/// This structure is created through the `std::env::args_os` method.
559560#[ stable( feature = "env" , since = "1.0.0" ) ]
560- pub struct ArgsOs { inner : os_imp :: Args }
561+ pub struct ArgsOs { inner : sys :: args :: Args }
561562
562563/// Returns the arguments which this program was started with (normally passed
563564/// via the command line).
@@ -606,7 +607,7 @@ pub fn args() -> Args {
606607/// ```
607608#[ stable( feature = "env" , since = "1.0.0" ) ]
608609pub fn args_os ( ) -> ArgsOs {
609- ArgsOs { inner : os_imp :: args ( ) }
610+ ArgsOs { inner : sys :: args :: args ( ) }
610611}
611612
612613#[ stable( feature = "env" , since = "1.0.0" ) ]
@@ -649,6 +650,8 @@ impl DoubleEndedIterator for ArgsOs {
649650/// Constants associated with the current target
650651#[ stable( feature = "env" , since = "1.0.0" ) ]
651652pub mod consts {
653+ use sys:: env:: os;
654+
652655 /// A string describing the architecture of the CPU that is currently
653656 /// in use.
654657 ///
@@ -673,7 +676,7 @@ pub mod consts {
673676 /// - unix
674677 /// - windows
675678 #[ stable( feature = "env" , since = "1.0.0" ) ]
676- pub const FAMILY : & ' static str = super :: os:: FAMILY ;
679+ pub const FAMILY : & ' static str = os:: FAMILY ;
677680
678681 /// A string describing the specific operating system in use.
679682 /// Example value is `linux`.
@@ -692,7 +695,7 @@ pub mod consts {
692695 /// - android
693696 /// - windows
694697 #[ stable( feature = "env" , since = "1.0.0" ) ]
695- pub const OS : & ' static str = super :: os:: OS ;
698+ pub const OS : & ' static str = os:: OS ;
696699
697700 /// Specifies the filename prefix used for shared libraries on this
698701 /// platform. Example value is `lib`.
@@ -702,7 +705,7 @@ pub mod consts {
702705 /// - lib
703706 /// - `""` (an empty string)
704707 #[ stable( feature = "env" , since = "1.0.0" ) ]
705- pub const DLL_PREFIX : & ' static str = super :: os:: DLL_PREFIX ;
708+ pub const DLL_PREFIX : & ' static str = os:: DLL_PREFIX ;
706709
707710 /// Specifies the filename suffix used for shared libraries on this
708711 /// platform. Example value is `.so`.
@@ -713,7 +716,7 @@ pub mod consts {
713716 /// - .dylib
714717 /// - .dll
715718 #[ stable( feature = "env" , since = "1.0.0" ) ]
716- pub const DLL_SUFFIX : & ' static str = super :: os:: DLL_SUFFIX ;
719+ pub const DLL_SUFFIX : & ' static str = os:: DLL_SUFFIX ;
717720
718721 /// Specifies the file extension used for shared libraries on this
719722 /// platform that goes after the dot. Example value is `so`.
@@ -724,7 +727,7 @@ pub mod consts {
724727 /// - dylib
725728 /// - dll
726729 #[ stable( feature = "env" , since = "1.0.0" ) ]
727- pub const DLL_EXTENSION : & ' static str = super :: os:: DLL_EXTENSION ;
730+ pub const DLL_EXTENSION : & ' static str = os:: DLL_EXTENSION ;
728731
729732 /// Specifies the filename suffix used for executable binaries on this
730733 /// platform. Example value is `.exe`.
@@ -736,7 +739,7 @@ pub mod consts {
736739 /// - .pexe
737740 /// - `""` (an empty string)
738741 #[ stable( feature = "env" , since = "1.0.0" ) ]
739- pub const EXE_SUFFIX : & ' static str = super :: os:: EXE_SUFFIX ;
742+ pub const EXE_SUFFIX : & ' static str = os:: EXE_SUFFIX ;
740743
741744 /// Specifies the file extension, if any, used for executable binaries
742745 /// on this platform. Example value is `exe`.
@@ -746,183 +749,7 @@ pub mod consts {
746749 /// - exe
747750 /// - `""` (an empty string)
748751 #[ 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 = "" ;
752+ pub const EXE_EXTENSION : & ' static str = os:: EXE_EXTENSION ;
926753}
927754
928755#[ cfg( target_arch = "x86" ) ]
0 commit comments