Skip to content

Commit eeedd3a

Browse files
committed
Auto merge of #60531 - Centril:sort-features, r=oli-obk
Enforce sorting of accepted and removed features Fixes #60361 with mechanism introduced in #60373. r? @oli-obk
2 parents f64ed09 + 639e452 commit eeedd3a

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
#![feature(fundamental)]
8888
#![feature(lang_items)]
8989
#![feature(libc)]
90-
#![feature(needs_allocator)]
9190
#![feature(nll)]
9291
#![feature(optin_builtin_traits)]
9392
#![feature(pattern)]

src/libsyntax/feature_gate.rs

+39-16
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ macro_rules! declare_features {
108108
// was set. This is most important for knowing when a particular feature became
109109
// stable (active).
110110
//
111-
// Note that the features should be grouped into internal/user-facing
112-
// and then sorted by version inside those groups. This is inforced with tidy.
111+
// Note that the features are grouped into internal/user-facing and then
112+
// sorted by version inside those groups. This is inforced with tidy.
113113
//
114114
// N.B., `tools/tidy/src/features.rs` parses this information directly out of the
115115
// source, so take care when modifying it.
@@ -119,7 +119,7 @@ declare_features! (
119119
// feature-group-start: internal feature gates
120120
// -------------------------------------------------------------------------
121121

122-
// no tracking issue START
122+
// no-tracking-issue-start
123123

124124
// Allows using the `rust-intrinsic`'s "ABI".
125125
(active, intrinsics, "1.0.0", None, None),
@@ -152,7 +152,7 @@ declare_features! (
152152
// lets a function to be `const` when opted into with `#![feature(foo)]`.
153153
(active, rustc_const_unstable, "1.0.0", None, None),
154154

155-
// no tracking issue END
155+
// no-tracking-issue-end
156156

157157
// Allows using `#[link_name="llvm.*"]`.
158158
(active, link_llvm_intrinsics, "1.0.0", Some(29602), None),
@@ -187,28 +187,25 @@ declare_features! (
187187
// Allows using `box` in patterns (RFC 469).
188188
(active, box_patterns, "1.0.0", Some(29641), None),
189189

190-
// no tracking issue START
190+
// no-tracking-issue-start
191191

192192
// Allows using `#[prelude_import]` on glob `use` items.
193193
(active, prelude_import, "1.2.0", None, None),
194194

195-
// no tracking issue END
195+
// no-tracking-issue-end
196196

197197
// Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238).
198198
(active, dropck_parametricity, "1.3.0", Some(28498), None),
199199

200-
// FIXME(Centril): Investigate whether this gate actually has any effect.
201-
(active, needs_allocator, "1.4.0", Some(27389), None),
202-
203-
// no tracking issue START
200+
// no-tracking-issue-start
204201

205202
// Allows using `#[omit_gdb_pretty_printer_section]`.
206203
(active, omit_gdb_pretty_printer_section, "1.5.0", None, None),
207204

208205
// Allows using the `vectorcall` ABI.
209206
(active, abi_vectorcall, "1.7.0", None, None),
210207

211-
// no tracking issue END
208+
// no-tracking-issue-end
212209

213210
// Allows using `#[structural_match]` which indicates that a type is structurally matchable.
214211
(active, structural_match, "1.8.0", Some(31434), None),
@@ -222,7 +219,7 @@ declare_features! (
222219
// Allows declaring with `#![needs_panic_runtime]` that a panic runtime is needed.
223220
(active, needs_panic_runtime, "1.10.0", Some(32837), None),
224221

225-
// no tracking issue START
222+
// no-tracking-issue-start
226223

227224
// Allows identifying the `compiler_builtins` crate.
228225
(active, compiler_builtins, "1.13.0", None, None),
@@ -245,7 +242,7 @@ declare_features! (
245242
// Allows using the `format_args_nl` macro.
246243
(active, format_args_nl, "1.29.0", None, None),
247244

248-
// no tracking issue END
245+
// no-tracking-issue-end
249246

250247
// Added for testing E0705; perma-unstable.
251248
(active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)),
@@ -567,6 +564,10 @@ const INCOMPLETE_FEATURES: &[&str] = &[
567564
];
568565

569566
declare_features! (
567+
// -------------------------------------------------------------------------
568+
// feature-group-start: removed features
569+
// -------------------------------------------------------------------------
570+
570571
(removed, import_shadowing, "1.0.0", None, None, None),
571572
(removed, managed_boxes, "1.0.0", None, None, None),
572573
// Allows use of unary negate on unsigned integers, e.g., -e for e: u8
@@ -581,14 +582,16 @@ declare_features! (
581582
(removed, unsafe_no_drop_flag, "1.0.0", None, None, None),
582583
// Allows using items which are missing stability attributes
583584
(removed, unmarked_api, "1.0.0", None, None, None),
584-
(removed, pushpop_unsafe, "1.2.0", None, None, None),
585585
(removed, allocator, "1.0.0", None, None, None),
586586
(removed, simd, "1.0.0", Some(27731), None,
587587
Some("removed in favor of `#[repr(simd)]`")),
588588
(removed, advanced_slice_patterns, "1.0.0", Some(23121), None,
589589
Some("merged into `#![feature(slice_patterns)]`")),
590590
(removed, macro_reexport, "1.0.0", Some(29638), None,
591591
Some("subsumed by `pub use`")),
592+
(removed, pushpop_unsafe, "1.2.0", None, None, None),
593+
(removed, needs_allocator, "1.4.0", Some(27389), None,
594+
Some("subsumed by `#![feature(allocator_internals)]`")),
592595
(removed, proc_macro_mod, "1.27.0", Some(54727), None,
593596
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
594597
(removed, proc_macro_expr, "1.27.0", Some(54727), None,
@@ -600,26 +603,42 @@ declare_features! (
600603
(removed, panic_implementation, "1.28.0", Some(44489), None,
601604
Some("subsumed by `#[panic_handler]`")),
602605
// Allows the use of `#[derive(Anything)]` as sugar for `#[derive_Anything]`.
603-
(removed, custom_derive, "1.0.0", Some(29644), None,
606+
(removed, custom_derive, "1.32.0", Some(29644), None,
604607
Some("subsumed by `#[proc_macro_derive]`")),
605608
// Paths of the form: `extern::foo::bar`
606609
(removed, extern_in_paths, "1.33.0", Some(55600), None,
607610
Some("subsumed by `::foo::bar` paths")),
608-
(removed, quote, "1.0.0", Some(29601), None, None),
611+
(removed, quote, "1.33.0", Some(29601), None, None),
612+
613+
// -------------------------------------------------------------------------
614+
// feature-group-end: removed features
615+
// -------------------------------------------------------------------------
609616
);
610617

611618
declare_features! (
612619
(stable_removed, no_stack_check, "1.0.0", None, None),
613620
);
614621

615622
declare_features! (
623+
// -------------------------------------------------------------------------
624+
// feature-group-start: for testing purposes
625+
// -------------------------------------------------------------------------
626+
616627
// A temporary feature gate used to enable parser extensions needed
617628
// to bootstrap fix for #5723.
618629
(accepted, issue_5723_bootstrap, "1.0.0", None, None),
619630
// These are used to test this portion of the compiler,
620631
// they don't actually mean anything.
621632
(accepted, test_accepted_feature, "1.0.0", None, None),
622633

634+
// -------------------------------------------------------------------------
635+
// feature-group-end: for testing purposes
636+
// -------------------------------------------------------------------------
637+
638+
// -------------------------------------------------------------------------
639+
// feature-group-start: accepted features
640+
// -------------------------------------------------------------------------
641+
623642
// Allows using associated `type`s in `trait`s.
624643
(accepted, associated_types, "1.0.0", None, None),
625644
// Allows using assigning a default type to type parameters in algebraic data type definitions.
@@ -809,6 +828,10 @@ declare_features! (
809828
(accepted, extern_crate_self, "1.34.0", Some(56409), None),
810829
// Allows arbitrary delimited token streams in non-macro attributes.
811830
(accepted, unrestricted_attribute_tokens, "1.34.0", Some(55208), None),
831+
832+
// -------------------------------------------------------------------------
833+
// feature-group-end: accepted features
834+
// -------------------------------------------------------------------------
812835
);
813836

814837
// If you change this, please modify `src/doc/unstable-book` as well. You must

src/tools/tidy/src/features.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features {
191191

192192
// We allow rustc-internal features to omit a tracking issue.
193193
// To make tidy accept omitting a tracking issue, group the list of features
194-
// without one inside `// no tracking issue START` and `// no tracking issue END`.
194+
// without one inside `// no-tracking-issue` and `// no-tracking-issue-end`.
195195
let mut next_feature_omits_tracking_issue = false;
196196

197197
let mut in_feature_group = false;
@@ -201,13 +201,13 @@ pub fn collect_lang_features(base_src_path: &Path, bad: &mut bool) -> Features {
201201
.filter_map(|(line, line_number)| {
202202
let line = line.trim();
203203

204-
// Within START and END, the tracking issue can be omitted.
204+
// Within -start and -end, the tracking issue can be omitted.
205205
match line {
206-
"// no tracking issue START" => {
206+
"// no-tracking-issue-start" => {
207207
next_feature_omits_tracking_issue = true;
208208
return None;
209209
}
210-
"// no tracking issue END" => {
210+
"// no-tracking-issue-end" => {
211211
next_feature_omits_tracking_issue = false;
212212
return None;
213213
}

0 commit comments

Comments
 (0)