Skip to content

Commit 4cb649b

Browse files
committed
remove unneccessary wrapping of return value of allow_unstable(), it would always return Some(thing)
1 parent ed58a2b commit 4cb649b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_attr/src/builtin.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,21 +1036,21 @@ pub fn allow_internal_unstable<'a>(
10361036
sess: &'a Session,
10371037
attrs: &'a [Attribute],
10381038
) -> Option<impl Iterator<Item = Symbol> + 'a> {
1039-
allow_unstable(sess, attrs, sym::allow_internal_unstable)
1039+
Some(allow_unstable(sess, attrs, sym::allow_internal_unstable))
10401040
}
10411041

10421042
pub fn rustc_allow_const_fn_unstable<'a>(
10431043
sess: &'a Session,
10441044
attrs: &'a [Attribute],
10451045
) -> Option<impl Iterator<Item = Symbol> + 'a> {
1046-
allow_unstable(sess, attrs, sym::rustc_allow_const_fn_unstable)
1046+
Some(allow_unstable(sess, attrs, sym::rustc_allow_const_fn_unstable))
10471047
}
10481048

10491049
fn allow_unstable<'a>(
10501050
sess: &'a Session,
10511051
attrs: &'a [Attribute],
10521052
symbol: Symbol,
1053-
) -> Option<impl Iterator<Item = Symbol> + 'a> {
1053+
) -> impl Iterator<Item = Symbol> + 'a {
10541054
let attrs = sess.filter_by_name(attrs, symbol);
10551055
let list = attrs
10561056
.filter_map(move |attr| {
@@ -1064,7 +1064,7 @@ fn allow_unstable<'a>(
10641064
})
10651065
.flatten();
10661066

1067-
Some(list.into_iter().filter_map(move |it| {
1067+
list.into_iter().filter_map(move |it| {
10681068
let name = it.ident().map(|ident| ident.name);
10691069
if name.is_none() {
10701070
sess.diagnostic().span_err(
@@ -1073,5 +1073,5 @@ fn allow_unstable<'a>(
10731073
);
10741074
}
10751075
name
1076-
}))
1076+
})
10771077
}

0 commit comments

Comments
 (0)