Skip to content

Associated types can be specified multiple times in trait objects #50589

Closed
@Marwes

Description

@Marwes
fn test() ->  Box<Iterator<Item = (), Item = ()>> {
    Box::new(None.into_iter())
}

It seems rather surprising that the above code actually compiles. Making it an error wouldn't be backwards compatible but a warning would be nice (the same happens with impl Future<Item = (), Item = ()> which is where I got burnt, thinking I had specified the Error type).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions