Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc_infer/src/infer/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ impl<'tcx> rustc_type_ir::InferCtxtLike for InferCtxt<'tcx> {
}

type OpaqueTypeStorageEntries = OpaqueTypeStorageEntries;
#[inline]
fn opaque_types_storage_num_entries(&self) -> OpaqueTypeStorageEntries {
self.inner.borrow_mut().opaque_types().num_entries()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,24 @@ pub(super) enum RerunStalled {
/// args have changed. This is a cheap way to determine that if we were to rerun this goal now,
/// it will remain stalled since it'll canonicalize the same way and evaluation is pure.
/// Therefore, we can skip this rerun
#[inline]
#[inline(never)]
pub(super) fn rerunning_stalled_goal_may_make_progress<D, I>(
delegate: &D,
stalled_on: Option<&GoalStalledOn<I>>,
) -> RerunStalled
where
D: SolverDelegate<Interner = I>,
I: Interner,
{
inlined_rerunning_stalled_goal_may_make_progress(delegate, stalled_on)
}

// Always-inlined variant for the one hot call site.
#[inline(always)]
pub(super) fn inlined_rerunning_stalled_goal_may_make_progress<D, I>(
delegate: &D,
stalled_on: Option<&GoalStalledOn<I>>,
) -> RerunStalled
where
D: SolverDelegate<Interner = I>,
I: Interner,
Expand Down
7 changes: 5 additions & 2 deletions compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ use crate::delegate::SolverDelegate;
use crate::normalize::{NormalizationFolder, NormalizationWasAmbiguous};
use crate::placeholder::BoundVarReplacer;
use crate::solve::eval_ctxt::fast_path::{
RerunStalled, compute_goal_fast_path, rerunning_stalled_goal_may_make_progress,
RerunStalled, compute_goal_fast_path, inlined_rerunning_stalled_goal_may_make_progress,
rerunning_stalled_goal_may_make_progress,
};
use crate::solve::fast_path::compute_goal_fast_path_cold;
use crate::solve::search_graph::SearchGraph;
Expand Down Expand Up @@ -264,8 +265,10 @@ where
}
}

// This function is very hot and has a single call site.
#[inline(always)]
fn goal_remains_stalled(&self, stalled_on: &GoalStalledOn<Self::Interner>) -> bool {
match rerunning_stalled_goal_may_make_progress(self, Some(stalled_on)) {
match inlined_rerunning_stalled_goal_may_make_progress(self, Some(stalled_on)) {
RerunStalled::WontMakeProgress(_) => true,
RerunStalled::MayMakeProgress => false,
}
Expand Down
Loading