Skip to content

Type parameters not allowed on UFCS methods #19586

Closed
@nikomatsakis

Description

@nikomatsakis

The instantiate_path code incorrectly accounts for type parameter spaces, meaning that this program is rejected:

trait Foo<T> {
    fn get(&self) -> T;
}

impl Foo<i32> for i32 {
    fn get(&self) -> i32 { *self }
}

fn main() {
    let x: i32 = 1;
    Foo::<i32>::get(&x)
}

cc @huonw

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