From 538f4faafb28b3ec7bd6db4502b6e719982b0ab9 Mon Sep 17 00:00:00 2001 From: Vladimir Krivopalov Date: Mon, 27 Jan 2025 14:53:56 -0500 Subject: [PATCH] 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 --- crates/rust-analyzer/tests/slow-tests/testdir.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/rust-analyzer/tests/slow-tests/testdir.rs b/crates/rust-analyzer/tests/slow-tests/testdir.rs index d113bd5127..409be2894f 100644 --- a/crates/rust-analyzer/tests/slow-tests/testdir.rs +++ b/crates/rust-analyzer/tests/slow-tests/testdir.rs @@ -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")]