mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
run_make_support: rename env_checked
-> env
This commit is contained in:
parent
b7f7205212
commit
a443dc4ecd
@ -1,10 +1,9 @@
|
||||
use std::env;
|
||||
use std::ffi::OsString;
|
||||
|
||||
#[track_caller]
|
||||
#[must_use]
|
||||
pub fn env_var(name: &str) -> String {
|
||||
match env::var(name) {
|
||||
match std::env::var(name) {
|
||||
Ok(v) => v,
|
||||
Err(err) => panic!("failed to retrieve environment variable {name:?}: {err:?}"),
|
||||
}
|
||||
@ -13,7 +12,7 @@ pub fn env_var(name: &str) -> String {
|
||||
#[track_caller]
|
||||
#[must_use]
|
||||
pub fn env_var_os(name: &str) -> OsString {
|
||||
match env::var_os(name) {
|
||||
match std::env::var_os(name) {
|
||||
Some(v) => v,
|
||||
None => panic!("failed to retrieve environment variable {name:?}"),
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::command::Command;
|
||||
use crate::env_checked::env_var;
|
||||
use crate::env::env_var;
|
||||
|
||||
/// Construct a new `llvm-readobj` invocation with the `GNU` output style.
|
||||
/// This assumes that `llvm-readobj` is available at `$LLVM_BIN_DIR/llvm-readobj`.
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::command::Command;
|
||||
use crate::env_checked::env_var;
|
||||
use crate::env::env_var;
|
||||
|
||||
/// Obtain path of python as provided by the `PYTHON` environment variable. It is up to the caller
|
||||
/// to document and check if the python version is compatible with its intended usage.
|
||||
|
@ -2,7 +2,7 @@ use std::ffi::{OsStr, OsString};
|
||||
use std::path::Path;
|
||||
|
||||
use crate::command::Command;
|
||||
use crate::env_checked::env_var;
|
||||
use crate::env::env_var;
|
||||
use crate::path_helpers::cwd;
|
||||
use crate::util::set_host_rpath;
|
||||
|
||||
|
@ -2,7 +2,7 @@ use std::ffi::OsStr;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::command::Command;
|
||||
use crate::env_checked::{env_var, env_var_os};
|
||||
use crate::env::{env_var, env_var_os};
|
||||
use crate::util::set_host_rpath;
|
||||
|
||||
/// Construct a plain `rustdoc` invocation with no flags set.
|
||||
|
@ -10,7 +10,7 @@ mod util;
|
||||
pub mod artifact_names;
|
||||
pub mod assertion_helpers;
|
||||
pub mod diff;
|
||||
pub mod env_checked;
|
||||
pub mod env;
|
||||
pub mod external_deps;
|
||||
pub mod fs_helpers;
|
||||
pub mod fs_wrapper;
|
||||
@ -48,7 +48,7 @@ pub use rustdoc::{bare_rustdoc, rustdoc, Rustdoc};
|
||||
pub use diff::{diff, Diff};
|
||||
|
||||
/// Panic-on-fail [`std::env::var`] and [`std::env::var_os`] wrappers.
|
||||
pub use env_checked::{env_var, env_var_os};
|
||||
pub use env::{env_var, env_var_os};
|
||||
|
||||
/// Convenience helpers for running binaries and other commands.
|
||||
pub use run::{cmd, run, run_fail, run_with_args};
|
||||
|
@ -4,7 +4,7 @@ use std::panic;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::command::Command;
|
||||
use crate::env_checked::env_var;
|
||||
use crate::env::env_var;
|
||||
use crate::util::handle_failed_output;
|
||||
|
||||
/// Return the current working directory.
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use crate::command::{Command, CompletedProcess};
|
||||
use crate::env_checked::env_var;
|
||||
use crate::env::env_var;
|
||||
use crate::path_helpers::cwd;
|
||||
|
||||
/// If a given [`Command`] failed (as indicated by its [`CompletedProcess`]), verbose print the
|
||||
|
Loading…
Reference in New Issue
Block a user