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

Getting "panic message is not a string literal" from Rust 2021 #505

Closed
applegrew opened this issue Apr 1, 2021 · 7 comments
Closed

Getting "panic message is not a string literal" from Rust 2021 #505

applegrew opened this issue Apr 1, 2021 · 7 comments

Comments

@applegrew
Copy link

When using Rust 2021 I am getting the following warning wherever parses_to! is used.

warning: panic message is not a string literal
  --> src/parser/unit_tests.rs:11:5
   |
11 | /     parses_to! {
12 | |         parser: JsParser,
13 | |         input: "10",
14 | |         rule: Rule::numeric_literal,
...  |
21 | |         ]
22 | |     };
   | |______^
   |
   = note: this is no longer accepted in Rust 2021
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
@applegrew
Copy link
Author

I had to use #[allow(non_fmt_panic)] to turn off this warning.

@nirvdrum
Copy link

nirvdrum commented Apr 7, 2021

I'm using Rust 2018 and I'm seeing the warning as well. It started with Rust 1.51.0, I think.

@CAD97
Copy link
Contributor

CAD97 commented Apr 8, 2021

Yep, this is a new rustc warning that we didn't realize was a problem in the emitted code before.

@CAD97
Copy link
Contributor

CAD97 commented Apr 8, 2021

(I won't have the bandwidth to make a PR to fix this anytime soon, likely, but I can approve a PR if someone else sets it up. I believe @01mf02 found where the issue needs fixing.

@CAD97
Copy link
Contributor

CAD97 commented Apr 12, 2021

This should be fixed by #507.

@MarinPostma
Copy link
Contributor

this fixed by #507

@nirvdrum
Copy link

If not too much of a problem, can we please get this in a release? I can continue to use #![allow(non_fmt_panic)], but this seems like the sort of thing that will be unexpected by new users.

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

No branches or pull requests

4 participants