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

could not find fmt in core when upgrading to 0.25 #284

Closed
FrancisRussell opened this issue Jul 12, 2023 · 1 comment · Fixed by #287
Closed

could not find fmt in core when upgrading to 0.25 #284

FrancisRussell opened this issue Jul 12, 2023 · 1 comment · Fixed by #287

Comments

@FrancisRussell
Copy link

FrancisRussell commented Jul 12, 2023

Attempting to upgrade a codebase which compiles with strum 0.24.1 to 0.25.0 (strum_macros at 0.25.1) I get this error when compiling, which seems to be related to the derivation of EnumIter.

error[E0433]: failed to resolve: could not find `fmt` in `core`
   --> src/cache_cargo_home.rs:524:25
    |
524 |     Debug, Clone, Copy, EnumIter, EnumString, Eq, Hash, PartialEq, IntoStaticStr, Display, Serialize, Deserialize,
    |                         ^^^^^^^^ could not find `fmt` in `core`
    |
    = note: this error originates in the derive macro `EnumIter` (in Nightly builds, run with -Z macro-backtrace for more info)
@FrancisRussell FrancisRussell changed the title could not find fmt in core`` when upgrading to 0.25 could not find fmt in core`` when upgrading to 0.25 Jul 12, 2023
@FrancisRussell FrancisRussell changed the title could not find fmt in core`` when upgrading to 0.25 could not find \fmt\ in core` when upgrading to 0.25 Jul 12, 2023
@FrancisRussell FrancisRussell changed the title could not find \fmt\ in core` when upgrading to 0.25 ` could not find fmt in core ` when upgrading to 0.25 Jul 12, 2023
@FrancisRussell FrancisRussell changed the title ` could not find fmt in core ` when upgrading to 0.25 `` could not find fmt in core `` when upgrading to 0.25 Jul 12, 2023
@FrancisRussell FrancisRussell changed the title `` could not find fmt in core `` when upgrading to 0.25 could not find fmt in core when upgrading to 0.25 Jul 12, 2023
@FrancisRussell
Copy link
Author

FrancisRussell commented Jul 17, 2023

OK, I've partly determined what is going wrong here. I have an imported module called core which the macro is attempting to access fmt out of instead of the top-level core. I guess that previously the same functionality was being accessed via a different path.

It seems like the solution here is to refer to core via a ::core path which should cause it to access the top-level module regardless of imports..

kraktus added a commit to kraktus/strum that referenced this issue Jul 26, 2023
Peternator7 pushed a commit that referenced this issue Jul 29, 2023
* Add test to ensure macro call `::core`-related functions

Avoiding local core modules to break the macro-generated code.

Currently failing due to issue with `EnumIter` macros.

* Fix macro of `EnumIter`

close #284

---------

Co-authored-by: kraktus <kraktus@users.noreply.github.com>
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.

1 participant