Using $crate in Rust's procedural macros?

后端 未结 3 930
轻奢々
轻奢々 2021-02-05 08:21

I know what the $crate variable is, but as far as I can tell, it can\'t be used inside procedural macros. Is there another way to achieve a similar effect?

I have an ex

3条回答
  •  醉话见心
    2021-02-05 08:43

    Based on replies from https://github.com/rust-lang/rust/issues/38356#issuecomment-412920528, it looks like there is no way to do this (as of 2018-08), neither to refer to the proc-macro crate nor to refer to any other crate unambiguously.

提交回复
热议问题