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 unresolved import "syn::ItemFn" when running tests #445

Merged
merged 1 commit into from
Mar 2, 2024

Conversation

OrangeTux
Copy link
Contributor

@OrangeTux OrangeTux commented Jan 5, 2024

cargo test fails with:

$ cargo test                                                                                                                                     master ✭
   Compiling json_schema_test_suite_proc_macro v0.3.0 (/home/auke/projects/jsonschema-rs/jsonschema-test-suite/proc_macro)
   Compiling jsonschema v0.17.1 (/home/auke/projects/jsonschema-rs/jsonschema)
error[E0432]: unresolved import `syn::ItemFn`
   --> /home/auke/projects/jsonschema-rs/jsonschema-test-suite/proc_macro/src/lib.rs:41:37
    |
41  | use syn::{parse_macro_input, Ident, ItemFn};
    |                                     ^^^^^^ no `ItemFn` in the root
    |
note: found an item that was configured out
   --> /home/auke/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:365:32
    |
365 |     ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMacro2, ItemMod,
    |                                ^^^^^^
    = note: the item is gated behind the `full` feature

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

This commit fixes the issue by applying the suggestion of the compiler.

Fixes #444

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4461d0f) 79.56% compared to head (b159980) 79.48%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #445      +/-   ##
==========================================
- Coverage   79.56%   79.48%   -0.09%     
==========================================
  Files          56       56              
  Lines        5149     5122      -27     
==========================================
- Hits         4097     4071      -26     
+ Misses       1052     1051       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

`cargo test` fails with:

```
$ cargo test                                                                                                                                     master ✭
   Compiling json_schema_test_suite_proc_macro v0.3.0 (/home/auke/projects/jsonschema-rs/jsonschema-test-suite/proc_macro)
   Compiling jsonschema v0.17.1 (/home/auke/projects/jsonschema-rs/jsonschema)
error[E0432]: unresolved import `syn::ItemFn`
   --> /home/auke/projects/jsonschema-rs/jsonschema-test-suite/proc_macro/src/lib.rs:41:37
    |
41  | use syn::{parse_macro_input, Ident, ItemFn};
    |                                     ^^^^^^ no `ItemFn` in the root
    |
note: found an item that was configured out
   --> /home/auke/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-1.0.109/src/lib.rs:365:32
    |
365 |     ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMacro2, ItemMod,
    |                                ^^^^^^
    = note: the item is gated behind the `full` feature

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

This commit fixes the issue by applying the suggestion of the compiler.
@OrangeTux OrangeTux force-pushed the fix-unresolved-import branch from 9459826 to b159980 Compare January 16, 2024 07:46
@Stranger6667 Stranger6667 merged commit 52cf568 into Stranger6667:master Mar 2, 2024
12 of 28 checks passed
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.

cargo test fails to compile: unresolved import "syn::ItemFn"
2 participants