mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 02:31:18 -03:00
Silence unexpected_cfgs error about unknown cygwin target
Extract our own cfg value, to avoid noisy warnings like: warning: unexpected `cfg` condition value: `cygwin` --> src/fallback.rs:78:23 | 78 | #[cfg(not(target_os = "cygwin"))] | ^^^^^^^^^^^^^^^^^^^^ | The cygwin target will be added to Rust 1.86, so we can get rid of this after some time.
This commit is contained in:
6
build.rs
6
build.rs
@@ -90,6 +90,7 @@ fn detect_cfgs(target: &mut Target) {
|
||||
),
|
||||
("apple", &detect_apple),
|
||||
("bsd", &detect_bsd),
|
||||
("cygwin", &detect_cygwin),
|
||||
("gettext", &have_gettext),
|
||||
("small_main_stack", &has_small_stack),
|
||||
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).
|
||||
@@ -128,6 +129,11 @@ fn detect_apple(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(any(target_os = "ios", target_os = "macos")))
|
||||
}
|
||||
|
||||
#[allow(unexpected_cfgs)]
|
||||
fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(target_os = "cygwin"))
|
||||
}
|
||||
|
||||
/// Detect if we're being compiled for a BSD-derived OS, allowing targeting code conditionally with
|
||||
/// `#[cfg(bsd)]`.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user