]>
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(staged_api)]
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 = "none")] //~ 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 #[deprecated(note = "a")] //~ ERROR missing 'since' [E0542]
43 #[stable(feature = "a", since = "b")]
44 #[deprecated(since = "a")] //~ ERROR missing 'note' [E0543]
48 #[unstable(feature = "b", issue = "none")]
49 #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
52 #[unstable(feature = "b", issue = "none")]
53 #[unstable(feature = "b", issue = "none")] //~ 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")] //~ ERROR invalid stability version found
61 #[deprecated(since = "b", note = "text")]
62 #[deprecated(since = "b", note = "text")] //~ ERROR multiple deprecated attributes
63 #[rustc_const_unstable(feature = "c", issue = "none")]
64 #[rustc_const_unstable(feature = "d", issue = "none")] //~ ERROR multiple stability levels
65 pub const fn multiple4() { }
67 #[stable(feature = "a", since = "1.0.0")] //~ ERROR invalid deprecation version found
68 //~^ ERROR feature `a` is declared stable since 1.0.0
69 #[deprecated(since = "invalid", note = "text")]
70 fn invalid_deprecation_version() {}
72 #[deprecated(since = "a", note = "text")]
73 fn deprecated_without_unstable_or_stable() { }
74 //~^^ ERROR deprecated attribute must be paired with either stable or unstable attribute