Skip to content

panic! does not warn about failing to provide an argument #43257

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
shepmaster opened this issue Jul 15, 2017 · 2 comments
Closed

panic! does not warn about failing to provide an argument #43257

shepmaster opened this issue Jul 15, 2017 · 2 comments

Comments

@shepmaster
Copy link
Member

shepmaster commented Jul 15, 2017

I expected panic! to behave like println! and warn me that I have a formatter argument that is unused. Tested with Rust 1.18.0.

println!

println!("{:p}"); 
error: invalid reference to argument `0` (no arguments given)
 --> src/main.rs:2:5
  |
2 |     println!("{:p}");
  |     ^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in a macro outside of the current crate

panic!

panic!("{:p}");
thread 'main' panicked at '{:p}', src/main.rs:4
@ollie27
Copy link
Member

ollie27 commented Jul 15, 2017

dupe of #22932

@shepmaster
Copy link
Member Author

Thank you, @ollie27, I couldn't find that with a few minutes of searching 😊

# 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

3 participants