File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
src/tools/run-make-support/src
tests/run-make/crate-data-smoke Expand file tree Collapse file tree 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 {
135135/// Construct a path to a rust library (rlib) under `$TMPDIR` given the library name. This will return a
136136/// path with `$TMPDIR` joined with the library name.
137137pub 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" )
139145}
140146
141147/// Construct the binary name based on platform.
Original file line number Diff line number Diff line change 11use std:: process:: Output ;
22
3- use run_make_support:: { bin_name, rust_lib , rustc} ;
3+ use run_make_support:: { bin_name, rust_lib_name , rustc} ;
44
55fn compare_stdout < S : AsRef < str > > ( output : Output , expected : S ) {
66 assert_eq ! (
@@ -34,10 +34,10 @@ fn main() {
3434 ) ;
3535 compare_stdout (
3636 rustc ( ) . print ( "file-names" ) . input ( "lib.rs" ) . run ( ) ,
37- rust_lib ( "mylib" ) . file_name ( ) . unwrap ( ) . to_string_lossy ( ) ,
37+ rust_lib_name ( "mylib" ) ,
3838 ) ;
3939 compare_stdout (
4040 rustc ( ) . print ( "file-names" ) . input ( "rlib.rs" ) . run ( ) ,
41- rust_lib ( "mylib" ) . file_name ( ) . unwrap ( ) . to_string_lossy ( ) ,
41+ rust_lib_name ( "mylib" ) ,
4242 ) ;
4343}
You can’t perform that action at this time.
0 commit comments