mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
fixup! Refactor FnDecl and FnSig flags into packed structs
This commit is contained in:
@@ -131,7 +131,6 @@ pub const fn as_str(&self) -> &'static str {
|
||||
$($e_name::$variant $( { unwind: $uw } )* => $tok,)*
|
||||
}
|
||||
}
|
||||
// ALL_VARIANTS.iter().position(|v| v == self), but const
|
||||
// FIXME(FnSigKind): when PartialEq is stably const, use it instead
|
||||
const fn internal_const_eq(&self, other: &Self) -> bool {
|
||||
match (self, other) {
|
||||
@@ -139,6 +138,7 @@ const fn internal_const_eq(&self, other: &Self) -> bool {
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
// ALL_VARIANTS.iter().position(|v| v == self), but const
|
||||
pub const fn as_packed(&self) -> u8 {
|
||||
let mut index = 0;
|
||||
while index < $e_name::ALL_VARIANTS.len() {
|
||||
|
||||
Reference in New Issue
Block a user