]>
Commit | Line | Data |
---|---|---|
e1599b0c XL |
1 | //! List of the removed feature gates. |
2 | ||
1b1a35ee | 3 | use super::{to_nonzero, Feature, State}; |
dfeec247 | 4 | use rustc_span::symbol::sym; |
e1599b0c XL |
5 | |
6 | macro_rules! declare_features { | |
7 | ($( | |
8 | $(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, None, $reason:expr), | |
9 | )+) => { | |
10 | /// Represents unstable features which have since been removed (it was once Active) | |
11 | pub const REMOVED_FEATURES: &[Feature] = &[ | |
12 | $( | |
13 | Feature { | |
14 | state: State::Removed { reason: $reason }, | |
15 | name: sym::$feature, | |
16 | since: $ver, | |
1b1a35ee | 17 | issue: to_nonzero($issue), |
e1599b0c | 18 | edition: None, |
e1599b0c XL |
19 | } |
20 | ),+ | |
21 | ]; | |
22 | }; | |
23 | ||
24 | ($( | |
25 | $(#[doc = $doc:tt])* (stable_removed, $feature:ident, $ver:expr, $issue:expr, None), | |
26 | )+) => { | |
27 | /// Represents stable features which have since been removed (it was once Accepted) | |
28 | pub const STABLE_REMOVED_FEATURES: &[Feature] = &[ | |
29 | $( | |
30 | Feature { | |
31 | state: State::Stabilized { reason: None }, | |
32 | name: sym::$feature, | |
33 | since: $ver, | |
1b1a35ee | 34 | issue: to_nonzero($issue), |
e1599b0c | 35 | edition: None, |
e1599b0c XL |
36 | } |
37 | ),+ | |
38 | ]; | |
39 | }; | |
40 | } | |
41 | ||
dfeec247 | 42 | #[rustfmt::skip] |
e1599b0c XL |
43 | declare_features! ( |
44 | // ------------------------------------------------------------------------- | |
45 | // feature-group-start: removed features | |
46 | // ------------------------------------------------------------------------- | |
47 | ||
e1599b0c XL |
48 | (removed, advanced_slice_patterns, "1.0.0", Some(62254), None, |
49 | Some("merged into `#![feature(slice_patterns)]`")), | |
3c0e092e XL |
50 | (removed, allocator, "1.0.0", None, None, None), |
51 | (removed, await_macro, "1.38.0", Some(50547), None, | |
52 | Some("subsumed by `.await` syntax")), | |
53 | /// Allows comparing raw pointers during const eval. | |
54 | (removed, const_compare_raw_pointers, "1.46.0", Some(53020), None, | |
55 | Some("cannot be allowed in const eval in any meaningful way")), | |
56 | /// Allows non-trivial generic constants which have to be manually propagated upwards. | |
57 | (removed, const_evaluatable_checked, "1.48.0", Some(76560), None, Some("renamed to `generic_const_exprs`")), | |
58 | /// Allows the definition of `const` functions with some advanced features. | |
59 | (removed, const_fn, "1.54.0", Some(57563), None, | |
60 | Some("split into finer-grained feature gates")), | |
61 | /// Allows const generic types (e.g. `struct Foo<const N: usize>(...);`). | |
62 | (removed, const_generics, "1.34.0", Some(44580), None, | |
63 | Some("removed in favor of `#![feature(adt_const_params)]` and `#![feature(generic_const_exprs)]`")), | |
64 | /// Allows `[x; N]` where `x` is a constant (RFC 2203). | |
65 | (removed, const_in_array_repeat_expressions, "1.37.0", Some(49147), None, | |
66 | Some("removed due to causing promotable bugs")), | |
67 | /// Allows casting raw pointers to `usize` during const eval. | |
68 | (removed, const_raw_ptr_to_usize_cast, "1.55.0", Some(51910), None, | |
69 | Some("at compile-time, pointers do not have an integer value, so these casts cannot be properly supported")), | |
70 | /// Allows `T: ?const Trait` syntax in bounds. | |
71 | (removed, const_trait_bound_opt_out, "1.42.0", Some(67794), None, | |
72 | Some("Removed in favor of `~const` bound in #![feature(const_trait_impl)]")), | |
60c5eb7d XL |
73 | /// Allows using custom attributes (RFC 572). |
74 | (removed, custom_attribute, "1.0.0", Some(29642), None, | |
75 | Some("removed in favor of `#![register_tool]` and `#![register_attr]`")), | |
3c0e092e XL |
76 | /// Allows the use of `#[derive(Anything)]` as sugar for `#[derive_Anything]`. |
77 | (removed, custom_derive, "1.32.0", Some(29644), None, | |
78 | Some("subsumed by `#[proc_macro_derive]`")), | |
79 | /// Allows using `#[doc(keyword = "...")]`. | |
80 | (removed, doc_keyword, "1.28.0", Some(51315), None, | |
81 | Some("merged into `#![feature(rustdoc_internals)]`")), | |
82 | /// Allows using `doc(primitive)` without a future-incompat warning. | |
83 | (removed, doc_primitive, "1.56.0", Some(88070), None, | |
84 | Some("merged into `#![feature(rustdoc_internals)]`")), | |
cdc7bbd5 XL |
85 | /// Allows `#[doc(spotlight)]`. |
86 | /// The attribute was renamed to `#[doc(notable_trait)]` | |
87 | /// and the feature to `doc_notable_trait`. | |
88 | (removed, doc_spotlight, "1.22.0", Some(45040), None, | |
89 | Some("renamed to `doc_notable_trait`")), | |
e1599b0c XL |
90 | /// Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238). |
91 | (removed, dropck_parametricity, "1.38.0", Some(28498), None, None), | |
e1599b0c XL |
92 | /// Allows defining `existential type`s. |
93 | (removed, existential_type, "1.38.0", Some(63063), None, | |
94222f64 | 94 | Some("removed in favor of `#![feature(type_alias_impl_trait)]`")), |
3c0e092e XL |
95 | /// Paths of the form: `extern::foo::bar` |
96 | (removed, extern_in_paths, "1.33.0", Some(55600), None, | |
97 | Some("subsumed by `::foo::bar` paths")), | |
98 | /// Allows `#[doc(include = "some-file")]`. | |
99 | (removed, external_doc, "1.54.0", Some(44732), None, | |
100 | Some("use #[doc = include_str!(\"filename\")] instead, which handles macro invocations")), | |
101 | /// Allows `impl Trait` in bindings (`let`, `const`, `static`). | |
102 | (removed, impl_trait_in_bindings, "1.55.0", Some(63065), None, | |
103 | Some("the implementation was not maintainable, the feature may get reintroduced once the current refactorings are done")), | |
104 | (removed, import_shadowing, "1.0.0", None, None, None), | |
94222f64 XL |
105 | /// Lazily evaluate constants. This allows constants to depend on type parameters. |
106 | (removed, lazy_normalization_consts, "1.46.0", Some(72219), None, Some("superseded by `generic_const_exprs`")), | |
cdc7bbd5 XL |
107 | /// Allows using the `#[link_args]` attribute. |
108 | (removed, link_args, "1.53.0", Some(29596), None, | |
109 | Some("removed in favor of using `-C link-arg=ARG` on command line, \ | |
110 | which is available from cargo build scripts with `cargo:rustc-link-arg` now")), | |
3c0e092e XL |
111 | (removed, macro_reexport, "1.0.0", Some(29638), None, |
112 | Some("subsumed by `pub use`")), | |
cdc7bbd5 XL |
113 | /// Allows using `#[main]` to replace the entrypoint `#[lang = "start"]` calls. |
114 | (removed, main, "1.53.0", Some(29634), None, None), | |
3c0e092e | 115 | (removed, managed_boxes, "1.0.0", None, None, None), |
94222f64 XL |
116 | /// Allows the use of type alias impl trait in function return positions |
117 | (removed, min_type_alias_impl_trait, "1.56.0", Some(63063), None, | |
118 | Some("removed in favor of full type_alias_impl_trait")), | |
3c0e092e XL |
119 | (removed, needs_allocator, "1.4.0", Some(27389), None, |
120 | Some("subsumed by `#![feature(allocator_internals)]`")), | |
121 | /// Allows use of unary negate on unsigned integers, e.g., -e for e: u8 | |
122 | (removed, negate_unsigned, "1.0.0", Some(29645), None, None), | |
123 | /// Allows `#[no_debug]`. | |
124 | (removed, no_debug, "1.43.0", Some(29721), None, Some("removed due to lack of demand")), | |
125 | /// Allows using `#[on_unimplemented(..)]` on traits. | |
126 | /// (Moved to `rustc_attrs`.) | |
127 | (removed, on_unimplemented, "1.40.0", None, None, None), | |
128 | /// A way to temporarily opt out of opt in copy. This will *never* be accepted. | |
129 | (removed, opt_out_copy, "1.0.0", None, None, None), | |
130 | /// Allows features specific to OIBIT (now called auto traits). | |
131 | /// Renamed to `auto_traits`. | |
132 | (removed, optin_builtin_traits, "1.0.0", Some(13231), None, | |
133 | Some("renamed to `auto_traits`")), | |
134 | /// Allows overlapping impls of marker traits. | |
135 | (removed, overlapping_marker_traits, "1.42.0", Some(29864), None, | |
136 | Some("removed in favor of `#![feature(marker_trait_attr)]`")), | |
137 | (removed, panic_implementation, "1.28.0", Some(44489), None, | |
138 | Some("subsumed by `#[panic_handler]`")), | |
139 | /// Allows using `#[plugin_registrar]` on functions. | |
140 | (removed, plugin_registrar, "1.54.0", Some(29597), None, | |
141 | Some("a __rustc_plugin_registrar symbol must now be defined instead")), | |
142 | (removed, proc_macro_expr, "1.27.0", Some(54727), None, | |
143 | Some("subsumed by `#![feature(proc_macro_hygiene)]`")), | |
144 | (removed, proc_macro_gen, "1.27.0", Some(54727), None, | |
145 | Some("subsumed by `#![feature(proc_macro_hygiene)]`")), | |
146 | (removed, proc_macro_mod, "1.27.0", Some(54727), None, | |
147 | Some("subsumed by `#![feature(proc_macro_hygiene)]`")), | |
148 | (removed, proc_macro_non_items, "1.27.0", Some(54727), None, | |
149 | Some("subsumed by `#![feature(proc_macro_hygiene)]`")), | |
150 | (removed, pub_macro_rules, "1.53.0", Some(78855), None, | |
151 | Some("removed due to being incomplete, in particular it does not work across crates")), | |
152 | (removed, pushpop_unsafe, "1.2.0", None, None, None), | |
153 | (removed, quad_precision_float, "1.0.0", None, None, None), | |
154 | (removed, quote, "1.33.0", Some(29601), None, None), | |
155 | (removed, reflect, "1.0.0", Some(27749), None, None), | |
156 | /// Allows using the macros: | |
157 | /// + `__diagnostic_used` | |
158 | /// + `__register_diagnostic` | |
159 | /// +`__build_diagnostic_array` | |
160 | (removed, rustc_diagnostic_macros, "1.38.0", None, None, None), | |
161 | /// Allows identifying crates that contain sanitizer runtimes. | |
162 | (removed, sanitizer_runtime, "1.17.0", None, None, None), | |
163 | (removed, simd, "1.0.0", Some(27731), None, | |
164 | Some("removed in favor of `#[repr(simd)]`")), | |
165 | (removed, struct_inherit, "1.0.0", None, None, None), | |
166 | (removed, test_removed_feature, "1.0.0", None, None, None), | |
167 | /// Allows using items which are missing stability attributes | |
168 | (removed, unmarked_api, "1.0.0", None, None, None), | |
169 | (removed, unsafe_no_drop_flag, "1.0.0", None, None, None), | |
94222f64 XL |
170 | /// Allows `#[unwind(..)]`. |
171 | /// | |
172 | /// Permits specifying whether a function should permit unwinding or abort on unwind. | |
173 | (removed, unwind_attributes, "1.56.0", Some(58760), None, Some("use the C-unwind ABI instead")), | |
3c0e092e XL |
174 | (removed, visible_private_types, "1.0.0", None, None, None), |
175 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
176 | // Features are listed in alphabetical order. Tidy will fail if you don't keep it this way. | |
177 | // !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! | |
94222f64 | 178 | |
e1599b0c XL |
179 | // ------------------------------------------------------------------------- |
180 | // feature-group-end: removed features | |
181 | // ------------------------------------------------------------------------- | |
182 | ); | |
183 | ||
dfeec247 | 184 | #[rustfmt::skip] |
e1599b0c XL |
185 | declare_features! ( |
186 | (stable_removed, no_stack_check, "1.0.0", None, None), | |
187 | ); |