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

Correct plural of arguments in format_args! #15785

Merged
merged 2 commits into from Jul 20, 2014

Conversation

Projects
None yet
4 participants
@treeman
Copy link
Contributor

treeman commented Jul 18, 2014

Fix for #15780.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 18, 2014

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()

This comment has been minimized.

@steveklabnik

steveklabnik Jul 18, 2014

Member

before, this didn't allocate, but now it does, right?

I guess this doesn't matter with an error...

This comment has been minimized.

@treeman

treeman Jul 18, 2014

Author Contributor

That's right. I think the readability makes it worth it.

@treeman

This comment has been minimized.

Copy link
Contributor Author

treeman commented Jul 18, 2014

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

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 18, 2014

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

@bors

This comment has been minimized.

Copy link
Contributor

bors commented on 820a558 Jul 20, 2014

This comment has been minimized.

Copy link
Contributor

bors replied Jul 20, 2014

merging treeman/rust/fix-15780 = 820a558 into auto

This comment has been minimized.

Copy link
Contributor

bors replied Jul 20, 2014

treeman/rust/fix-15780 = 820a558 merged ok, testing candidate = 4f55b52

This comment has been minimized.

Copy link
Contributor

bors replied Jul 20, 2014

fast-forwarding master to auto = 4f55b52

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

2 checks passed

continuous-integration/travis-ci The Travis CI build passed
Details
default all tests passed

@treeman treeman deleted the treeman:fix-15780 branch Jul 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.