Skip to content

#[deprecated] has no effect on macros #49912

Closed
@sgrif

Description

@sgrif
Contributor

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

Activity

abonander

abonander commented on Apr 13, 2018

@abonander
Contributor

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

sgrif commented on Apr 13, 2018

@sgrif
ContributorAuthor

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

abonander

abonander commented on Apr 14, 2018

@abonander
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.

added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Apr 24, 2018
petrochenkov

petrochenkov commented on Jun 22, 2019

@petrochenkov
Contributor

Fixed in #62042

added 2 commits that reference this issue on Jul 7, 2019

Rollup merge of rust-lang#62042 - petrochenkov:macstab, r=matthewjasper

b71c115

Rollup merge of rust-lang#62042 - petrochenkov:macstab, r=matthewjasper

3250b8e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @sgrif@pietroalbini@abonander@petrochenkov

      Issue actions

        `#[deprecated]` has no effect on macros · Issue #49912 · rust-lang/rust