This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +21
-8
lines changed
tests/run-make/resolve-rename Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ impl Rustc {
7070 self
7171 }
7272
73+ /// Add a suffix in each output filename.
74+ pub fn extra_filename ( & mut self , suffix : & str ) -> & mut Self {
75+ self . cmd . arg ( format ! ( "-Cextra-filename={suffix}" ) ) ;
76+ self
77+ }
78+
7379 /// Specify type(s) of output files to generate.
7480 pub fn emit ( & mut self , kinds : & str ) -> & mut Self {
7581 self . cmd . arg ( format ! ( "--emit={kinds}" ) ) ;
Original file line number Diff line number Diff line change @@ -216,7 +216,6 @@ run-make/remap-path-prefix-dwarf/Makefile
216216run-make/remap-path-prefix/Makefile
217217run-make/reproducible-build-2/Makefile
218218run-make/reproducible-build/Makefile
219- run-make/resolve-rename/Makefile
220219run-make/return-non-c-like-enum-from-c/Makefile
221220run-make/return-non-c-like-enum/Makefile
222221run-make/rlib-chain/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // If a library is compiled with -C extra-filename, the rust compiler
2+ // will take this into account when searching for libraries. However,
3+ // if that library is then renamed, the rust compiler should fall back
4+ // to its regular library location logic and not immediately fail to find
5+ // the renamed library.
6+ // See https://github.com/rust-lang/rust/pull/49253
7+
8+ use run_make_support:: { rustc, tmp_dir} ;
9+ use std:: fs;
10+ fn main ( ) {
11+ rustc ( ) . extra_filename ( "-hash" ) . input ( "foo.rs" ) . run ( ) ;
12+ rustc ( ) . input ( "bar.rs" ) . run ( ) ;
13+ fs:: rename ( tmp_dir ( ) . join ( "libfoo-hash.rlib" ) , tmp_dir ( ) . join ( "libfoo-another-hash.rlib" ) ) ;
14+ rustc ( ) . input ( "baz.rs" ) . run ( ) ;
15+ }
You can’t perform that action at this time.
0 commit comments