cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Make the `rust-version` error recommend `cargo update --precise -p crate@ver`

Open joshtriplett opened this issue 2 years ago • 3 comments

People encountering a dependency with a newer rust-version requirement may not know about cargo update --precise, or may consider alternate approaches that may be harmful (such as pinning with a = dependency).

Provide specific guidance in the error message.

joshtriplett avatar Jul 23 '22 06:07 joshtriplett

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

rust-highfive avatar Jul 23 '22 06:07 rust-highfive

Thanks! I'm concerned that this hint may be confusing for people using cargo install, where there is no project to run cargo update with. From what I've seen, a lot of users that run into stale Rust versions are using cargo install or are otherwise not proficient with Rust or Cargo.

I wondering if maybe this hint to run cargo update should not be mentioned in that situation? It's not particularly easy to detect, but maybe it could check if the workspace is_ephemeral?

It could also check ignore_lock, in which case running cargo update will have no effect.

ehuss avatar Jul 23 '22 16:07 ehuss

@ehuss Good point; done.

joshtriplett avatar Jul 23 '22 20:07 joshtriplett

Fixing...

joshtriplett avatar Aug 03 '22 19:08 joshtriplett

Thanks!

@bors r+

ehuss avatar Aug 09 '22 21:08 ehuss

:pushpin: Commit 934e79072ab40891e6e7dacadad0505f6029515c has been approved by ehuss

It is now in the queue for this repository.

bors avatar Aug 09 '22 21:08 bors

:hourglass: Testing commit 934e79072ab40891e6e7dacadad0505f6029515c with merge 104df2e3f7d437c93c432b09bdae5ee9757dc8cd...

bors avatar Aug 09 '22 21:08 bors

:broken_heart: Test failed - checks-actions

bors avatar Aug 09 '22 21:08 bors

@bors retry

apt network error

ehuss avatar Aug 09 '22 22:08 ehuss

:hourglass: Testing commit 934e79072ab40891e6e7dacadad0505f6029515c with merge ce40690a5e4e315d3dab0aae1eae69d0252c52ac...

bors avatar Aug 09 '22 22:08 bors

:sunny: Test successful - checks-actions Approved by: ehuss Pushing ce40690a5e4e315d3dab0aae1eae69d0252c52ac to master...

bors avatar Aug 09 '22 23:08 bors