Skip to content

Commit e3f07b2

Browse files
committed
Force inline: small functions and single call-site
1 parent d928106 commit e3f07b2

File tree

1 file changed

+4
-2
lines changed
  • compiler/rustc_target/src/abi

1 file changed

+4
-2
lines changed

compiler/rustc_target/src/abi/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ pub struct WrappingRange {
697697

698698
impl WrappingRange {
699699
/// Returns `true` if `v` is contained in the range.
700-
#[inline]
700+
#[inline(always)]
701701
pub fn contains(&self, v: u128) -> bool {
702702
if self.start <= self.end {
703703
self.start <= v && v <= self.end
@@ -708,17 +708,19 @@ impl WrappingRange {
708708

709709
/// Returns `true` if zero is contained in the range.
710710
/// Equal to `range.contains(0)` but should be faster.
711-
#[inline]
711+
#[inline(always)]
712712
pub fn contains_zero(&self) -> bool {
713713
self.start > self.end || self.start == 0
714714
}
715715

716716
/// Returns new `WrappingRange` with replaced `start`
717+
#[inline(always)]
717718
pub fn with_start(&self, start: u128) -> Self {
718719
Self { start, end: self.end }
719720
}
720721

721722
/// Returns new `WrappingRange` with replaced `end`
723+
#[inline(always)]
722724
pub fn with_end(&self, end: u128) -> Self {
723725
Self { start: self.start, end }
724726
}

0 commit comments

Comments
 (0)