-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate run-make/crate-data-smoke
to rmake.rs
#125723
Migrate run-make/crate-data-smoke
to rmake.rs
#125723
Conversation
6379f9a
to
de1d0e0
Compare
); | ||
compare_stdout( | ||
rustc().print("file-names").input("lib.rs").run(), | ||
rust_lib("mylib").file_name().unwrap().to_string_lossy(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: rust_lib
is a bit weird because it constructs a path under tmp_dir()
and then joins the library name. Then to get the filename we have to do this long .file_name().unwrap().to_string_lossy()
dance.
I know we currently have it defined as
/// Construct a path to a rust library (rlib) under `$TMPDIR` given the library name. This will return a
/// path with `$TMPDIR` joined with the library name.
pub fn rust_lib(name: &str) -> PathBuf {
tmp_dir().join(format!("lib{name}.rlib"))
}
should we introduce a helper that's only responsible for calculating the rlib name itself?
fn rlib_name(name: &str) -> String {
format!("lib{name}.rlib")
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be much better indeed! Doing it.
); | ||
compare_stdout( | ||
rustc().print("file-names").input("lib.rs").run(), | ||
rust_lib_name("mylib"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I like how this reads much better :3
Thanks, r=me after CI is green |
@bors r=jieyouxu rollup |
…ate-data-smoke, r=jieyouxu Migrate `run-make/crate-data-smoke` to `rmake.rs` Part of rust-lang#121876. r? `@jieyouxu`
Rollup of 7 pull requests Successful merges: - rust-lang#125653 (Migrate `run-make/const-prop-lint` to `rmake.rs`) - rust-lang#125662 (Rewrite `fpic`, `simple-dylib` and `issue-37893` `run-make` tests in `rmake.rs` or ui test format) - rust-lang#125699 (Streamline `x fmt` and improve its output) - rust-lang#125701 ([ACP 362] genericize `ptr::from_raw_parts`) - rust-lang#125723 (Migrate `run-make/crate-data-smoke` to `rmake.rs`) - rust-lang#125733 (Add lang items for `AsyncFn*`, `Future`, `AsyncFnKindHelper`'s associated types) - rust-lang#125734 (ast: Revert a breaking attribute visiting order change) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125723 - GuillaumeGomez:migrate-run-make-crate-data-smoke, r=jieyouxu Migrate `run-make/crate-data-smoke` to `rmake.rs` Part of rust-lang#121876. r? ``@jieyouxu``
Part of #121876.
r? @jieyouxu