File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ use std::path::PathBuf;
2020use std:: process:: { Child , Command } ;
2121use std:: time:: Instant ;
2222
23+ use crate :: bin_helpers:: parse_rustc_stage;
2324use dylib_util:: { dylib_path, dylib_path_var} ;
2425
2526#[ path = "../utils/bin_helpers.rs" ]
@@ -32,6 +33,9 @@ fn main() {
3233 let args = env:: args_os ( ) . skip ( 1 ) . collect :: < Vec < _ > > ( ) ;
3334 let arg = |name| args. windows ( 2 ) . find ( |args| args[ 0 ] == name) . and_then ( |args| args[ 1 ] . to_str ( ) ) ;
3435
36+ // We don't use the stage in this shim, but let's parse it to make sure that we're invoked
37+ // by bootstrap, or that we provide a helpful error message if not.
38+ parse_rustc_stage ( ) ;
3539 let verbose = bin_helpers:: parse_rustc_verbose ( ) ;
3640
3741 // Detect whether or not we're a build script depending on whether --target
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ pub(crate) fn parse_rustc_verbose() -> usize {
1818/// Parses the value of the "RUSTC_STAGE" environment variable and returns it as a `String`.
1919///
2020/// If "RUSTC_STAGE" was not set, the program will be terminated with 101.
21- #[ allow( unused) ]
2221pub ( crate ) fn parse_rustc_stage ( ) -> String {
2322 std:: env:: var ( "RUSTC_STAGE" ) . unwrap_or_else ( |_| {
2423 // Don't panic here; it's reasonable to try and run these shims directly. Give a helpful error instead.
You can’t perform that action at this time.
0 commit comments