3
3
use crate :: symbol:: { Symbol , sym} ;
4
4
5
5
macro_rules! declare_features {
6
- ( $( ( accepted, $feature: ident, $ver: expr, $issue: expr, None ) , ) +) => {
6
+ ( $(
7
+ $( #[ doc = $doc: tt] ) * ( accepted, $feature: ident, $ver: expr, $issue: expr, None ) ,
8
+ ) +) => {
7
9
/// Those language feature has since been Accepted (it was once Active)
8
10
pub const ACCEPTED_FEATURES : & [ ( Symbol , & str , Option <u32 >, Option <& str >) ] = & [
9
11
$( ( sym:: $feature, $ver, $issue, None ) ) ,+
@@ -16,11 +18,11 @@ declare_features! (
16
18
// feature-group-start: for testing purposes
17
19
// -------------------------------------------------------------------------
18
20
19
- // A temporary feature gate used to enable parser extensions needed
20
- // to bootstrap fix for #5723.
21
+ /// A temporary feature gate used to enable parser extensions needed
22
+ /// to bootstrap fix for #5723.
21
23
( accepted, issue_5723_bootstrap, "1.0.0" , None , None ) ,
22
- // These are used to test this portion of the compiler,
23
- // they don't actually mean anything.
24
+ /// These are used to test this portion of the compiler,
25
+ /// they don't actually mean anything.
24
26
( accepted, test_accepted_feature, "1.0.0" , None , None ) ,
25
27
26
28
// -------------------------------------------------------------------------
@@ -31,203 +33,203 @@ declare_features! (
31
33
// feature-group-start: accepted features
32
34
// -------------------------------------------------------------------------
33
35
34
- // Allows using associated `type`s in `trait`s.
36
+ /// Allows using associated `type`s in `trait`s.
35
37
( accepted, associated_types, "1.0.0" , None , None ) ,
36
- // Allows using assigning a default type to type parameters in algebraic data type definitions.
38
+ /// Allows using assigning a default type to type parameters in algebraic data type definitions.
37
39
( accepted, default_type_params, "1.0.0" , None , None ) ,
38
40
// FIXME: explain `globs`.
39
41
( accepted, globs, "1.0.0" , None , None ) ,
40
- // Allows `macro_rules!` items.
42
+ /// Allows `macro_rules!` items.
41
43
( accepted, macro_rules, "1.0.0" , None , None ) ,
42
- // Allows use of `&foo[a..b]` as a slicing syntax.
44
+ /// Allows use of `&foo[a..b]` as a slicing syntax.
43
45
( accepted, slicing_syntax, "1.0.0" , None , None ) ,
44
- // Allows struct variants `Foo { baz: u8, .. }` in enums (RFC 418).
46
+ /// Allows struct variants `Foo { baz: u8, .. }` in enums (RFC 418).
45
47
( accepted, struct_variant, "1.0.0" , None , None ) ,
46
- // Allows indexing tuples.
48
+ /// Allows indexing tuples.
47
49
( accepted, tuple_indexing, "1.0.0" , None , None ) ,
48
- // Allows the use of `if let` expressions.
50
+ /// Allows the use of `if let` expressions.
49
51
( accepted, if_let, "1.0.0" , None , None ) ,
50
- // Allows the use of `while let` expressions.
52
+ /// Allows the use of `while let` expressions.
51
53
( accepted, while_let, "1.0.0" , None , None ) ,
52
- // Allows using `#![no_std]`.
54
+ /// Allows using `#![no_std]`.
53
55
( accepted, no_std, "1.6.0" , None , None ) ,
54
- // Allows overloading augmented assignment operations like `a += b`.
56
+ /// Allows overloading augmented assignment operations like `a += b`.
55
57
( accepted, augmented_assignments, "1.8.0" , Some ( 28235 ) , None ) ,
56
- // Allows empty structs and enum variants with braces.
58
+ /// Allows empty structs and enum variants with braces.
57
59
( accepted, braced_empty_structs, "1.8.0" , Some ( 29720 ) , None ) ,
58
- // Allows `#[deprecated]` attribute.
60
+ /// Allows `#[deprecated]` attribute.
59
61
( accepted, deprecated, "1.9.0" , Some ( 29935 ) , None ) ,
60
- // Allows macros to appear in the type position.
62
+ /// Allows macros to appear in the type position.
61
63
( accepted, type_macros, "1.13.0" , Some ( 27245 ) , None ) ,
62
- // Allows use of the postfix `?` operator in expressions.
64
+ /// Allows use of the postfix `?` operator in expressions.
63
65
( accepted, question_mark, "1.13.0" , Some ( 31436 ) , None ) ,
64
- // Allows `..` in tuple (struct) patterns.
66
+ /// Allows `..` in tuple (struct) patterns.
65
67
( accepted, dotdot_in_tuple_patterns, "1.14.0" , Some ( 33627 ) , None ) ,
66
- // Allows some increased flexibility in the name resolution rules,
67
- // especially around globs and shadowing (RFC 1560).
68
+ /// Allows some increased flexibility in the name resolution rules,
69
+ /// especially around globs and shadowing (RFC 1560).
68
70
( accepted, item_like_imports, "1.15.0" , Some ( 35120 ) , None ) ,
69
- // Allows using `Self` and associated types in struct expressions and patterns.
71
+ /// Allows using `Self` and associated types in struct expressions and patterns.
70
72
( accepted, more_struct_aliases, "1.16.0" , Some ( 37544 ) , None ) ,
71
- // Allows elision of `'static` lifetimes in `static`s and `const`s.
73
+ /// Allows elision of `'static` lifetimes in `static`s and `const`s.
72
74
( accepted, static_in_const, "1.17.0" , Some ( 35897 ) , None ) ,
73
- // Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
75
+ /// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
74
76
( accepted, field_init_shorthand, "1.17.0" , Some ( 37340 ) , None ) ,
75
- // Allows the definition recursive static items.
77
+ /// Allows the definition recursive static items.
76
78
( accepted, static_recursion, "1.17.0" , Some ( 29719 ) , None ) ,
77
- // Allows `pub(restricted)` visibilities (RFC 1422).
79
+ /// Allows `pub(restricted)` visibilities (RFC 1422).
78
80
( accepted, pub_restricted, "1.18.0" , Some ( 32409 ) , None ) ,
79
- // Allows `#![windows_subsystem]`.
81
+ /// Allows `#![windows_subsystem]`.
80
82
( accepted, windows_subsystem, "1.18.0" , Some ( 37499 ) , None ) ,
81
- // Allows `break {expr}` with a value inside `loop`s.
83
+ /// Allows `break {expr}` with a value inside `loop`s.
82
84
( accepted, loop_break_value, "1.19.0" , Some ( 37339 ) , None ) ,
83
- // Allows numeric fields in struct expressions and patterns.
85
+ /// Allows numeric fields in struct expressions and patterns.
84
86
( accepted, relaxed_adts, "1.19.0" , Some ( 35626 ) , None ) ,
85
- // Allows coercing non capturing closures to function pointers.
87
+ /// Allows coercing non capturing closures to function pointers.
86
88
( accepted, closure_to_fn_coercion, "1.19.0" , Some ( 39817 ) , None ) ,
87
- // Allows attributes on struct literal fields.
89
+ /// Allows attributes on struct literal fields.
88
90
( accepted, struct_field_attributes, "1.20.0" , Some ( 38814 ) , None ) ,
89
- // Allows the definition of associated constants in `trait` or `impl` blocks.
91
+ /// Allows the definition of associated constants in `trait` or `impl` blocks.
90
92
( accepted, associated_consts, "1.20.0" , Some ( 29646 ) , None ) ,
91
- // Allows usage of the `compile_error!` macro.
93
+ /// Allows usage of the `compile_error!` macro.
92
94
( accepted, compile_error, "1.20.0" , Some ( 40872 ) , None ) ,
93
- // Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
95
+ /// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
94
96
( accepted, rvalue_static_promotion, "1.21.0" , Some ( 38865 ) , None ) ,
95
- // Allows `Drop` types in constants (RFC 1440).
97
+ /// Allows `Drop` types in constants (RFC 1440).
96
98
( accepted, drop_types_in_const, "1.22.0" , Some ( 33156 ) , None ) ,
97
- // Allows the sysV64 ABI to be specified on all platforms
98
- // instead of just the platforms on which it is the C ABI.
99
+ /// Allows the sysV64 ABI to be specified on all platforms
100
+ /// instead of just the platforms on which it is the C ABI.
99
101
( accepted, abi_sysv64, "1.24.0" , Some ( 36167 ) , None ) ,
100
- // Allows `repr(align(16))` struct attribute (RFC 1358).
102
+ /// Allows `repr(align(16))` struct attribute (RFC 1358).
101
103
( accepted, repr_align, "1.25.0" , Some ( 33626 ) , None ) ,
102
- // Allows '|' at beginning of match arms (RFC 1925).
104
+ /// Allows '|' at beginning of match arms (RFC 1925).
103
105
( accepted, match_beginning_vert, "1.25.0" , Some ( 44101 ) , None ) ,
104
- // Allows nested groups in `use` items (RFC 2128).
106
+ /// Allows nested groups in `use` items (RFC 2128).
105
107
( accepted, use_nested_groups, "1.25.0" , Some ( 44494 ) , None ) ,
106
- // Allows indexing into constant arrays.
108
+ /// Allows indexing into constant arrays.
107
109
( accepted, const_indexing, "1.26.0" , Some ( 29947 ) , None ) ,
108
- // Allows using `a..=b` and `..=b` as inclusive range syntaxes.
110
+ /// Allows using `a..=b` and `..=b` as inclusive range syntaxes.
109
111
( accepted, inclusive_range_syntax, "1.26.0" , Some ( 28237 ) , None ) ,
110
- // Allows `..=` in patterns (RFC 1192).
112
+ /// Allows `..=` in patterns (RFC 1192).
111
113
( accepted, dotdoteq_in_patterns, "1.26.0" , Some ( 28237 ) , None ) ,
112
- // Allows `fn main()` with return types which implements `Termination` (RFC 1937).
114
+ /// Allows `fn main()` with return types which implements `Termination` (RFC 1937).
113
115
( accepted, termination_trait, "1.26.0" , Some ( 43301 ) , None ) ,
114
- // Allows implementing `Clone` for closures where possible (RFC 2132).
116
+ /// Allows implementing `Clone` for closures where possible (RFC 2132).
115
117
( accepted, clone_closures, "1.26.0" , Some ( 44490 ) , None ) ,
116
- // Allows implementing `Copy` for closures where possible (RFC 2132).
118
+ /// Allows implementing `Copy` for closures where possible (RFC 2132).
117
119
( accepted, copy_closures, "1.26.0" , Some ( 44490 ) , None ) ,
118
- // Allows `impl Trait` in function arguments.
120
+ /// Allows `impl Trait` in function arguments.
119
121
( accepted, universal_impl_trait, "1.26.0" , Some ( 34511 ) , None ) ,
120
- // Allows `impl Trait` in function return types.
122
+ /// Allows `impl Trait` in function return types.
121
123
( accepted, conservative_impl_trait, "1.26.0" , Some ( 34511 ) , None ) ,
122
- // Allows using the `u128` and `i128` types.
124
+ /// Allows using the `u128` and `i128` types.
123
125
( accepted, i128_type, "1.26.0" , Some ( 35118 ) , None ) ,
124
- // Allows default match binding modes (RFC 2005).
126
+ /// Allows default match binding modes (RFC 2005).
125
127
( accepted, match_default_bindings, "1.26.0" , Some ( 42640 ) , None ) ,
126
- // Allows `'_` placeholder lifetimes.
128
+ /// Allows `'_` placeholder lifetimes.
127
129
( accepted, underscore_lifetimes, "1.26.0" , Some ( 44524 ) , None ) ,
128
- // Allows attributes on lifetime/type formal parameters in generics (RFC 1327).
130
+ /// Allows attributes on lifetime/type formal parameters in generics (RFC 1327).
129
131
( accepted, generic_param_attrs, "1.27.0" , Some ( 48848 ) , None ) ,
130
- // Allows `cfg(target_feature = "...")`.
132
+ /// Allows `cfg(target_feature = "...")`.
131
133
( accepted, cfg_target_feature, "1.27.0" , Some ( 29717 ) , None ) ,
132
- // Allows `#[target_feature(...)]`.
134
+ /// Allows `#[target_feature(...)]`.
133
135
( accepted, target_feature, "1.27.0" , None , None ) ,
134
- // Allows using `dyn Trait` as a syntax for trait objects.
136
+ /// Allows using `dyn Trait` as a syntax for trait objects.
135
137
( accepted, dyn_trait, "1.27.0" , Some ( 44662 ) , None ) ,
136
- // Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940).
138
+ /// Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940).
137
139
( accepted, fn_must_use, "1.27.0" , Some ( 43302 ) , None ) ,
138
- // Allows use of the `:lifetime` macro fragment specifier.
140
+ /// Allows use of the `:lifetime` macro fragment specifier.
139
141
( accepted, macro_lifetime_matcher, "1.27.0" , Some ( 34303 ) , None ) ,
140
- // Allows `#[test]` functions where the return type implements `Termination` (RFC 1937).
142
+ /// Allows `#[test]` functions where the return type implements `Termination` (RFC 1937).
141
143
( accepted, termination_trait_test, "1.27.0" , Some ( 48854 ) , None ) ,
142
- // Allows the `#[global_allocator]` attribute.
144
+ /// Allows the `#[global_allocator]` attribute.
143
145
( accepted, global_allocator, "1.28.0" , Some ( 27389 ) , None ) ,
144
- // Allows `#[repr(transparent)]` attribute on newtype structs.
146
+ /// Allows `#[repr(transparent)]` attribute on newtype structs.
145
147
( accepted, repr_transparent, "1.28.0" , Some ( 43036 ) , None ) ,
146
- // Allows procedural macros in `proc-macro` crates.
148
+ /// Allows procedural macros in `proc-macro` crates.
147
149
( accepted, proc_macro, "1.29.0" , Some ( 38356 ) , None ) ,
148
- // Allows `foo.rs` as an alternative to `foo/mod.rs`.
150
+ /// Allows `foo.rs` as an alternative to `foo/mod.rs`.
149
151
( accepted, non_modrs_mods, "1.30.0" , Some ( 44660 ) , None ) ,
150
- // Allows use of the `:vis` macro fragment specifier
152
+ /// Allows use of the `:vis` macro fragment specifier
151
153
( accepted, macro_vis_matcher, "1.30.0" , Some ( 41022 ) , None ) ,
152
- // Allows importing and reexporting macros with `use`,
153
- // enables macro modularization in general.
154
+ /// Allows importing and reexporting macros with `use`,
155
+ /// enables macro modularization in general.
154
156
( accepted, use_extern_macros, "1.30.0" , Some ( 35896 ) , None ) ,
155
- // Allows keywords to be escaped for use as identifiers.
157
+ /// Allows keywords to be escaped for use as identifiers.
156
158
( accepted, raw_identifiers, "1.30.0" , Some ( 48589 ) , None ) ,
157
- // Allows attributes scoped to tools.
159
+ /// Allows attributes scoped to tools.
158
160
( accepted, tool_attributes, "1.30.0" , Some ( 44690 ) , None ) ,
159
- // Allows multi-segment paths in attributes and derives.
161
+ /// Allows multi-segment paths in attributes and derives.
160
162
( accepted, proc_macro_path_invoc, "1.30.0" , Some ( 38356 ) , None ) ,
161
- // Allows all literals in attribute lists and values of key-value pairs.
163
+ /// Allows all literals in attribute lists and values of key-value pairs.
162
164
( accepted, attr_literals, "1.30.0" , Some ( 34981 ) , None ) ,
163
- // Allows inferring outlives requirements (RFC 2093).
165
+ /// Allows inferring outlives requirements (RFC 2093).
164
166
( accepted, infer_outlives_requirements, "1.30.0" , Some ( 44493 ) , None ) ,
165
- // Allows annotating functions conforming to `fn(&PanicInfo) -> !` with `#[panic_handler]`.
166
- // This defines the behavior of panics.
167
+ /// Allows annotating functions conforming to `fn(&PanicInfo) -> !` with `#[panic_handler]`.
168
+ /// This defines the behavior of panics.
167
169
( accepted, panic_handler, "1.30.0" , Some ( 44489 ) , None ) ,
168
- // Allows `#[used]` to preserve symbols (see llvm.used).
170
+ /// Allows `#[used]` to preserve symbols (see llvm.used).
169
171
( accepted, used, "1.30.0" , Some ( 40289 ) , None ) ,
170
- // Allows `crate` in paths.
172
+ /// Allows `crate` in paths.
171
173
( accepted, crate_in_paths, "1.30.0" , Some ( 45477 ) , None ) ,
172
- // Allows resolving absolute paths as paths from other crates.
174
+ /// Allows resolving absolute paths as paths from other crates.
173
175
( accepted, extern_absolute_paths, "1.30.0" , Some ( 44660 ) , None ) ,
174
- // Allows access to crate names passed via `--extern` through prelude.
176
+ /// Allows access to crate names passed via `--extern` through prelude.
175
177
( accepted, extern_prelude, "1.30.0" , Some ( 44660 ) , None ) ,
176
- // Allows parentheses in patterns.
178
+ /// Allows parentheses in patterns.
177
179
( accepted, pattern_parentheses, "1.31.0" , Some ( 51087 ) , None ) ,
178
- // Allows the definition of `const fn` functions.
180
+ /// Allows the definition of `const fn` functions.
179
181
( accepted, min_const_fn, "1.31.0" , Some ( 53555 ) , None ) ,
180
- // Allows scoped lints.
182
+ /// Allows scoped lints.
181
183
( accepted, tool_lints, "1.31.0" , Some ( 44690 ) , None ) ,
182
- // Allows lifetime elision in `impl` headers. For example:
183
- // + `impl<I:Iterator> Iterator for &mut Iterator`
184
- // + `impl Debug for Foo<'_>`
184
+ /// Allows lifetime elision in `impl` headers. For example:
185
+ /// + `impl<I:Iterator> Iterator for &mut Iterator`
186
+ /// + `impl Debug for Foo<'_>`
185
187
( accepted, impl_header_lifetime_elision, "1.31.0" , Some ( 15872 ) , None ) ,
186
- // Allows `extern crate foo as bar;`. This puts `bar` into extern prelude.
188
+ /// Allows `extern crate foo as bar;`. This puts `bar` into extern prelude.
187
189
( accepted, extern_crate_item_prelude, "1.31.0" , Some ( 55599 ) , None ) ,
188
- // Allows use of the `:literal` macro fragment specifier (RFC 1576).
190
+ /// Allows use of the `:literal` macro fragment specifier (RFC 1576).
189
191
( accepted, macro_literal_matcher, "1.32.0" , Some ( 35625 ) , None ) ,
190
- // Allows use of `?` as the Kleene "at most one" operator in macros.
192
+ /// Allows use of `?` as the Kleene "at most one" operator in macros.
191
193
( accepted, macro_at_most_once_rep, "1.32.0" , Some ( 48075 ) , None ) ,
192
- // Allows `Self` struct constructor (RFC 2302).
194
+ /// Allows `Self` struct constructor (RFC 2302).
193
195
( accepted, self_struct_ctor, "1.32.0" , Some ( 51994 ) , None ) ,
194
- // Allows `Self` in type definitions (RFC 2300).
196
+ /// Allows `Self` in type definitions (RFC 2300).
195
197
( accepted, self_in_typedefs, "1.32.0" , Some ( 49303 ) , None ) ,
196
- // Allows `use x::y;` to search `x` in the current scope.
198
+ /// Allows `use x::y;` to search `x` in the current scope.
197
199
( accepted, uniform_paths, "1.32.0" , Some ( 53130 ) , None ) ,
198
- // Allows integer match exhaustiveness checking (RFC 2591).
200
+ /// Allows integer match exhaustiveness checking (RFC 2591).
199
201
( accepted, exhaustive_integer_patterns, "1.33.0" , Some ( 50907 ) , None ) ,
200
- // Allows `use path as _;` and `extern crate c as _;`.
202
+ /// Allows `use path as _;` and `extern crate c as _;`.
201
203
( accepted, underscore_imports, "1.33.0" , Some ( 48216 ) , None ) ,
202
- // Allows `#[repr(packed(N))]` attribute on structs.
204
+ /// Allows `#[repr(packed(N))]` attribute on structs.
203
205
( accepted, repr_packed, "1.33.0" , Some ( 33158 ) , None ) ,
204
- // Allows irrefutable patterns in `if let` and `while let` statements (RFC 2086).
206
+ /// Allows irrefutable patterns in `if let` and `while let` statements (RFC 2086).
205
207
( accepted, irrefutable_let_patterns, "1.33.0" , Some ( 44495 ) , None ) ,
206
- // Allows calling `const unsafe fn` inside `unsafe` blocks in `const fn` functions.
208
+ /// Allows calling `const unsafe fn` inside `unsafe` blocks in `const fn` functions.
207
209
( accepted, min_const_unsafe_fn, "1.33.0" , Some ( 55607 ) , None ) ,
208
- // Allows let bindings, assignments and destructuring in `const` functions and constants.
209
- // As long as control flow is not implemented in const eval, `&&` and `||` may not be used
210
- // at the same time as let bindings.
210
+ /// Allows let bindings, assignments and destructuring in `const` functions and constants.
211
+ /// As long as control flow is not implemented in const eval, `&&` and `||` may not be used
212
+ /// at the same time as let bindings.
211
213
( accepted, const_let, "1.33.0" , Some ( 48821 ) , None ) ,
212
- // Allows `#[cfg_attr(predicate, multiple, attributes, here)]`.
214
+ /// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`.
213
215
( accepted, cfg_attr_multi, "1.33.0" , Some ( 54881 ) , None ) ,
214
- // Allows top level or-patterns (`p | q`) in `if let` and `while let`.
216
+ /// Allows top level or-patterns (`p | q`) in `if let` and `while let`.
215
217
( accepted, if_while_or_patterns, "1.33.0" , Some ( 48215 ) , None ) ,
216
- // Allows `cfg(target_vendor = "...")`.
218
+ /// Allows `cfg(target_vendor = "...")`.
217
219
( accepted, cfg_target_vendor, "1.33.0" , Some ( 29718 ) , None ) ,
218
- // Allows `extern crate self as foo;`.
219
- // This puts local crate root into extern prelude under name `foo`.
220
+ /// Allows `extern crate self as foo;`.
221
+ /// This puts local crate root into extern prelude under name `foo`.
220
222
( accepted, extern_crate_self, "1.34.0" , Some ( 56409 ) , None ) ,
221
- // Allows arbitrary delimited token streams in non-macro attributes.
223
+ /// Allows arbitrary delimited token streams in non-macro attributes.
222
224
( accepted, unrestricted_attribute_tokens, "1.34.0" , Some ( 55208 ) , None ) ,
223
- // Allows paths to enum variants on type aliases including `Self`.
225
+ /// Allows paths to enum variants on type aliases including `Self`.
224
226
( accepted, type_alias_enum_variants, "1.37.0" , Some ( 49683 ) , None ) ,
225
- // Allows using `#[repr(align(X))]` on enums with equivalent semantics
226
- // to wrapping an enum in a wrapper struct with `#[repr(align(X))]`.
227
+ /// Allows using `#[repr(align(X))]` on enums with equivalent semantics
228
+ /// to wrapping an enum in a wrapper struct with `#[repr(align(X))]`.
227
229
( accepted, repr_align_enum, "1.37.0" , Some ( 57996 ) , None ) ,
228
- // Allows `const _: TYPE = VALUE`.
230
+ /// Allows `const _: TYPE = VALUE`.
229
231
( accepted, underscore_const_names, "1.37.0" , Some ( 54912 ) , None ) ,
230
- // Allows free and inherent `async fn`s, `async` blocks, and `<expr>.await` expressions.
232
+ /// Allows free and inherent `async fn`s, `async` blocks, and `<expr>.await` expressions.
231
233
( accepted, async_await, "1.39.0" , Some ( 50547 ) , None ) ,
232
234
233
235
// -------------------------------------------------------------------------
0 commit comments