Rollup merge of #117724 - Kobzol:shim-error-message, r=onur-ozkan
Restore rustc shim error message Fixes: https://github.com/rust-lang/rust/pull/117595#discussion_r1382482249 The error message was originally introduced in https://github.com/rust-lang/rust/pull/111323, and subsequently broken by my change in https://github.com/rust-lang/rust/pull/116448. r? ``@onur-ozkan``
This commit is contained in:
commit
f5195c52bb
2 changed files with 3 additions and 1 deletions
|
@ -32,6 +32,9 @@ fn main() {
|
||||||
let args = env::args_os().skip(1).collect::<Vec<_>>();
|
let args = env::args_os().skip(1).collect::<Vec<_>>();
|
||||||
let arg = |name| args.windows(2).find(|args| args[0] == name).and_then(|args| args[1].to_str());
|
let arg = |name| args.windows(2).find(|args| args[0] == name).and_then(|args| args[1].to_str());
|
||||||
|
|
||||||
|
// We don't use the stage in this shim, but let's parse it to make sure that we're invoked
|
||||||
|
// by bootstrap, or that we provide a helpful error message if not.
|
||||||
|
bin_helpers::parse_rustc_stage();
|
||||||
let verbose = bin_helpers::parse_rustc_verbose();
|
let verbose = bin_helpers::parse_rustc_verbose();
|
||||||
|
|
||||||
// Detect whether or not we're a build script depending on whether --target
|
// Detect whether or not we're a build script depending on whether --target
|
||||||
|
|
|
@ -18,7 +18,6 @@ pub(crate) fn parse_rustc_verbose() -> usize {
|
||||||
/// Parses the value of the "RUSTC_STAGE" environment variable and returns it as a `String`.
|
/// Parses the value of the "RUSTC_STAGE" environment variable and returns it as a `String`.
|
||||||
///
|
///
|
||||||
/// If "RUSTC_STAGE" was not set, the program will be terminated with 101.
|
/// If "RUSTC_STAGE" was not set, the program will be terminated with 101.
|
||||||
#[allow(unused)]
|
|
||||||
pub(crate) fn parse_rustc_stage() -> String {
|
pub(crate) fn parse_rustc_stage() -> String {
|
||||||
std::env::var("RUSTC_STAGE").unwrap_or_else(|_| {
|
std::env::var("RUSTC_STAGE").unwrap_or_else(|_| {
|
||||||
// Don't panic here; it's reasonable to try and run these shims directly. Give a helpful error instead.
|
// Don't panic here; it's reasonable to try and run these shims directly. Give a helpful error instead.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue