Skip to content

Commit

Permalink
Add #[inline] in impl_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Apr 25, 2023
1 parent 2b8d27b commit bec7ce4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_data_structures/src/tagged_ptr/impl_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ macro_rules! impl_tag {
)*
]);

#[inline]
fn into_usize(self) -> usize {
// This forbids use of repeating patterns (`Enum::V`&`Enum::V`, etc)
// (or at least it should, see <https://github.com/rust-lang/rust/issues/110613>)
Expand All @@ -112,6 +113,7 @@ macro_rules! impl_tag {
}
}

#[inline]
unsafe fn from_usize(tag: usize) -> Self {
match tag {
$(
Expand Down

0 comments on commit bec7ce4

Please sign in to comment.