8000 chore: fix error message construction by sundy-li · Pull Request #51 · cloudwego/motore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: fix error message construction #51

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

sundy-li
Copy link
Contributor
@sundy-li sundy-li commented May 6, 2025

Motivation

errors when using motore-macros in apache/iceberg-rust#1294

error[E0599]: no function or associated item named `into_compile_error` found for struct `syn::Error` in the current scope
   --> patches/motore-macros/src/lib.rs:38:28
    |
38  |         return syn::Error::into_compile_error(err).into();
    |                            ^^^^^^^^^^^^^^^^^^ function or associated item not found in `syn::Error`
    |
note: if you're trying to build a new `syn::Error` consider using one of the following associated functions:
      syn::Error::new
      syn::Error::new_spanned
   --> /home/sundy/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/syn-1.0.44/src/error.rs:133:5
    |
133 |     pub fn new<T: Display>(span: Span, message: T) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
157 |     pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: there is a method `to_compile_error` with a similar name, but with different arguments
   --> /home/sundy/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/syn-1.0.44/src/error.rs:193:5
    |
193 |     pub fn to_compile_error(&self) -> TokenStream {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0599`.
error: could not compile `motore-macros` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

Solution

fix the construction function of error

@sundy-li sundy-li requested review from a team as code owners May 6, 2025 01:30
@CLAassistant
Copy link
CLAassistant commented May 6, 2025

CLA assistant check
All committers have signed the CLA.

@Xuanwo
Copy link
Contributor
Xuanwo commented May 6, 2025

Hi, @PureWhiteWu, I believe syn = { version = "1", features = ["full"] } is wrong as our dep since syn = "=1.0.0" can't pass the build. Please check by using cargo generate-lockfile -Z direct-minimal-versions -Z minimal-versions

But however, this fix is good enough to merge first.

Copy link
Member
@PureWhiteWu PureWhiteWu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much for your contribution!

@PureWhiteWu PureWhiteWu merged commit 4127e29 into cloudwego:main May 6, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0