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

#[deprecated] has no effect on macros #49912

Closed
sgrif opened this issue Apr 12, 2018 · 4 comments · Fixed by #62042
Closed

#[deprecated] has no effect on macros #49912

sgrif opened this issue Apr 12, 2018 · 4 comments · Fixed by #62042
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sgrif
Copy link
Contributor

sgrif commented Apr 12, 2018

The following code compiles successfully with no warnings, when it should be producing a deprecation warning.

https://play.rust-lang.org/?gist=aa4c719a14da2bb5cf3ddf8c3066f452&version=stable

@abonander
Copy link
Contributor

abonander commented Apr 13, 2018

Some discussion here: #48524 (comment)

Deprecation and stability checking is actually done after macro expansion, so a complete solution would probably need to lift both of those into phase 2. or just have a separate implementation for macros like I did with stability checking in that PR.

cc @petrochenkov

@sgrif
Copy link
Contributor Author

sgrif commented Apr 13, 2018

If nothing else, #[deprecated] should be giving an error when placed on an item where it has no effect.

@abonander
Copy link
Contributor

The goal is to support deprecation on macros, it's just that all the infrastructure for deprecation is in a later phase so even a naive implementation would need to redo a lot of the support. We still need stability checking and deprecation after macro expansion as well.

@pietroalbini pietroalbini added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 24, 2018
@petrochenkov
Copy link
Contributor

Fixed in #62042

Centril added a commit to Centril/rust that referenced this issue Jul 7, 2019
Support stability and deprecation checking for all macros

RELNOTES: Deprecation attributes on macros now have effect.

Fixes rust-lang#34079
Fixes rust-lang#49912
Unblocks rust-lang#62086
Unblocks rust-lang#61000
Centril added a commit to Centril/rust that referenced this issue Jul 7, 2019
Support stability and deprecation checking for all macros

RELNOTES: Deprecation attributes on macros now have effect.

Fixes rust-lang#34079
Fixes rust-lang#49912
Unblocks rust-lang#62086
Unblocks rust-lang#61000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants