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

format_args! uses the plural incorrectly #15780

Closed
steveklabnik opened this issue Jul 18, 2014 · 3 comments
Closed

format_args! uses the plural incorrectly #15780

steveklabnik opened this issue Jul 18, 2014 · 3 comments

Comments

@steveklabnik
Copy link
Member

@steveklabnik steveklabnik commented Jul 18, 2014

Sample code:

fn main() {
    // Error: you are missing an argument
    println!("My name is {0}, {1} {0}", "Bond");
}

error message:

me, ~/workspace/rust/byexample.rs » rustc scratchpad.rs 
scratchpad.rs:13:14: 13:39 error: invalid reference to argument `1` (there are 1 arguments)
scratchpad.rs:13     println!("My name is {0}, {1} {0}", "Bond");
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

This should say "there is 1 argument" instead.

originally reported here: http://www.reddit.com/r/rust/comments/2b0mw8/error_message_in_format_args/

@treeman
Copy link
Contributor

@treeman treeman commented Jul 18, 2014

I can take this.

bors added a commit that referenced this issue Jul 20, 2014
@treeman
Copy link
Contributor

@treeman treeman commented Jul 20, 2014

This can be closed.

@huonw
Copy link
Member

@huonw huonw commented Jul 20, 2014

Thanks!

@huonw huonw closed this Jul 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants