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

Fix all non_fmt_panic compilation warnings #341

Merged

Conversation

Enselic
Copy link
Collaborator

@Enselic Enselic commented Jul 5, 2021

They look like this:

warning: panic message is not a string literal
--> examples/syntest.rs:277:28
    |
277 |         Err(f) => { panic!(f.to_string()) }
    |                            ^^^^^^^^^^^^^
    |
    = note: `#[warn(non_fmt_panic)]` on by default
    = note: this is no longer accepted in Rust 2021
help: add a "{}" format string to Display the message
    |
277 |         Err(f) => { panic!("{}", f.to_string()) }
    |                            ^^^^^
help: or use std::panic::panic_any instead
    |
277 |         Err(f) => { std::panic::panic_any(f.to_string()) }
    |                     ^^^^^^^^^^^^^^^^^^^^^

They look like this:

    warning: panic message is not a string literal
    --> examples/syntest.rs:277:28
        |
    277 |         Err(f) => { panic!(f.to_string()) }
        |                            ^^^^^^^^^^^^^
        |
        = note: `#[warn(non_fmt_panic)]` on by default
        = note: this is no longer accepted in Rust 2021
    help: add a "{}" format string to Display the message
        |
    277 |         Err(f) => { panic!("{}", f.to_string()) }
        |                            ^^^^^
    help: or use std::panic::panic_any instead
        |
    277 |         Err(f) => { std::panic::panic_any(f.to_string()) }
        |                     ^^^^^^^^^^^^^^^^^^^^^
@trishume trishume merged commit d868092 into trishume:master Jul 5, 2021
@trishume
Copy link
Owner

trishume commented Jul 5, 2021

Thanks for this!

@Enselic Enselic deleted the fix-all-non_fmt_panic-compilation-warnings branch July 5, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants