Skip to content

Using items from a deprecated module does not warn #47237

@sgrif

Description

@sgrif

Attempting to use deprecated_module; or use deprecated_module::*; fails, but doing use deprecated_module::SpecificItem; compiles with no error. Right now in Diesel I'm actually seeing an even more confusing error:

use of deprecated item 'types::__test_reexports'

Even though there is nothing in the project with that name. However, I'm unable to reproduce that issue outside of Diesel.

Regardless, the following code compiles without warnings, but should warn.

#[deprecated(since = "0.1.0")]
pub mod foo {
    pub use std::option::Option;
}

pub mod bar {
    use foo::Option;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.L-deprecatedLint: deprecatedT-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

    No branches or pull requests

    Issue actions