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

Implement missing members assist fills in consts with default value #13292

Closed
crumblingstatue opened this issue Sep 25, 2022 · 0 comments · Fixed by #13642
Closed

Implement missing members assist fills in consts with default value #13292

crumblingstatue opened this issue Sep 25, 2022 · 0 comments · Fixed by #13642
Labels

Comments

@crumblingstatue
Copy link

trait Foo {
    const C: i32 = 42;

    fn missing();
}

struct Bar;

impl Foo for Bar {
    
}

The assist generates the following:

impl Foo for Bar {
    const C: i32 = 42; // Unnecessary, there is already a default

    fn missing() {
        todo!()
    }
}

rust-analyzer version: rust-analyzer version: 0.3.1212-standalone

rustc version: rustc 1.66.0-nightly (4a1467723 2022-09-23)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants