]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/stability-attribute/stability-attribute-sanity.rs
1 // Various checks that stability attributes are used correctly, per RFC 507
3 #![feature(const_fn, staged_api, rustc_const_unstable)]
5 #![stable(feature = "rust1", since = "1.0.0")]
7 mod bogus_attribute_types_1
{
8 #[stable(feature = "a", since = "b", reason)] //~ ERROR unknown meta item 'reason' [E0541]
11 #[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539]
14 #[stable(feature, since = "a")] //~ ERROR incorrect meta item [E0539]
17 #[stable(feature = "a", since(b))] //~ ERROR incorrect meta item [E0539]
20 #[stable(feature(b), since = "a")] //~ ERROR incorrect meta item [E0539]
24 mod missing_feature_names
{
25 #[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546]
28 #[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547]
31 #[stable(since = "a")] //~ ERROR missing 'feature' [E0546]
36 #[stable(feature = "a")] //~ ERROR missing 'since' [E0542]
39 #[stable(feature = "a", since = "b")]
40 #[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542]
43 #[stable(feature = "a", since = "b")]
44 #[rustc_deprecated(since = "a")] //~ ERROR missing 'reason' [E0543]
48 #[unstable(feature = "b", issue = "0")]
49 #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
52 #[unstable(feature = "b", issue = "0")]
53 #[unstable(feature = "b", issue = "0")] //~ ERROR multiple stability levels [E0544]
56 #[stable(feature = "a", since = "b")]
57 #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
60 #[stable(feature = "a", since = "b")]
61 #[rustc_deprecated(since = "b", reason = "text")]
62 #[rustc_deprecated(since = "b", reason = "text")]
63 #[rustc_const_unstable(feature = "c")]
64 #[rustc_const_unstable(feature = "d")]
65 pub const fn multiple4() { }
//~ ERROR multiple rustc_deprecated attributes [E0540]
66 //~^ ERROR Invalid stability or deprecation version found
67 //~| ERROR multiple rustc_const_unstable attributes
69 #[rustc_deprecated(since = "a", reason = "text")]
70 fn deprecated_without_unstable_or_stable() { }
71 //~^ ERROR rustc_deprecated attribute must be paired with either stable or unstable attribute