uv-resolver: push resolver state to its own type (#3492)

This still keeps the resolver state on the stack, but it organizes it
into a more structured representation. This is a precursor to
implementing resolver forking, where we will ultimately put this state
on the heap. The idea is that this will let us maintain multiple
independent resolver states that will all produce their own resolution
(and potentially other forked states).

Closes #3354
This commit is contained in:
Andrew Gallant 2024-05-09 14:16:43 -04:00 committed by GitHub
parent 2d70303d56
commit ad01a768bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 119 additions and 63 deletions

View file

@ -9,7 +9,7 @@ use crate::candidate_selector::Candidate;
///
/// For example, given `Flask==3.0.0`, the [`FilePins`] would contain a mapping from `Flask` to
/// `3.0.0` to the specific wheel or source distribution archive that was pinned for that version.
#[derive(Debug, Default)]
#[derive(Clone, Debug, Default)]
pub(crate) struct FilePins(FxHashMap<PackageName, FxHashMap<pep440_rs::Version, ResolvedDist>>);
impl FilePins {