@@ -18,6 +18,7 @@ mod tests;
18
18
19
19
/// Returns the environment variable which the dynamic library lookup path
20
20
/// resides in for this platform.
21
+ #[ inline( always) ]
21
22
pub fn dylib_path_var ( ) -> & ' static str {
22
23
if cfg ! ( target_os = "windows" ) {
23
24
"PATH"
@@ -34,6 +35,7 @@ pub fn dylib_path_var() -> &'static str {
34
35
35
36
/// Parses the `dylib_path_var()` environment variable, returning a list of
36
37
/// paths that are members of this lookup path.
38
+ #[ inline( always) ]
37
39
pub fn dylib_path ( ) -> Vec < std:: path:: PathBuf > {
38
40
let var = match std:: env:: var_os ( dylib_path_var ( ) ) {
39
41
Some ( v) => v,
@@ -44,6 +46,7 @@ pub fn dylib_path() -> Vec<std::path::PathBuf> {
44
46
45
47
/// Given an executable called `name`, return the filename for the
46
48
/// executable for a particular target.
49
+ #[ inline( always) ]
47
50
pub fn exe ( name : & str , target : & str ) -> String {
48
51
if target. contains ( "windows" ) {
49
52
format ! ( "{name}.exe" )
@@ -60,6 +63,7 @@ pub fn exe(name: &str, target: &str) -> String {
60
63
/// If it was not defined, returns 0 by default.
61
64
///
62
65
/// Panics if "RUSTC_VERBOSE" is defined with the value that is not an unsigned integer.
66
+ #[ inline( always) ]
63
67
pub fn parse_rustc_verbose ( ) -> usize {
64
68
match env:: var ( "RUSTC_VERBOSE" ) {
65
69
Ok ( s) => usize:: from_str ( & s) . expect ( "RUSTC_VERBOSE should be an integer" ) ,
@@ -70,6 +74,7 @@ pub fn parse_rustc_verbose() -> usize {
70
74
/// Parses the value of the "RUSTC_STAGE" environment variable and returns it as a `String`.
71
75
///
72
76
/// If "RUSTC_STAGE" was not set, the program will be terminated with 101.
77
+ #[ inline( always) ]
73
78
pub fn parse_rustc_stage ( ) -> String {
74
79
env:: var ( "RUSTC_STAGE" ) . unwrap_or_else ( |_| {
75
80
// Don't panic here; it's reasonable to try and run these shims directly. Give a helpful error instead.
@@ -83,6 +88,7 @@ pub fn parse_rustc_stage() -> String {
83
88
///
84
89
/// Before writing it, replaces user-specific values to create generic dumps for cross-environment
85
90
/// comparisons.
91
+ #[ inline( always) ]
86
92
pub fn maybe_dump ( dump_name : String , cmd : & Command ) {
87
93
if let Ok ( dump_dir) = env:: var ( "DUMP_BOOTSTRAP_SHIMS" ) {
88
94
let dump_file = format ! ( "{dump_dir}/{dump_name}" ) ;
@@ -98,6 +104,7 @@ pub fn maybe_dump(dump_name: String, cmd: &Command) {
98
104
}
99
105
100
106
/// Finds `key` and returns its value from the given list of arguments `args`.
107
+ #[ inline( always) ]
101
108
pub fn parse_value_from_args < ' a > ( args : & ' a [ OsString ] , key : & str ) -> Option < & ' a str > {
102
109
let mut args = args. iter ( ) ;
103
110
while let Some ( arg) = args. next ( ) {
0 commit comments