Skip to content

Commit

Permalink
Add FreeBSD as a target OS for TestDir to avoid warnings
Browse files Browse the repository at this point in the history
Currently, running rust-analyzer tests on FreeBSD produces an "unused
variable" warning. The code is fully compatible with FreeBSD and doesn't
have to be omitted.

Signed-off-by: Vladimir Krivopalov <[email protected]>
  • Loading branch information
vkrivopalov committed Jan 27, 2025
1 parent 7c387ed commit 538f4fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/rust-analyzer/tests/slow-tests/testdir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ impl TestDir {
}
fs::create_dir_all(&path).unwrap();

#[cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))]
#[cfg(any(
target_os = "macos",
target_os = "linux",
target_os = "windows",
target_os = "freebsd"
))]
if symlink {
let symlink_path = base.join(format!("{pid}_{cnt}_symlink"));
#[cfg(any(target_os = "macos", target_os = "linux"))]
#[cfg(any(target_os = "macos", target_os = "linux", target_os = "freebsd"))]
std::os::unix::fs::symlink(path, &symlink_path).unwrap();

#[cfg(target_os = "windows")]
Expand Down

0 comments on commit 538f4fa

Please sign in to comment.