1
Fork 0

Miscellaneous inlining improvements

Inline a few small and hot functions.
This commit is contained in:
Tomasz Miąsko 2021-02-26 00:00:00 +00:00
parent cecdb181ad
commit 481e1fd3a8
12 changed files with 52 additions and 8 deletions

View file

@ -77,6 +77,7 @@ impl Limit {
/// Check that `value` is within the limit. Ensures that the same comparisons are used
/// throughout the compiler, as mismatches can cause ICEs, see #72540.
#[inline]
pub fn value_within_limit(&self, value: usize) -> bool {
value <= self.0
}
@ -347,10 +348,12 @@ impl Session {
self.crate_types.set(crate_types).expect("`crate_types` was initialized twice")
}
#[inline]
pub fn recursion_limit(&self) -> Limit {
self.recursion_limit.get().copied().unwrap()
}
#[inline]
pub fn type_length_limit(&self) -> Limit {
self.type_length_limit.get().copied().unwrap()
}