From b2ed9c4007767f6cf692229cffd471d4ce5fde55 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 3 Oct 2021 16:07:26 +0200 Subject: Add some inlining. --- compiler/rustc_session/src/cstore.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_session/src') diff --git a/compiler/rustc_session/src/cstore.rs b/compiler/rustc_session/src/cstore.rs index 4b93a3e8e83..9d6bd201039 100644 --- a/compiler/rustc_session/src/cstore.rs +++ b/compiler/rustc_session/src/cstore.rs @@ -28,6 +28,7 @@ pub struct CrateSource { } impl CrateSource { + #[inline] pub fn paths(&self) -> impl Iterator { self.dylib.iter().chain(self.rlib.iter()).chain(self.rmeta.iter()).map(|p| &p.0) } @@ -47,6 +48,7 @@ pub enum CrateDepKind { } impl CrateDepKind { + #[inline] pub fn macros_only(self) -> bool { match self { CrateDepKind::MacrosOnly => true, @@ -122,10 +124,12 @@ impl ExternCrate { /// If true, then this crate is the crate named by the extern /// crate referenced above. If false, then this crate is a dep /// of the crate. + #[inline] pub fn is_direct(&self) -> bool { self.dependency_of == LOCAL_CRATE } + #[inline] pub fn rank(&self) -> impl PartialOrd { // Prefer: // - direct extern crate to indirect -- cgit 1.4.1-3-g733a5