Miscellaneous inlining improvements
This commit is contained in:
parent
c4f186f0ea
commit
c1f6495b8e
17 changed files with 45 additions and 0 deletions
|
@ -222,6 +222,7 @@ pub trait HasDataLayout {
|
|||
}
|
||||
|
||||
impl HasDataLayout for TargetDataLayout {
|
||||
#[inline]
|
||||
fn data_layout(&self) -> &TargetDataLayout {
|
||||
self
|
||||
}
|
||||
|
@ -862,6 +863,7 @@ pub enum Abi {
|
|||
|
||||
impl Abi {
|
||||
/// Returns `true` if the layout corresponds to an unsized type.
|
||||
#[inline]
|
||||
pub fn is_unsized(&self) -> bool {
|
||||
match *self {
|
||||
Abi::Uninhabited | Abi::Scalar(_) | Abi::ScalarPair(..) | Abi::Vector { .. } => false,
|
||||
|
@ -881,11 +883,13 @@ impl Abi {
|
|||
}
|
||||
|
||||
/// Returns `true` if this is an uninhabited type
|
||||
#[inline]
|
||||
pub fn is_uninhabited(&self) -> bool {
|
||||
matches!(*self, Abi::Uninhabited)
|
||||
}
|
||||
|
||||
/// Returns `true` is this is a scalar type
|
||||
#[inline]
|
||||
pub fn is_scalar(&self) -> bool {
|
||||
matches!(*self, Abi::Scalar(_))
|
||||
}
|
||||
|
|
|
@ -922,6 +922,7 @@ pub trait HasTargetSpec {
|
|||
}
|
||||
|
||||
impl HasTargetSpec for Target {
|
||||
#[inline]
|
||||
fn target_spec(&self) -> &Target {
|
||||
self
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue