Skip to content

Commit d9c3d83

Browse files
authored
Rollup merge of rust-lang#117724 - Kobzol:shim-error-message, r=onur-ozkan
Restore rustc shim error message Fixes: rust-lang#117595 (comment) The error message was originally introduced in rust-lang#111323, and subsequently broken by my change in rust-lang#116448. r? `@onur-ozkan`
2 parents 27b0fcc + 622be2d commit d9c3d83

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)