File tree 4 files changed +8
-9
lines changed
rustc_mir/src/transform/check_consts
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(
1035
1035
pub fn allow_internal_unstable < ' a > (
1036
1036
sess : & ' a Session ,
1037
1037
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)
1040
1040
}
1041
1041
1042
1042
pub fn rustc_allow_const_fn_unstable < ' a > (
1043
1043
sess : & ' a Session ,
1044
1044
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)
1047
1047
}
1048
1048
1049
1049
fn allow_unstable < ' a > (
Original file line number Diff line number Diff line change @@ -756,8 +756,8 @@ impl SyntaxExtension {
756
756
name : Symbol ,
757
757
attrs : & [ ast:: Attribute ] ,
758
758
) -> 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 ( ) ) ;
761
761
762
762
let mut local_inner_macros = false ;
763
763
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(
85
85
feature_gate : Symbol ,
86
86
) -> bool {
87
87
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)
90
89
}
91
90
92
91
// 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> {
106
106
// However, we cannot allow stable `const fn`s to use unstable features without an explicit
107
107
// opt-in via `rustc_allow_const_fn_unstable`.
108
108
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)
110
110
} ;
111
111
112
112
match required_gates {
You can’t perform that action at this time.
0 commit comments