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

Feature Request: A way to deprecate features #7130

Open
llogiq opened this issue Jul 14, 2019 · 4 comments · May be fixed by rust-lang/rfcs#3486
Open

Feature Request: A way to deprecate features #7130

llogiq opened this issue Jul 14, 2019 · 4 comments · May be fixed by rust-lang/rfcs#3486
Labels
A-features Area: features — conditional compilation C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-rfc Status: Needs an RFC to make progress.

Comments

@llogiq
Copy link
Contributor

llogiq commented Jul 14, 2019

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.

@llogiq llogiq added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jul 14, 2019
@ehuss
Copy link
Contributor

ehuss commented Jul 14, 2019

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.

@ehuss ehuss added the A-features Area: features — conditional compilation label Jul 14, 2019
Enselic pushed a commit to Enselic/syntect that referenced this issue Dec 28, 2021
When the `-rs` versions of dump creation and loading were introduced in syntect,
`flate2` defaulted to a C implementation and made the Rust backend optional.
Since two years, the Rust backend has been the default backend. See
rust-lang/flate2-rs@c479d064e2. So we can stop using
the `-rs` versions since enabling them makes no difference.

Note that there is no mechanism yet that we can use to mark features as
deprecated. See rust-lang/cargo#7130
@tgross35
Copy link

This would be covered as part of rust-lang/rfcs#3416 if accepted

@schneems
Copy link

@tgross35 rust-lang/rfcs#3416 was merged in. What are the next steps to allow feature deprecation?

@tgross35
Copy link

rust-lang/rfcs#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features Area: features — conditional compilation C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-rfc Status: Needs an RFC to make progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants