Skip to content

Duplicating names in a type parameter should be illegal. #15969

Closed
@TyOverby

Description

@TyOverby

The following function compiles:

fn foo<A: Share, A>(a: A) -> A{ a }

When unused the compiler issues the standard unused code warning.

As far as I can tell, there is no way to actually use the function without annotating the types for everything (foo::<&str, uint>(5u)) because otherwise the compiler can't infer the type of the function.

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