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

Failed to expand nested mods #186

Open
vvforekk opened this issue Apr 3, 2022 · 1 comment
Open

Failed to expand nested mods #186

vvforekk opened this issue Apr 3, 2022 · 1 comment

Comments

@vvforekk
Copy link

vvforekk commented Apr 3, 2022

Version

> cargo equip -V
cargo-equip 0.19.0

Small Example

https://github.com/SaiYS/dbg-cargo-equip
applying cargo-equip on src/bin/main.rs causes error.

error: could not bundle the code
dbg-cargo-equip 0.1.0 (path+file:///Users/roku/room/cloned/dbg-cargo-equip) as crate::__cargo_equip::crates::dbg_cargo_equip
Caused by:
could not expand dbg_cargo_equip from dbg-cargo-equip 0.1.0 (path+file:///Users/roku/room/cloned/dbg-cargo-equip)
Caused by:
one of ["/Users/roku/room/cloned/dbg-cargo-equip/src/bar.rs", "/Users/roku/room/cloned/dbg-cargo-equip/src/bar/mod.rs"] does not exist

Considerations

It seems to trying to expand not crate::foo::bar but crate::bar. Maybe replacing with_file_name() with join() will works well.

.with_file_name(&ident.to_string())

.with_file_name(&ident.to_string())

@jakobrs
Copy link

jakobrs commented Feb 17, 2023

This prevents using cargo-equip with e.g. ndarray, because src/extension.rs includes pub(crate) mod nonnull;, and cargo-equip looks for the nonnull module in src/nonnull.rs instead of src/extension/nonnull.rs. (I tried to fix the bug but it just breaks somewhere else)

jakobrs added a commit to THE-NIO/cargo-equip that referenced this issue Feb 17, 2023
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

2 participants