Skip to content

Stability checker prevents return-position impl trait in the standard library #54283

Closed
@scottmcm

Description

@scottmcm

Previously hit here: #52896 (comment) (thanks, eddyb)

The way I hit this in a change I was trying:

   Compiling core v0.0.0 (file:///C:/src/rust/src/libcore)
←[0m←[1m←[38;5;9merror←[0m←[0m←[1m←[38;5;15m: This node does not have a stability attribute←[0m
←[0m   ←[0m←[0m←[1m←[38;5;14m--> ←[0m←[0mlibcore\num\f32.rs:604:35←[0m
←[0m    ←[0m←[0m←[1m←[38;5;14m|←[0m
←[0m←[1m←[38;5;14m604←[0m←[0m ←[0m←[0m←[1m←[38;5;14m| ←[0m←[0m    pub fn total_ordered(self) -> impl Ord {←[0m
←[0m    ←[0m←[0m←[1m←[38;5;14m| ←[0m←[0m                                  ←[0m←[0m←[1m←[38;5;9m^^^^^^^^←[0m

Instructions from oli-obk in #52896 (comment) :

Should be enough to add an arm to

hir::ItemKind::Impl(.., None, _, _) | hir::ItemKind::ForeignMod(..) => {}

for ItemExistential(ExistTy { parent_fn_id: Some(_) }) which also skips the check_missing_stability call

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.A-stabilityArea: `#[stable]`, `#[unstable]` etc.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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

    No branches or pull requests

    Issue actions