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
The oid! macro evaluates to a reference to der_parser::…. This doesn't work if I don't have the crate in my namespace, e.g. if I'm using the macro via use x509_parser::der_parser::oid;. If this was a macro_rules! macro I'd say it needs to be using $crate, I hope proc macros have an equivalent (heck, can they just use $crate directly too?).
The text was updated successfully, but these errors were encountered:
As far as I understand, this is not possible now (see discussion and links in rust-lang/rust#54363)
There seems to be a workaround in rust-lang/rust#54647 but I haven't tested it.
Hack idea: make oid!() a macro-by-example in der_parser that just invoked something like _oid!($crate, $($args)*) and have the proc macro be _oid!(). Hopefully this will pass the crate path in correctly so the proc macro can then use it in the generated code.
format!("{{ use der_parser::oid; use der_parser::oid::Oid; // this will be the ret value der_parser::oid::Oid::new(alloc::borrow::Cow::Borrowed(&{}))}}",
s
)
The
oid!
macro evaluates to a reference toder_parser::…
. This doesn't work if I don't have the crate in my namespace, e.g. if I'm using the macro viause x509_parser::der_parser::oid;
. If this was amacro_rules!
macro I'd say it needs to be using$crate
, I hope proc macros have an equivalent (heck, can they just use$crate
directly too?).The text was updated successfully, but these errors were encountered: