This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed
rustc_mir/src/transform/check_consts Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1035,15 +1035,15 @@ pub fn find_transparency(
10351035pub fn allow_internal_unstable < ' a > (
10361036 sess : & ' a Session ,
10371037 attrs : & ' a [ Attribute ] ,
1038- ) -> Option < impl Iterator < Item = Symbol > + ' a > {
1039- Some ( allow_unstable ( sess, attrs, sym:: allow_internal_unstable) )
1038+ ) -> impl Iterator < Item = Symbol > + ' a {
1039+ allow_unstable ( sess, attrs, sym:: allow_internal_unstable)
10401040}
10411041
10421042pub fn rustc_allow_const_fn_unstable < ' a > (
10431043 sess : & ' a Session ,
10441044 attrs : & ' a [ Attribute ] ,
1045- ) -> Option < impl Iterator < Item = Symbol > + ' a > {
1046- Some ( allow_unstable ( sess, attrs, sym:: rustc_allow_const_fn_unstable) )
1045+ ) -> impl Iterator < Item = Symbol > + ' a {
1046+ allow_unstable ( sess, attrs, sym:: rustc_allow_const_fn_unstable)
10471047}
10481048
10491049fn allow_unstable < ' a > (
Original file line number Diff line number Diff line change @@ -756,8 +756,8 @@ impl SyntaxExtension {
756756 name : Symbol ,
757757 attrs : & [ ast:: Attribute ] ,
758758 ) -> SyntaxExtension {
759- let allow_internal_unstable = attr :: allow_internal_unstable ( sess , & attrs )
760- . map ( |features| features . collect :: < Vec < Symbol > > ( ) . into ( ) ) ;
759+ let allow_internal_unstable =
760+ Some ( attr :: allow_internal_unstable ( sess , & attrs ) . collect :: < Vec < Symbol > > ( ) . into ( ) ) ;
761761
762762 let mut local_inner_macros = false ;
763763 if let Some ( macro_export) = sess. find_by_name ( attrs, sym:: macro_export) {
Original file line number Diff line number Diff line change @@ -85,8 +85,7 @@ pub fn rustc_allow_const_fn_unstable(
8585 feature_gate : Symbol ,
8686) -> bool {
8787 let attrs = tcx. get_attrs ( def_id) ;
88- attr:: rustc_allow_const_fn_unstable ( & tcx. sess , attrs)
89- . map_or ( false , |mut features| features. any ( |name| name == feature_gate) )
88+ attr:: rustc_allow_const_fn_unstable ( & tcx. sess , attrs) . any ( |name| name == feature_gate)
9089}
9190
9291// Returns `true` if the given `const fn` is "const-stable".
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
106106 // However, we cannot allow stable `const fn`s to use unstable features without an explicit
107107 // opt-in via `rustc_allow_const_fn_unstable`.
108108 attr:: rustc_allow_const_fn_unstable ( & tcx. sess , & tcx. get_attrs ( def_id) )
109- . map_or ( false , | mut features| features . any ( |name| name == feature_gate) )
109+ . any ( |name| name == feature_gate)
110110 } ;
111111
112112 match required_gates {
You can’t perform that action at this time.
0 commit comments