Skip to content

too many arguments to fmt! #10286

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
inspurhua opened this issue Nov 5, 2013 · 3 comments
Closed

too many arguments to fmt! #10286

inspurhua opened this issue Nov 5, 2013 · 3 comments

Comments

@inspurhua
Copy link

fn main() {
    debug!("{:?}","aa" );
}

when i compile it ,

error: too many arguments to fmt!. found 2, expected 1
:2     debug!("{:?}","aa" );

win7 32bit,rust 0.8

@huonw
Copy link
Member

huonw commented Nov 5, 2013

Hi, thanks for the report.

This looks like you have an version of Rust where debug! (etc) used the old fmt! string formatting syntax extension (I think 0.8 still used that), so you need to write debug!("%?", "aa");.

There is possibly a debug2 macro which uses the new format! syntax, i.e. debug2!("{:?}", "aa"); may work (NB. I'm not 100% sure when this was introduced).

Just to be sure, are you using 0.8?

@inspurhua
Copy link
Author

i find the problem at rust 0.8, debug!("%?", "aa") is right.thank you

@inspurhua
Copy link
Author

debug!("%?", "aa");

bors pushed a commit to rust-lang-ci/rust that referenced this issue Dec 1, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 1, 2023
…_to_ref-tests, r=blyxyas

Add tests for issues rust-lang#10285, rust-lang#10286, rust-lang#10289, rust-lang#10287

Fixes rust-lang#10285.
Fixes rust-lang#10286.
Fixes rust-lang#10289.
Fixes rust-lang#10287.

This PR simply adds tests for the listed issues as they're already implemented so we can close them.

r? `@blyxyas`

changelog:none
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants