From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../rustc_error_codes/src/error_codes/E0537.md | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 compiler/rustc_error_codes/src/error_codes/E0537.md (limited to 'compiler/rustc_error_codes/src/error_codes/E0537.md') diff --git a/compiler/rustc_error_codes/src/error_codes/E0537.md b/compiler/rustc_error_codes/src/error_codes/E0537.md new file mode 100644 index 000000000..123efd4f5 --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0537.md @@ -0,0 +1,30 @@ +An unknown predicate was used inside the `cfg` attribute. + +Erroneous code example: + +```compile_fail,E0537 +#[cfg(unknown())] // error: invalid predicate `unknown` +pub fn something() {} + +pub fn main() {} +``` + +The `cfg` attribute supports only three kinds of predicates: + + * any + * all + * not + +Example: + +``` +#[cfg(not(target_os = "linux"))] // ok! +pub fn something() {} + +pub fn main() {} +``` + +For more information about the `cfg` attribute, read the section on +[Conditional Compilation][conditional-compilation] in the Reference. + +[conditional-compilation]: https://doc.rust-lang.org/reference/conditional-compilation.html -- cgit v1.2.3