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

Add allow-by-default lint when using item deprecated in the future #55892

Closed
RalfJung opened this issue Nov 12, 2018 · 7 comments
Closed

Add allow-by-default lint when using item deprecated in the future #55892

RalfJung opened this issue Nov 12, 2018 · 7 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@RalfJung
Copy link
Member

With #30785 resolved, there now is a way to deprecate an item "for the future". It would be nice to be able to e.g. clean libstd from using such future-deprecated items and then to make sure that future PRs will not re-introduce new uses of that item again. I am thinking, for example, of when we will deprecate mem::uninitialized in favor of MaybeUninit: Once we got rid of all its uses in some crate here, we'll want to make sure people not aware of this deprecation do not accidentally reintroduce new uses of mem::uninitialized in libstd.

So maybe we could have an allow-by-default lint that libstd (and its dependencies) opt in to that complains about using items that are marked for future deprecation?

@varkor varkor added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Nov 12, 2018
@varkor
Copy link
Member

varkor commented Nov 12, 2018

This should be very straightforward to add by essentially copying what the current deprecated lint does, but limited to future deprecations.
https://github.com/rust-lang/rust/blob/d6828cefd3787e8a732991d6273afc8793104cc3/src/librustc/lint/builtin.rs#L217-L222
I can provide more detailed mentoring for those interested in tackling the issue, but I imagine one should be able to figure out the details without too much trouble.

@mominul
Copy link
Contributor

mominul commented Nov 13, 2018

I'd like to take this issue! If I get struck, I'll ask on the discord channel.

@RalfJung
Copy link
Member Author

Awesome, and please do :)

@mominul
Copy link
Contributor

mominul commented Nov 19, 2018

Sorry, I got quite busy in my studies. If anyone wants to take this issue in the meantime, please do!

@aheart
Copy link
Contributor

aheart commented Nov 24, 2018

I would like to give this a try.

@FrankSD
Copy link

FrankSD commented Dec 5, 2018

Can i take this issue?

@RalfJung
Copy link
Member Author

RalfJung commented Dec 5, 2018

I'm afraid it is already taken: #56203

pietroalbini added a commit to pietroalbini/rust that referenced this issue Dec 11, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
kennytm added a commit to kennytm/rust that referenced this issue Dec 12, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
pietroalbini added a commit to pietroalbini/rust that referenced this issue Dec 12, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
pietroalbini added a commit to pietroalbini/rust that referenced this issue Dec 13, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
kennytm added a commit to kennytm/rust that referenced this issue Dec 13, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
kennytm added a commit to kennytm/rust that referenced this issue Dec 14, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
kennytm added a commit to kennytm/rust that referenced this issue Dec 14, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
pietroalbini added a commit to pietroalbini/rust that referenced this issue Dec 14, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
bors added a commit that referenced this issue Dec 15, 2018
Add lint for items deprecated in future

Resolves #55892
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

5 participants