Skip to content

Commit 68a02ac

Browse files
committed
Cleanup declare_features! for 'accepted' with a uniform style + sort them.
1 parent 3418d2f commit 68a02ac

File tree

1 file changed

+73
-56
lines changed

1 file changed

+73
-56
lines changed

src/libsyntax/feature_gate.rs

+73-56
Original file line numberDiff line numberDiff line change
@@ -525,63 +525,73 @@ declare_features! (
525525
);
526526

527527
declare_features! (
528-
(accepted, associated_types, "1.0.0", None, None),
529-
// Allows overloading augmented assignment operations like `a += b`.
530-
(accepted, augmented_assignments, "1.8.0", Some(28235), None),
531-
// Allows empty structs and enum variants with braces.
532-
(accepted, braced_empty_structs, "1.8.0", Some(29720), None),
533-
// Allows indexing into constant arrays.
534-
(accepted, const_indexing, "1.26.0", Some(29947), None),
535-
(accepted, default_type_params, "1.0.0", None, None),
536-
(accepted, globs, "1.0.0", None, None),
537-
(accepted, if_let, "1.0.0", None, None),
538528
// A temporary feature gate used to enable parser extensions needed
539529
// to bootstrap fix for #5723.
540530
(accepted, issue_5723_bootstrap, "1.0.0", None, None),
531+
// These are used to test this portion of the compiler,
532+
// they don't actually mean anything.
533+
(accepted, test_accepted_feature, "1.0.0", None, None),
534+
535+
// Allows using associated `type`s in `trait`s.
536+
(accepted, associated_types, "1.0.0", None, None),
537+
// Allows using assigning a default type to type parameters in algebraic data type definitions.
538+
(accepted, default_type_params, "1.0.0", None, None),
539+
// FIXME: explain `globs`.
540+
(accepted, globs, "1.0.0", None, None),
541+
// Allows `macro_rules!` items.
541542
(accepted, macro_rules, "1.0.0", None, None),
542-
// Allows using `#![no_std]`.
543-
(accepted, no_std, "1.6.0", None, None),
543+
// Allows use of `&foo[a..b]` as a slicing syntax.
544544
(accepted, slicing_syntax, "1.0.0", None, None),
545+
// Allows struct variants `Foo { baz: u8, .. }` in enums (RFC 418).
545546
(accepted, struct_variant, "1.0.0", None, None),
546-
// These are used to test this portion of the compiler, they don't actually
547-
// mean anything.
548-
(accepted, test_accepted_feature, "1.0.0", None, None),
547+
// Allows indexing tuples.
549548
(accepted, tuple_indexing, "1.0.0", None, None),
550-
// Allows macros to appear in the type position.
551-
(accepted, type_macros, "1.13.0", Some(27245), None),
549+
// Allows the use of `if let` expressions.
550+
(accepted, if_let, "1.0.0", None, None),
551+
// Allows the use of `while let` expressions.
552552
(accepted, while_let, "1.0.0", None, None),
553+
// Allows using `#![no_std]`.
554+
(accepted, no_std, "1.6.0", None, None),
555+
// Allows overloading augmented assignment operations like `a += b`.
556+
(accepted, augmented_assignments, "1.8.0", Some(28235), None),
557+
// Allows empty structs and enum variants with braces.
558+
(accepted, braced_empty_structs, "1.8.0", Some(29720), None),
553559
// Allows `#[deprecated]` attribute.
554560
(accepted, deprecated, "1.9.0", Some(29935), None),
555-
// `expr?`
561+
// Allows macros to appear in the type position.
562+
(accepted, type_macros, "1.13.0", Some(27245), None),
563+
// Allows use of the postfix `?` operator in expressions.
556564
(accepted, question_mark, "1.13.0", Some(31436), None),
557565
// Allows `..` in tuple (struct) patterns.
558566
(accepted, dotdot_in_tuple_patterns, "1.14.0", Some(33627), None),
567+
// Allows some increased flexibility in the name resolution rules,
568+
// especially around globs and shadowing (RFC 1560).
559569
(accepted, item_like_imports, "1.15.0", Some(35120), None),
560570
// Allows using `Self` and associated types in struct expressions and patterns.
561571
(accepted, more_struct_aliases, "1.16.0", Some(37544), None),
562-
// elide `'static` lifetimes in `static`s and `const`s.
572+
// Allows elision of `'static` lifetimes in `static`s and `const`s.
563573
(accepted, static_in_const, "1.17.0", Some(35897), None),
564574
// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
565575
(accepted, field_init_shorthand, "1.17.0", Some(37340), None),
566576
// Allows the definition recursive static items.
567577
(accepted, static_recursion, "1.17.0", Some(29719), None),
568-
// `pub(restricted)` visibilities (RFC 1422)
578+
// Allows `pub(restricted)` visibilities (RFC 1422).
569579
(accepted, pub_restricted, "1.18.0", Some(32409), None),
570-
// `#![windows_subsystem]`
580+
// Allows `#![windows_subsystem]`.
571581
(accepted, windows_subsystem, "1.18.0", Some(37499), None),
572582
// Allows `break {expr}` with a value inside `loop`s.
573583
(accepted, loop_break_value, "1.19.0", Some(37339), None),
574-
// Permits numeric fields in struct expressions and patterns.
584+
// Allows numeric fields in struct expressions and patterns.
575585
(accepted, relaxed_adts, "1.19.0", Some(35626), None),
576-
// Coerces non capturing closures to function pointers.
586+
// Allows coercing non capturing closures to function pointers.
577587
(accepted, closure_to_fn_coercion, "1.19.0", Some(39817), None),
578588
// Allows attributes on struct literal fields.
579589
(accepted, struct_field_attributes, "1.20.0", Some(38814), None),
580590
// Allows the definition of associated constants in `trait` or `impl` blocks.
581591
(accepted, associated_consts, "1.20.0", Some(29646), None),
582-
// Usage of the `compile_error!` macro.
592+
// Allows usage of the `compile_error!` macro.
583593
(accepted, compile_error, "1.20.0", Some(40872), None),
584-
// See rust-lang/rfcs#1414. Allows code like `let x: &'static u32 = &42` to work.
594+
// Allows code like `let x: &'static u32 = &42` to work (RFC 1414).
585595
(accepted, rvalue_static_promotion, "1.21.0", Some(38865), None),
586596
// Allows `Drop` types in constants (RFC 1440).
587597
(accepted, drop_types_in_const, "1.22.0", Some(33156), None),
@@ -592,24 +602,27 @@ declare_features! (
592602
(accepted, repr_align, "1.25.0", Some(33626), None),
593603
// Allows '|' at beginning of match arms (RFC 1925).
594604
(accepted, match_beginning_vert, "1.25.0", Some(44101), None),
595-
// Nested groups in `use` (RFC 2128)
605+
// Allows nested groups in `use` items (RFC 2128).
596606
(accepted, use_nested_groups, "1.25.0", Some(44494), None),
597-
// `a..=b` and `..=b`
607+
// Allows indexing into constant arrays.
608+
(accepted, const_indexing, "1.26.0", Some(29947), None),
609+
// Allows using `a..=b` and `..=b` as inclusive range syntaxes.
598610
(accepted, inclusive_range_syntax, "1.26.0", Some(28237), None),
599611
// Allows `..=` in patterns (RFC 1192).
600612
(accepted, dotdoteq_in_patterns, "1.26.0", Some(28237), None),
601-
// Termination trait in main (RFC 1937)
613+
// Allows `fn main()` with return types which implements `Termination` (RFC 1937).
602614
(accepted, termination_trait, "1.26.0", Some(43301), None),
603-
// `Copy`/`Clone` closures (RFC 2132).
615+
// Allows implementing `Clone` for closures where possible (RFC 2132).
604616
(accepted, clone_closures, "1.26.0", Some(44490), None),
617+
// Allows implementing `Copy` for closures where possible (RFC 2132).
605618
(accepted, copy_closures, "1.26.0", Some(44490), None),
606619
// Allows `impl Trait` in function arguments.
607620
(accepted, universal_impl_trait, "1.26.0", Some(34511), None),
608621
// Allows `impl Trait` in function return types.
609622
(accepted, conservative_impl_trait, "1.26.0", Some(34511), None),
610-
// The `i128` type
623+
// Allows using the `u128` and `i128` types.
611624
(accepted, i128_type, "1.26.0", Some(35118), None),
612-
// Default match binding modes (RFC 2005)
625+
// Allows default match binding modes (RFC 2005).
613626
(accepted, match_default_bindings, "1.26.0", Some(42640), None),
614627
// Allows `'_` placeholder lifetimes.
615628
(accepted, underscore_lifetimes, "1.26.0", Some(44524), None),
@@ -619,21 +632,21 @@ declare_features! (
619632
(accepted, cfg_target_feature, "1.27.0", Some(29717), None),
620633
// Allows `#[target_feature(...)]`.
621634
(accepted, target_feature, "1.27.0", None, None),
622-
// Trait object syntax with `dyn` prefix
635+
// Allows using `dyn Trait` as a syntax for trait objects.
623636
(accepted, dyn_trait, "1.27.0", Some(44662), None),
624637
// Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940).
625638
(accepted, fn_must_use, "1.27.0", Some(43302), None),
626639
// Allows use of the `:lifetime` macro fragment specifier.
627640
(accepted, macro_lifetime_matcher, "1.27.0", Some(34303), None),
628-
// Termination trait in tests (RFC 1937)
641+
// Allows `#[test]` functions where the return type implements `Termination` (RFC 1937).
629642
(accepted, termination_trait_test, "1.27.0", Some(48854), None),
630-
// The `#[global_allocator]` attribute
643+
// Allows the `#[global_allocator]` attribute.
631644
(accepted, global_allocator, "1.28.0", Some(27389), None),
632645
// Allows `#[repr(transparent)]` attribute on newtype structs.
633646
(accepted, repr_transparent, "1.28.0", Some(43036), None),
634-
// Procedural macros in `proc-macro` crates
647+
// Allows procedural macros in `proc-macro` crates.
635648
(accepted, proc_macro, "1.29.0", Some(38356), None),
636-
// `foo.rs` as an alternative to `foo/mod.rs`
649+
// Allows `foo.rs` as an alternative to `foo/mod.rs`.
637650
(accepted, non_modrs_mods, "1.30.0", Some(44660), None),
638651
// Allows use of the `:vis` macro fragment specifier
639652
(accepted, macro_vis_matcher, "1.30.0", Some(41022), None),
@@ -642,47 +655,50 @@ declare_features! (
642655
(accepted, use_extern_macros, "1.30.0", Some(35896), None),
643656
// Allows keywords to be escaped for use as identifiers.
644657
(accepted, raw_identifiers, "1.30.0", Some(48589), None),
645-
// Attributes scoped to tools.
658+
// Allows attributes scoped to tools.
646659
(accepted, tool_attributes, "1.30.0", Some(44690), None),
647660
// Allows multi-segment paths in attributes and derives.
648661
(accepted, proc_macro_path_invoc, "1.30.0", Some(38356), None),
649662
// Allows all literals in attribute lists and values of key-value pairs.
650663
(accepted, attr_literals, "1.30.0", Some(34981), None),
651-
// Infer outlives requirements (RFC 2093).
664+
// Allows inferring outlives requirements (RFC 2093).
652665
(accepted, infer_outlives_requirements, "1.30.0", Some(44493), None),
666+
// Allows annotating functions conforming to `fn(&PanicInfo) -> !` with `#[panic_handler]`.
667+
// This defines the behavior of panics.
653668
(accepted, panic_handler, "1.30.0", Some(44489), None),
654-
// Used to preserve symbols (see llvm.used).
669+
// Allows `#[used]` to preserve symbols (see llvm.used).
655670
(accepted, used, "1.30.0", Some(40289), None),
656-
// `crate` in paths
671+
// Allows `crate` in paths.
657672
(accepted, crate_in_paths, "1.30.0", Some(45477), None),
658-
// Resolve absolute paths as paths from other crates.
673+
// Allows resolving absolute paths as paths from other crates.
659674
(accepted, extern_absolute_paths, "1.30.0", Some(44660), None),
660-
// Access to crate names passed via `--extern` through prelude.
675+
// Allows access to crate names passed via `--extern` through prelude.
661676
(accepted, extern_prelude, "1.30.0", Some(44660), None),
662-
// Parentheses in patterns
677+
// Allows parentheses in patterns.
663678
(accepted, pattern_parentheses, "1.31.0", Some(51087), None),
664679
// Allows the definition of `const fn` functions.
665680
(accepted, min_const_fn, "1.31.0", Some(53555), None),
666-
// Scoped lints
681+
// Allows scoped lints.
667682
(accepted, tool_lints, "1.31.0", Some(44690), None),
668-
// `impl<I:Iterator> Iterator for &mut Iterator`
669-
// `impl Debug for Foo<'_>`
683+
// Allows lifetime elision in `impl` headers. For example:
684+
// + `impl<I:Iterator> Iterator for &mut Iterator`
685+
// + `impl Debug for Foo<'_>`
670686
(accepted, impl_header_lifetime_elision, "1.31.0", Some(15872), None),
671-
// `extern crate foo as bar;` puts `bar` into extern prelude.
687+
// Allows `extern crate foo as bar;`. This puts `bar` into extern prelude.
672688
(accepted, extern_crate_item_prelude, "1.31.0", Some(55599), None),
673689
// Allows use of the `:literal` macro fragment specifier (RFC 1576).
674690
(accepted, macro_literal_matcher, "1.32.0", Some(35625), None),
675-
// Use `?` as the Kleene "at most one" operator.
691+
// Allows use of `?` as the Kleene "at most one" operator in macros.
676692
(accepted, macro_at_most_once_rep, "1.32.0", Some(48075), None),
677-
// `Self` struct constructor (RFC 2302)
693+
// Allows `Self` struct constructor (RFC 2302).
678694
(accepted, self_struct_ctor, "1.32.0", Some(51994), None),
679-
// `Self` in type definitions (RFC 2300)
695+
// Allows `Self` in type definitions (RFC 2300).
680696
(accepted, self_in_typedefs, "1.32.0", Some(49303), None),
681697
// Allows `use x::y;` to search `x` in the current scope.
682698
(accepted, uniform_paths, "1.32.0", Some(53130), None),
683-
// Integer match exhaustiveness checking (RFC 2591)
699+
// Allows integer match exhaustiveness checking (RFC 2591).
684700
(accepted, exhaustive_integer_patterns, "1.33.0", Some(50907), None),
685-
// `use path as _;` and `extern crate c as _;`
701+
// Allows `use path as _;` and `extern crate c as _;`.
686702
(accepted, underscore_imports, "1.33.0", Some(48216), None),
687703
// Allows `#[repr(packed(N))]` attribute on structs.
688704
(accepted, repr_packed, "1.33.0", Some(33158), None),
@@ -694,15 +710,16 @@ declare_features! (
694710
// As long as control flow is not implemented in const eval, `&&` and `||` may not be used
695711
// at the same time as let bindings.
696712
(accepted, const_let, "1.33.0", Some(48821), None),
697-
// `#[cfg_attr(predicate, multiple, attributes, here)]`
713+
// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`.
698714
(accepted, cfg_attr_multi, "1.33.0", Some(54881), None),
699-
// Top level or-patterns (`p | q`) in `if let` and `while let`.
715+
// Allows top level or-patterns (`p | q`) in `if let` and `while let`.
700716
(accepted, if_while_or_patterns, "1.33.0", Some(48215), None),
701717
// Allows `cfg(target_vendor = "...")`.
702718
(accepted, cfg_target_vendor, "1.33.0", Some(29718), None),
703-
// `extern crate self as foo;` puts local crate root into extern prelude under name `foo`.
719+
// Allows `extern crate self as foo;`.
720+
// This puts local crate root into extern prelude under name `foo`.
704721
(accepted, extern_crate_self, "1.34.0", Some(56409), None),
705-
// support for arbitrary delimited token streams in non-macro attributes
722+
// Allows arbitrary delimited token streams in non-macro attributes.
706723
(accepted, unrestricted_attribute_tokens, "1.34.0", Some(55208), None),
707724
);
708725

0 commit comments

Comments
 (0)