You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[package]
name = "core"
version = "0.1.0"
edition = "2021"
[dependencies]
derive_more = "0.99"
core/src/lib.rs:
use derive_more::Add;
#[derive(Add)]
pub struct Foo(u32);
... cargo check works fine, but cargo test gives:
error[E0433]: failed to resolve: could not find `ops` in `core`
--> /home/xxx/core/src/lib.rs:3:10
|
3 | #[derive(Add)]
| ^^^ could not find `ops` in `core`
|
= note: this error originates in the derive macro `Add` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0433`.
cargo test works fine if package is not named core.
The text was updated successfully, but these errors were encountered:
abau
changed the title
cargo test fails in when package is named "core"cargo test fails in package named "core"
Dec 31, 2021
## Synopsis
See #180 (comment)
for details.
At the moment, compilation fails in a local crate `core` is present in
workspace or some another crate is renamed as `core`.
## Solution
Use `::derive_more::core` instead of `::core` in macro expansions.
Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
In the following project,
Cargo.toml
:core/Cargo.toml
:core/src/lib.rs
:...
cargo check
works fine, butcargo test
gives:cargo test
works fine if package is not namedcore
.The text was updated successfully, but these errors were encountered: