Skip to content

Stability attributes ignored on use declarations #23937

Closed
@rprichard

Description

@rprichard

std::collections reexports collections::linked_list, which has this alias:

#[deprecated(since = "1.0.0", reason = "renamed to LinkedList")]
#[unstable(feature = "collections")]
pub use LinkedList as DList;

collections::linked_list and collections::linked_list::LinkedList are stable, so presumably the intent of these stability attributes was to stop stable code from using the DList name, but it doesn't work. This compiles fine:

use std::collections::linked_list::DList;
fn main() {
    DList::<i32>::new();
}

AFAICT, stability attributes don't affect pub use declarations.

(Aside: AFAICT, stability attributes also don't affect impls either, but maybe I'm missing something? The standard library has stability attributes on many of its impls.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-stabilityArea: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.P-lowLow priorityT-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