]> git.proxmox.com Git - rustc.git/blob - src/test/ui/macros/macro-stability.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / macros / macro-stability.rs
1 // aux-build:unstable-macros.rs
2
3 #![feature(decl_macro)]
4 #![feature(staged_api)]
5 #[macro_use] extern crate unstable_macros;
6
7 #[unstable(feature = "local_unstable", issue = "0")]
8 macro_rules! local_unstable { () => () }
9
10 #[unstable(feature = "local_unstable", issue = "0")]
11 macro local_unstable_modern() {}
12
13 #[stable(feature = "deprecated_macros", since = "1.0.0")]
14 #[rustc_deprecated(since = "1.0.0", reason = "local deprecation reason")]
15 #[macro_export]
16 macro_rules! local_deprecated{ () => () }
17
18 fn main() {
19 local_unstable!(); //~ ERROR use of unstable library feature 'local_unstable'
20 local_unstable_modern!(); //~ ERROR use of unstable library feature 'local_unstable'
21 unstable_macro!(); //~ ERROR use of unstable library feature 'unstable_macros'
22 // unstable_macro_modern!(); // ERROR use of unstable library feature 'unstable_macros'
23
24 deprecated_macro!();
25 //~^ WARN use of deprecated item 'deprecated_macro': deprecation reason
26 local_deprecated!();
27 //~^ WARN use of deprecated item 'local_deprecated': local deprecation reason
28 }