@@ -1098,38 +1098,26 @@ impl fmt::Display for ExitStatus {
10981098///
10991099/// [RFC #1937]: https://github.com/rust-lang/rfcs/pull/1937
11001100#[ derive( Clone , Copy , Debug ) ]
1101- #[ unstable( feature = "process_exitcode_placeholder" , issue = "43301 " ) ]
1102- pub struct ExitCode ( pub i32 ) ;
1101+ #[ unstable( feature = "process_exitcode_placeholder" , issue = "48711 " ) ]
1102+ pub struct ExitCode ( imp :: ExitCode ) ;
11031103
1104- #[ cfg( target_arch = "wasm32" ) ]
1105- mod rawexit {
1106- pub const SUCCESS : i32 = 0 ;
1107- pub const FAILURE : i32 = 1 ;
1108- }
1109- #[ cfg( not( target_arch = "wasm32" ) ) ]
1110- mod rawexit {
1111- use libc;
1112- pub const SUCCESS : i32 = libc:: EXIT_SUCCESS ;
1113- pub const FAILURE : i32 = libc:: EXIT_FAILURE ;
1114- }
1115-
1116- #[ unstable( feature = "process_exitcode_placeholder" , issue = "43301" ) ]
1104+ #[ unstable( feature = "process_exitcode_placeholder" , issue = "48711" ) ]
11171105impl ExitCode {
11181106 /// The canonical ExitCode for successful termination on this platform.
11191107 ///
11201108 /// Note that a `()`-returning `main` implicitly results in a successful
11211109 /// termination, so there's no need to return this from `main` unless
11221110 /// you're also returning other possible codes.
1123- #[ unstable( feature = "process_exitcode_placeholder" , issue = "43301 " ) ]
1124- pub const SUCCESS : ExitCode = ExitCode ( rawexit :: SUCCESS ) ;
1111+ #[ unstable( feature = "process_exitcode_placeholder" , issue = "48711 " ) ]
1112+ pub const SUCCESS : ExitCode = ExitCode ( imp :: ExitCode :: SUCCESS ) ;
11251113
11261114 /// The canonical ExitCode for unsuccessful termination on this platform.
11271115 ///
11281116 /// If you're only returning this and `SUCCESS` from `main`, consider
11291117 /// instead returning `Err(_)` and `Ok(())` respectively, which will
11301118 /// return the same codes (but will also `eprintln!` the error).
1131- #[ unstable( feature = "process_exitcode_placeholder" , issue = "43301 " ) ]
1132- pub const FAILURE : ExitCode = ExitCode ( rawexit :: FAILURE ) ;
1119+ #[ unstable( feature = "process_exitcode_placeholder" , issue = "48711 " ) ]
1120+ pub const FAILURE : ExitCode = ExitCode ( imp :: ExitCode :: FAILURE ) ;
11331121}
11341122
11351123impl Child {
@@ -1494,8 +1482,7 @@ impl<E: fmt::Debug> Termination for Result<!, E> {
14941482#[ unstable( feature = "termination_trait_lib" , issue = "43301" ) ]
14951483impl Termination for ExitCode {
14961484 fn report ( self ) -> i32 {
1497- let ExitCode ( code) = self ;
1498- code
1485+ self . 0 . as_i32 ( )
14991486 }
15001487}
15011488
0 commit comments