Skip to content

Commit 622be2d

Browse files
committedNov 8, 2023
Restore rustc shim error message
1 parent 28acba3 commit 622be2d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎src/bootstrap/src/bin/rustc.rs

+3
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ fn main() {
3232
let args = env::args_os().skip(1).collect::<Vec<_>>();
3333
let arg = |name| args.windows(2).find(|args| args[0] == name).and_then(|args| args[1].to_str());
3434

35+
// We don't use the stage in this shim, but let's parse it to make sure that we're invoked
36+
// by bootstrap, or that we provide a helpful error message if not.
37+
bin_helpers::parse_rustc_stage();
3538
let verbose = bin_helpers::parse_rustc_verbose();
3639

3740
// Detect whether or not we're a build script depending on whether --target

‎src/bootstrap/src/utils/bin_helpers.rs

-1
Original file line numberDiff line numberDiff 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)]
2221
pub(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.

0 commit comments

Comments
 (0)
Please sign in to comment.