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
I'm working on a project which defines a core module for itself in the codebase and does not use the core crate directly. The module is frequently used, so it's imported alongside other common stuff everywhere through use crate::*.
However, when I tried using serde_repr I hit an strange error:
error[E0433]: failed to resolve: could not find `result` in `core`
--> src/lib.rs:7:26
|
7 | #[derive(Serialize_repr, Deserialize_repr, PartialEq, Eq, Debug)]
| ^^^^^^^^^^^^^^^^ could not find `result` in `core`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
|
1 | use core::fmt::Result;
|
1 | use core::result::Result;
|
1 | use serde::__private::Result;
|
1 | use serde::__private::fmt::Result;
|
and 4 other candidates
After taking a look in the source code it turns out no :: prefix is being used (e.g. ::core::result::Result instead of core::result::Result), which seems to be the cause.
To reproduce:
use serde_repr::{Serialize_repr,Deserialize_repr};mod core {}#[derive(Serialize_repr,Deserialize_repr,PartialEq,Eq,Debug)]#[repr(u8)]enumE{V = 0}
A temporary fix I currently use in the modules I use serde_repr:
use ::core;
Which is less than ideal.
The text was updated successfully, but these errors were encountered:
I'm working on a project which defines a
core
module for itself in the codebase and does not use thecore
crate directly. The module is frequently used, so it's imported alongside other common stuff everywhere throughuse crate::*
.However, when I tried using
serde_repr
I hit an strange error:After taking a look in the source code it turns out no
::
prefix is being used (e.g.::core::result::Result
instead ofcore::result::Result
), which seems to be the cause.To reproduce:
A temporary fix I currently use in the modules I use
serde_repr
:Which is less than ideal.
The text was updated successfully, but these errors were encountered: