Skip to content

Commit ea178e4

Browse files
committed
Enforce sorting of accepted and removed features.
1 parent a340455 commit ea178e4

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

src/libsyntax/feature_gate.rs

Lines changed: 31 additions & 8 deletions
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.
@@ -197,9 +197,6 @@ declare_features! (
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-
203200
// no tracking issue START
204201

205202
// Allows using `#[omit_gdb_pretty_printer_section]`.
@@ -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

0 commit comments

Comments
 (0)