-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Correct plural of arguments in format_args! #15785
Conversation
Could you add a test for this as well? |
@@ -215,12 +215,21 @@ impl<'a, 'b> Context<'a, 'b> { | |||
} | |||
} | |||
|
|||
fn describe_num_args(&self) -> String { | |||
if self.args.len() == 1 { | |||
"there is 1 argument".to_string() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before, this didn't allocate, but now it does, right?
I guess this doesn't matter with an error...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. I think the readability makes it worth it.
As for the tests, we want a file with: format!("{0} {1}", 1);
//^~ ERROR invalid reference to argument `1` (there is 1 argument) inside |
Yeah, you can also just add a test case to |
Initial support for implicit drop inlay hint cc rust-lang#15785
Fix for #15780.