Add FreeBSD as a target OS for TestDir to avoid warnings

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 <vladimir@krivopalov.ru>
This commit is contained in:
Vladimir Krivopalov 2025-01-27 14:53:56 -05:00
parent 7c387ed3a7
commit 538f4faafb

View file

@ -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")]