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

chore: remove specialized method for Self::foo() trait call #5630

Closed

Conversation

asterite
Copy link
Collaborator

Description

Problem*

Resolves

Summary*

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@asterite asterite force-pushed the ab/self-type-trait-function-call branch from f9cdf4d to e95ee1c Compare July 29, 2024 21:18
@asterite
Copy link
Collaborator Author

Closing because this breaks code like this, where self_type isn't a struct:

trait Foo {
    fn foo() -> Self {
        Self::bar()
    }

    fn bar() -> Self;
}

impl Foo for Field {
    fn bar() -> Self {
        1
    }
}

fn main() {
    let x: Field = Foo::foo();
}

@asterite asterite closed this Jul 30, 2024
@asterite asterite deleted the ab/self-type-trait-function-call branch July 30, 2024 16:52
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 this pull request may close these issues.

1 participant