Skip to content

#[deprecated] does not work for in-crate usages of items #16409

Closed
@brendanzab

Description

@brendanzab

This compiles:

#![forbid(deprecated)]

#[deprecated]
fn foo() {}

fn main() {
    foo();
}

http://is.gd/bQE1W1

More extensive example from @chrismorgan: http://is.gd/eRBKUc

This is annoying because I would love to use it to purge old stuff from my own codebase, rather than deferring it until the removal time, and risking usages creep back in with other PRs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions