mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
Make RUSTC_OVERRIDE_VERSION_STRING overwrite the rendered version output, too
This commit is contained in:
parent
cbab16feaf
commit
92f263b792
@ -909,6 +909,15 @@ pub fn version_at_macro_invocation(
|
||||
) {
|
||||
let verbose = matches.opt_present("verbose");
|
||||
|
||||
let mut version = version;
|
||||
let mut release = release;
|
||||
let tmp;
|
||||
if let Ok(force_version) = std::env::var("RUSTC_OVERRIDE_VERSION_STRING") {
|
||||
tmp = force_version;
|
||||
version = &tmp;
|
||||
release = &tmp;
|
||||
}
|
||||
|
||||
safe_println!("{binary} {version}");
|
||||
|
||||
if verbose {
|
||||
|
@ -13,5 +13,5 @@ fn main() {
|
||||
.unwrap()
|
||||
.stdout;
|
||||
let version = std::str::from_utf8(&version).unwrap().strip_prefix("rustc ").unwrap().trim_end();
|
||||
assert_ne!(version, signalled_version);
|
||||
assert_eq!(version, signalled_version);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user