File tree 2 files changed +10
-4
lines changed
src/tools/run-make-support/src
tests/run-make/crate-data-smoke
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,13 @@ pub fn dynamic_lib_name(name: &str) -> String {
135
135
/// Construct a path to a rust library (rlib) under `$TMPDIR` given the library name. This will return a
136
136
/// path with `$TMPDIR` joined with the library name.
137
137
pub fn rust_lib ( name : & str ) -> PathBuf {
138
- tmp_dir ( ) . join ( format ! ( "lib{name}.rlib" ) )
138
+ tmp_dir ( ) . join ( rust_lib_name ( name) )
139
+ }
140
+
141
+ /// Generate the name a rust library (rlib) would have. If you want the complete path, use
142
+ /// [`rust_lib`] instead.
143
+ pub fn rust_lib_name ( name : & str ) -> String {
144
+ format ! ( "lib{name}.rlib" )
139
145
}
140
146
141
147
/// Construct the binary name based on platform.
Original file line number Diff line number Diff line change 1
1
use std:: process:: Output ;
2
2
3
- use run_make_support:: { bin_name, rust_lib , rustc} ;
3
+ use run_make_support:: { bin_name, rust_lib_name , rustc} ;
4
4
5
5
fn compare_stdout < S : AsRef < str > > ( output : Output , expected : S ) {
6
6
assert_eq ! (
@@ -34,10 +34,10 @@ fn main() {
34
34
) ;
35
35
compare_stdout (
36
36
rustc ( ) . print ( "file-names" ) . input ( "lib.rs" ) . run ( ) ,
37
- rust_lib ( "mylib" ) . file_name ( ) . unwrap ( ) . to_string_lossy ( ) ,
37
+ rust_lib_name ( "mylib" ) ,
38
38
) ;
39
39
compare_stdout (
40
40
rustc ( ) . print ( "file-names" ) . input ( "rlib.rs" ) . run ( ) ,
41
- rust_lib ( "mylib" ) . file_name ( ) . unwrap ( ) . to_string_lossy ( ) ,
41
+ rust_lib_name ( "mylib" ) ,
42
42
) ;
43
43
}
You can’t perform that action at this time.
0 commit comments