Skip to content
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

Updating package rust-version to the latest version #917

Open
aksh1618 opened this issue Jan 19, 2025 · 1 comment
Open

Updating package rust-version to the latest version #917

aksh1618 opened this issue Jan 19, 2025 · 1 comment

Comments

@aksh1618
Copy link

TL;DR: Is upgrading package.rust-version within the scope of this project?

As a beginner in rust I like enabling lints to get used to idioms and avoid anti-patterns. Recently while working on a project (binary, not lib), I happened upon the use Trait as _ idiom which I decided to enforce. However the corresponding lint was only added in v1.83.

I have a function in my shell config that uses cargo-edit to upgrade all dependency crates in the current project to their latest versions. I decided to add a step to that function for upgrading the package.rust-version property to the latest stable version of rust. Looking at the help output of cargo-edit, it seemed like --rust-version was exactly what I was looking for, but looks like that's not the case:

# Update package.rust-version to latest stable version of rust
rustup update && cargo upgrade --rust-version `{rustc --version | cut -d " " -f2}` --compatible ignore # Doesn't modify cargo.toml

So I want to initiate a discussion on whether that's something this project would consider supporting.

@epage
Copy link
Collaborator

epage commented Jan 20, 2025

We wouldn't want to do this by default as there is a wide variety of opinions on this. I also suspect there isn't much value-add to automating this as its just a single-field to set. Even in workspaces, you can put the field in one location and then inherit it.

The MSRV resolver RFC does include approval for a rust-version = "<tbd-name-representing-currently-running-rust-toolchain>. I suspect we will wait a bit for the MSRV resolver to be out before we move forward with it. See https://rust-lang.github.io/rfcs/3537-msrv-resolver.html#cargo-publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants