Skip to content

Commit f0e4262

Browse files
committed
Add cold annotations
1 parent 4ac6c42 commit f0e4262

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/internal/core.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ impl<DP: DependencyProvider> State<DP> {
7979
}
8080

8181
/// Add an incompatibility to the state.
82+
#[cold]
8283
pub(crate) fn add_incompatibility_from_dependencies(
8384
&mut self,
8485
package: Id<DP::P>,
@@ -105,6 +106,7 @@ impl<DP: DependencyProvider> State<DP> {
105106

106107
/// Unit propagation is the core mechanism of the solving algorithm.
107108
/// CF <https://github.com/dart-lang/pub/blob/master/doc/solver.md#unit-propagation>
109+
#[cold]
108110
pub(crate) fn unit_propagation(
109111
&mut self,
110112
package: Id<DP::P>,
@@ -187,6 +189,7 @@ impl<DP: DependencyProvider> State<DP> {
187189
/// Return the root cause or the terminal incompatibility.
188190
/// CF <https://github.com/dart-lang/pub/blob/master/doc/solver.md#unit-propagation>
189191
#[allow(clippy::type_complexity)]
192+
#[cold]
190193
fn conflict_resolution(
191194
&mut self,
192195
incompatibility: IncompDpId<DP>,

src/internal/partial_solution.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ impl<DP: DependencyProvider> PartialSolution<DP> {
267267
}
268268
}
269269

270+
#[cold]
270271
pub(crate) fn pick_highest_priority_pkg(
271272
&mut self,
272273
prioritizer: impl Fn(Id<DP::P>, &DP::VS) -> DP::Priority,

src/provider.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ impl<P: Package, VS: VersionSet> DependencyProvider for OfflineDependencyProvide
8484

8585
type Err = Infallible;
8686

87-
#[inline]
8887
fn choose_version(&self, package: &P, range: &VS) -> Result<Option<VS::V>, Infallible> {
8988
Ok(self
9089
.dependencies
@@ -94,7 +93,6 @@ impl<P: Package, VS: VersionSet> DependencyProvider for OfflineDependencyProvide
9493

9594
type Priority = Reverse<usize>;
9695

97-
#[inline]
9896
fn prioritize(&self, package: &P, range: &VS) -> Self::Priority {
9997
Reverse(
10098
self.dependencies
@@ -104,7 +102,6 @@ impl<P: Package, VS: VersionSet> DependencyProvider for OfflineDependencyProvide
104102
)
105103
}
106104

107-
#[inline]
108105
fn get_dependencies(
109106
&self,
110107
package: &P,

src/solver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ use crate::{DependencyConstraints, Map, Package, PubGrubError, SelectedDependenc
7070

7171
/// Main function of the library.
7272
/// Finds a set of packages satisfying dependency bounds for a given package + version pair.
73+
#[cold]
7374
pub fn resolve<DP: DependencyProvider>(
7475
dependency_provider: &DP,
7576
package: DP::P,

0 commit comments

Comments
 (0)