Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
master
rust/tests/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs

12 lines
183 B
Rust
Raw Permalink Normal View History

Run feature-gating on the final AST passed to the compiler. This ensures we catch everything; previously, an unknown attribute inserted by #[cfg_attr(...)] in a macro expansion would not be detected.
2015-03-04 18:05:38 +11:00
macro_rules! foo {
() => {
resolve: Use `feature(custom_attribute)` fallback only if the feature is enabled Normally `#![feature(...)]` shouldn't change behavior, but custom attributes in particular are in the process of retirement, and we should not produce a message telling to enable them. It also helps with unifying diagnostics for unresolved macros.
2019-07-12 01:00:20 +03:00
#[cfg_attr(all(), unknown)]
resolve: Tweak "cannot find" wording for attributes
2019-09-15 12:55:18 +03:00
//~^ ERROR cannot find attribute `unknown` in this scope
Run feature-gating on the final AST passed to the compiler. This ensures we catch everything; previously, an unknown attribute inserted by #[cfg_attr(...)] in a macro expansion would not be detected.
2015-03-04 18:05:38 +11:00
fn foo() {}
}
}
foo!();
fn main() {}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2438ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API