Skip to content

Type parameters not allowed on UFCS methods #19586

New issue

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

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

Already on GitHub? # to your account

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.
lnicola added a commit to lnicola/rust that referenced this issue Apr 28, 2025
…igbuild

Use a Docker container instead of Zig for building with old(er) glibc on x64 Linux
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant