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

Fill match arms duplicates arm with imported variants #15147

Open
lnicola opened this issue Jun 27, 2023 · 5 comments
Open

Fill match arms duplicates arm with imported variants #15147

lnicola opened this issue Jun 27, 2023 · 5 comments
Assignees
Labels
A-assists A-pattern pattern handling related things C-bug Category: bug

Comments

@lnicola
Copy link
Member

lnicola commented Jun 27, 2023

Spotted in #15143.

            ProjectionElem::Field(f) => match &base.data(Interner).kind {
                TyKind::Adt(_, subst) => {
                    db.field_types(f.parent)[f.local_id].clone().substitute(Interner, subst)
                }
                chalk_ir::TyKind::Adt(_, _) => todo!(),
                // ...
@lnicola lnicola added C-bug Category: bug A-assists labels Jun 27, 2023
@lnicola lnicola changed the title Fill match arms yields duplicate arm Fill match arms yields duplicate arm with imported variants Jun 27, 2023
@lnicola
Copy link
Member Author

lnicola commented Jun 27, 2023

Minimal repro:

mod m {
    pub enum E {
        A,
    }
}

use m::E::{self, *};

fn foo(e: E) {
    match e {
        E::A => {}
    }
}

@lnicola lnicola changed the title Fill match arms yields duplicate arm with imported variants Fill match arms duplicates arm with imported variants Jun 27, 2023
@alibektas
Copy link
Member

@rustbot claim

@jbr
Copy link
Contributor

jbr commented Jul 14, 2023

@alibektas Is there anything I can do to help resolve this? I'm the reporter of #15143 and am unable to use rust-analyzer in my work codebase because it panics almost constantly. My hunch is that the code in question is proc-macro code from sea-orm, but I don't know how to inspect the specific code that RA is looking at when it panics. I don't believe I have any code that looks like the minimal repro

@alibektas
Copy link
Member

alibektas commented Jul 15, 2023

@jbr let me work on this for the next couple of hours and I will let you know either at the end of my day ( UTC+2 ) or tomorrow. Perhaps you could let me know whether the problem still continues once this is issue is closed.

@alibektas
Copy link
Member

@jbr So I checked what the problem is. This issue has a link to #15143 because the problem was encountered while trying to understand the causes of #15143. I will try to solve the original issue, but I am inexperienced in HIR matters but let's see.

@lnicola lnicola closed this as completed Jul 17, 2023
@lnicola lnicola reopened this Jul 17, 2023
@Nadrieril Nadrieril added the A-pattern pattern handling related things label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists A-pattern pattern handling related things C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants