Skip to content

Commit 47e8946

Browse files
committed
use better unstable attribs
1 parent 1c2c49e commit 47e8946

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

library/core/src/cmp/pattern.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ where
1212
fn do_match(&self, other: &Rhs) -> bool;
1313
}
1414

15-
macro_rules ! impl_match_lowered_cmp_for_primitive {
15+
macro_rules ! impl_for_primitive {
1616
($($t:ty),*) => {
1717
$(
1818
impl const MatchLoweredCmp for $t {
@@ -24,15 +24,14 @@ macro_rules ! impl_match_lowered_cmp_for_primitive {
2424
};
2525
}
2626

27-
impl_match_lowered_cmp_for_primitive! {
27+
impl_for_primitive! {
2828
bool, char,
2929
u8, u16, u32, u64, u128, usize,
3030
i8, i16, i32, i64, i128, isize,
3131
f32, f64
3232
}
3333

3434
impl const MatchLoweredCmp for str {
35-
#[rustc_allow_const_fn_unstable(const_trait_impl)]
3635
fn do_match(&self, other: &Self) -> bool {
3736
<[u8] as MatchLoweredCmp>::do_match((*self).as_bytes(), (*other).as_bytes())
3837
}
@@ -42,7 +41,6 @@ impl<T> const MatchLoweredCmp for [T]
4241
where
4342
T: ~const MatchLoweredCmp,
4443
{
45-
#[rustc_allow_const_fn_unstable(const_trait_impl)]
4644
default fn do_match(&self, other: &Self) -> bool {
4745
if self.len() != other.len() {
4846
return false;
@@ -62,11 +60,11 @@ where
6260
}
6361
}
6462

63+
#[rustc_const_unstable(feature = "core_intrinsics", issue = "none")]
6564
impl<T> const MatchLoweredCmp for [T]
6665
where
6766
T: ~const MatchLoweredCmp + BytewiseEq<T>,
6867
{
69-
#[rustc_allow_const_fn_unstable(core_intrinsics, const_trait_impl)]
7068
fn do_match(&self, other: &Self) -> bool {
7169
if self.len() != other.len() {
7270
return false;

0 commit comments

Comments
 (0)