Error: canโ€™t find crate for `proc_macro_hack`

โš“ Rust    ๐Ÿ“… 2025-06-24    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 6      

surdeus

Warning

This post was published 48 days ago. The information described in this article may have changed.

Hi, I encountered the following error while building pgvectorscale and am trying to understand what caused it and how to fix it. Any insights would be greatly appreciated.

error: `proc-macro` crate types currently cannot export any items other than functions tagged with `#[proc_macro]`, `#[proc_macro_derive]`, or `#[proc_macro_attribute]`
  --> /home/xingxue/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/paste-impl-0.1.18/src/lib.rs:25:1
   |
25 | pub fn expr(input: TokenStream) -> TokenStream {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0463]: can't find crate for `proc_macro_hack`
  --> /home/xingxue/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/paste-impl-0.1.18/src/lib.rs:10:5
   |
10 | use proc_macro_hack::proc_macro_hack;
   |     ^^^^^^^^^^^^^^^ can't find crate

The cargo tree is something like the following:

|-- pgrx v0.12.9
|   |-- atomic-traits v0.3.0
|   |   `-- cfg-if v1.0.1
  ....
|       |-- proc-macro2 v1.0.95 (*)
|       |-- quote v1.0.40 (*)
|       `-- syn v2.0.103 (*)
`-- simdeez v1.0.8
    |-- cfg-if v0.1.10
    `-- paste v0.1.18
        |-- paste-impl v0.1.18 (proc-macro)
        |   `-- proc-macro-hack v0.5.20+deprecated (proc-macro)
        `-- proc-macro-hack v0.5.20+deprecated (proc-macro)

5 posts - 2 participants

Read full topic

๐Ÿท๏ธ rust_feed