rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.7k stars 2.41k forks source link

Feature Request: A way to deprecate features #7130

Open llogiq opened 5 years ago

llogiq commented 5 years ago

I have a crate that has a feature that is no longer needed. For now, I keep the feature, but it does nothing. I will at some point remove the feature, but I'd like to be able to issue a warning before removing it.

An easy an approachable way would be to nominate a special "deprecated" feature that is always available, so we could write my_feature = "deprecated"in our Cargo.toml. However, this would need a survey of crates to see if any already define such a feature.

Another option is to stabilize the proc_macro_diagnostics feature in rustc, that would allow us to issue a compile-time warning if the feature is selected, albeit with more ceremony.

ehuss commented 5 years ago

I'm not sure if proc_macro_diagnostics would work here since registry dependencies have diagnostics capped at Allow, so it would probably be hidden in most circumstances.

tgross35 commented 1 year ago

This would be covered as part of https://github.com/rust-lang/rfcs/pull/3416 if accepted

schneems commented 1 month ago

@tgross35 https://github.com/rust-lang/rfcs/pull/3416 was merged in. What are the next steps to allow feature deprecation?

tgross35 commented 1 month ago

https://github.com/rust-lang/rfcs/pull/3486 has not yet been merged, which is the RFC for deprecation. There is still a lot more deciding to be done there and I haven't gotten around to it; feel free to provide feedback there, or better yet propose changes via the GH API so they can be applied.