-
Notifications
You must be signed in to change notification settings - Fork 13k
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
respect CARGO_PKG_RUST_VERSION when issuing deprecation warnings #98893
Conversation
you can specify the `rust-version`[0] in `Cargo.toml` file. If you specify that, we should not emit a deprecated warning. Reason for this is, that code will be sprinkled with `#[allow(deprecated)]` and maybe be forgotten in the future, so deprecated items will be used. If you specify the `rust-version` field, no such deprecation warning should be emitted, unless you upgrade your msrv. [0]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
I don’t think |
I’m adding T-cargo label here for it really mostly a question of what the semantics of |
Sorry for not providing enough information here. It all started with clippy, where I submitted this PR: rust-lang/rust-clippy#8774 During the implementation it was decided, that a new environment variable should be added: Everything was accepted and finally merged into clippy, so that instead of using My logical next step was to use that Yes, that variable only set by cargo and not rustc itself, but that's why the code makes no assumption that it has to be there, but evaulates it, if it's present. |
You probably misunderstood my point. What I was trying to say is that It is less important for |
In terms of stabilized interfaces, I wonder if |
Yeah, |
Seeing as the PR has stalled and given the concerns raised above, I’m inclined to close this for now, if only to clean up my review queue. I would strongly advise some sort of a MCP or similar discussion medium before further development work is undertaken. |
you can specify the
rust-version
0 inCargo.toml
file.If you specify that, we should not emit a deprecated warning.
Reason for this is, that code will be sprinkled with
#[allow(deprecated)]
and maybe be forgotten in the future, sodeprecated items will be used.
If you specify the
rust-version
field, no such deprecation warningshould be emitted, unless you upgrade your msrv.
This might not be the perfect solution, yet, but I'd like to have this in rust because of the reasons metioned above. Any feedback is welcome.