-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update resolver.md: fix compile errors in pseudocode #16333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I created a Rust project and wrote scaffolding until it compiled (using rust-analyzer helpers but no LLMs). I have not done any kind of plausibility analysis, this is a pure "make all compiler errors go away" hackjob. The scaffolding might be interesting to preserve ... somewhere?
```rust
#[derive(Copy, Clone)]
struct Package;
impl Package {
fn lookup_versions(&self) -> Option<Vec<Version>> {
todo!()
}
}
struct Version {
dependencies: Vec<Package>,
}
#[derive(Copy, Clone)]
struct Policy;
impl Policy {
fn pick_next_dep(&self, dep_queue: &Queue) -> Option<Package> {
todo!()
}
fn try_unify_version(&self, dep_spec: Package, clone: ResolveGraph) -> Option<ResolveGraph> {
todo!()
}
fn filter_versions(&self, dep_spec: Package, dep_versions: Vec<Version>) -> Vec<Version> {
todo!()
}
fn pick_next_version(&self, dep_versions: &[Version]) -> Option<Version> {
todo!()
}
fn needs_version_unification(&self, dep_version: &Version, resolved: &ResolveGraph) -> bool {
todo!()
}
}
#[derive(Clone)]
struct ResolveGraph;
impl ResolveGraph {
fn new() -> Self {
Self
}
fn register(&self, dep_version: Version) {
todo!()
}
}
struct Workspace;
#[derive(Clone)]
struct Queue;
impl Queue {
fn new(workspace: &[Package]) -> Self {
Self
}
fn enqueue(&self, dependencies: &Vec<Package>) {
todo!()
}
}
```
Collaborator
epage
reviewed
Dec 3, 2025
Co-authored-by: Ed Page <[email protected]>
epage
approved these changes
Dec 3, 2025
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Dec 5, 2025
Update cargo submodule 9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac 2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000 - fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915) - Remove legacy tmpdir support (rust-lang/cargo#16342) - Run clippy CI on more targets (rust-lang/cargo#16340) - feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309) - fix(timings): unlocked -> unblocked (rust-lang/cargo#16337) - fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335) - fix(frontmatter): Restrict code fence length (rust-lang/cargo#16334) - Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333) - fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331) This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Dec 5, 2025
Update cargo submodule 9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac 2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000 - fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915) - Remove legacy tmpdir support (rust-lang/cargo#16342) - Run clippy CI on more targets (rust-lang/cargo#16340) - feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309) - fix(timings): unlocked -> unblocked (rust-lang/cargo#16337) - fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335) - fix(frontmatter): Restrict code fence length (rust-lang/cargo#16334) - Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333) - fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331) This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I created a Rust project and wrote scaffolding until the dependency resolver pseudocode compiled (using rust-analyzer helpers but no LLMs). I have not done any kind of plausibility analysis, this is a pure "make all compiler errors go away" hackjob. The scaffolding might be interesting to preserve ... somewhere?
Thanks for the pull request 🎉!
Please read the contribution guide: https://doc.crates.io/contrib/.
What does this PR try to resolve?
the dependency resolver is explained using pseudocode which almost compiles. This PR makes it compile completely.
How to test and review this PR?