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

infinite loop during function argument check #101097

Closed
kocsis1david opened this issue Aug 27, 2022 · 2 comments · Fixed by #100502
Closed

infinite loop during function argument check #101097

kocsis1david opened this issue Aug 27, 2022 · 2 comments · Fixed by #100502
Labels
C-bug Category: This is a bug.

Comments

@kocsis1david
Copy link

I tried this code:

struct A;
struct B;
struct C;

fn f(
    a1: A,
    a2: A,
    b1: B,
    b2: B,
    c1: C,
    c2: C,
) {}

fn main() {
    f(
        C,
        C,
        A,
        A,
        B,
        B,
    );
}

I expected to see this happen: the compiler giving an error and showing a hint that order of the argument are not correct.

Instead, this happened: it stucks, waits forever.

Meta

It happens on both stable and nightly.

Might be related to this: #100478

@kocsis1david kocsis1david added the C-bug Category: This is a bug. label Aug 27, 2022
@kocsis1david kocsis1david changed the title infinite loop during checking function argument types infinite loop during function argument check Aug 27, 2022
@compiler-errors
Copy link
Member

Yeah, this is probably a dupe of that other one. cc @chenyukang

@chenyukang
Copy link
Member

Yeah, this is probably a dupe of that other one. cc @chenyukang

Yes, it's another bug in the same function, but the root cause is different.
I will working on the same PR for this issue.

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 12, 2022
Avoid infinite loop in function arguments checking

Fixes rust-lang#100478
Fixes rust-lang#101097
@bors bors closed this as completed in 7e7dfb8 Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants