Skip to content

Correct plural of arguments in format_args! - #15785

Merged
bors merged 2 commits into
rust-lang:masterfrom
treeman:fix-15780
Jul 20, 2014
Merged

Correct plural of arguments in format_args!#15785
bors merged 2 commits into
rust-lang:masterfrom
treeman:fix-15780

Conversation

@treeman

@treeman treeman commented Jul 18, 2014

Copy link
Copy Markdown
Contributor

Fix for #15780.

@alexcrichton

Copy link
Copy Markdown
Member

Could you add a test for this as well?

Comment thread src/libsyntax/ext/format.rs Outdated

Copy link
Copy Markdown
Contributor

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...

Copy link
Copy Markdown
Contributor Author

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.

@treeman

treeman commented Jul 18, 2014

Copy link
Copy Markdown
Contributor Author

As for the tests, we want a file with:

format!("{0} {1}", 1);
//^~ ERROR invalid reference to argument `1` (there is 1 argument)

inside src/test/compile-fail and it will also check the error output?

@alexcrichton

Copy link
Copy Markdown
Member

Yeah, you can also just add a test case to src/test/compile-fail/ifmt-bad-arg.rs

bors added a commit that referenced this pull request Jul 20, 2014
@bors bors closed this Jul 20, 2014
@bors
bors merged commit 820a558 into rust-lang:master Jul 20, 2014
@treeman
treeman deleted the fix-15780 branch July 20, 2014 11:37
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 4, 2023
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.

4 participants