Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type parameters not allowed on UFCS methods #19586

Closed
nikomatsakis opened this issue Dec 6, 2014 · 0 comments · Fixed by #19587
Closed

Type parameters not allowed on UFCS methods #19586

nikomatsakis opened this issue Dec 6, 2014 · 0 comments · Fixed by #19587

Comments

@nikomatsakis
Copy link
Contributor

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

huonw added a commit to huonw/rust that referenced this issue Dec 6, 2014
detect UFCS drop and allow UFCS methods to have explicit type parameters.

Work towards rust-lang#18875.

Since code could previously call the methods & implement the traits
manually, this is a

[breaking-change]

Closes rust-lang#19586. Closes rust-lang#19375.
alexcrichton added a commit to alexcrichton/rust that referenced this issue Dec 9, 2014
detect UFCS drop and allow UFCS methods to have explicit type parameters.

Work towards rust-lang#18875.

Since code could previously call the methods & implement the traits
manually, this is a

[breaking-change]

Closes rust-lang#19586. Closes rust-lang#19375.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant