Skip to content
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

When built with --release, std::process::id is unused #1426

Merged
merged 2 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dylint-link/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ const ARCHITECTURES: &[&str] = &[
"powerpc",
"powerpc64",
"powerpc64le",
"riscv32",
"riscv32e",
"riscv32em",
"riscv32emc",
"riscv32gc",
"riscv32i",
"riscv32im",
Expand Down
11 changes: 5 additions & 6 deletions dylint/src/library_packages/cargo_cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use std::{
ffi::{OsStr, OsString},
fs::{create_dir_all, read_dir, remove_dir_all, write},
path::{Path, PathBuf},
process::{id, Output, Stdio},
};
use tempfile::{tempdir, Builder, TempDir};
use url::Url;
Expand Down Expand Up @@ -270,7 +269,7 @@ fn inject_dummy_dependencies(
Ok(injected_dependencies)
}

fn cargo_fetch(path: &Path) -> Result<Output> {
fn cargo_fetch(path: &Path) -> Result<std::process::Output> {
// smoelius: `cargo fetch` could fail, e.g., if a new checkouts subdirectory had to be created.
// But the command should still be executed.
// smoelius: Since stdout and stderr are captured, there is no need to use `.quiet(true)`.
Expand All @@ -283,8 +282,8 @@ fn cargo_fetch(path: &Path) -> Result<Output> {
"--manifest-path",
&path.join("Cargo.toml").to_string_lossy(),
])
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.stdout(std::process::Stdio::piped())
.stderr(std::process::Stdio::piped())
.logged_output(false)
}

Expand Down Expand Up @@ -336,7 +335,7 @@ fn find_accessed_subdir<'a>(
#[cfg(debug_assertions)]
eprintln!(
"{}:{:?}: accessed: {grandparent:?}",
id(),
std::process::id(),
std::thread::current().id()
);
Ok(Some(Cow::Borrowed(grandparent.as_std_path())))
Expand All @@ -355,7 +354,7 @@ fn find_accessed_subdir<'a>(
#[cfg(debug_assertions)]
eprintln!(
"{}:{:?}: pushing: {path:?}",
id(),
std::process::id(),
std::thread::current().id()
);
accessed.push(Cow::Owned(path.to_path_buf()));
Expand Down