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

Arg count mismatch diagnostic: Handle tuple struct/variant ctors #5283

Merged
merged 1 commit into from
Jul 9, 2020
Merged

Arg count mismatch diagnostic: Handle tuple struct/variant ctors #5283

merged 1 commit into from
Jul 9, 2020

Conversation

jonas-schievink
Copy link
Contributor

I didn't know callable_item_signature was a thing, that makes this really easy.

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 9, 2020

@bors bors bot merged commit 7f991d8 into rust-lang:master Jul 9, 2020
@jonas-schievink jonas-schievink deleted the arg-count-mismatch-tuple-ctor branch July 9, 2020 16:39
Tup(0);
}
",
expect![["\"Tup(0)\": Expected 2 arguments, found 1\n"]],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually now that I look at it, annotaed tests might be even better here

            struct Tup(u8, u16);
            fn f() {
                Tup(0);
              //^^^^^^ Expected 2 arguments, found 1
            }

but maybe not -- multiline spans would be awkward. See inlay_hints.rs for how such tests feel

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.

2 participants