本页尚未翻译,以下为英文原文。
#E0121: invalid cfg predicate
A #[cfg(..)] or cfg!(..) predicate is not well formed. It is a flag (unix), a key = "value" pair, or all(..), any(..) and not(..) of those.
nabi
#[cfg(either(target_family = "unix", target_family = "windows"))]
println("desktop");
error[E0121]: unknown cfg combinator `either` (`all`, `any`, `not`) --> main.nabi:1:1 | 1 | #[cfg(either(target_family = "unix", target_family = "windows"))] | ^^
Use all, any or not:
nabi
#[cfg(any(target_family = "unix", target_family = "windows"))]
println("desktop");
desktop
Chapter 17 lists the keys.
Related: E0109 malformed attribute
Found a mistake? Edit this page on GitHub. Last updated