Skip to content

format_args! uses the plural incorrectly #15780

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

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
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-low Low priority

Comments

@steveklabnik
Copy link
Member

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 commented Jul 18, 2014

I can take this.

@treeman
Copy link
Contributor

treeman commented Jul 20, 2014

This can be closed.

@huonw
Copy link
Member

huonw commented Jul 20, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. P-low Low priority
Projects
None yet
Development

No branches or pull requests

3 participants