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

Comments

Projects
None yet
3 participants
@steveklabnik
Copy link
Member

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

This comment has been minimized.

Copy link
Contributor

treeman commented Jul 18, 2014

I can take this.

bors added a commit that referenced this issue Jul 20, 2014

@treeman

This comment has been minimized.

Copy link
Contributor

treeman commented Jul 20, 2014

This can be closed.

@huonw

This comment has been minimized.

Copy link
Member

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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.