Skip to content

Could not recognize proc macro dynamic libraries compiled with Rust =1.47.0 #9898

Closed
@qryxip

Description

@qryxip

In Rust 1.47.0, ListMacro query fails with a little weird message.

function list-macro () {
>   cargo "+$1" check -q --message-format json |
>     jq -c 'select(.reason == "compiler-artifact" and .target.kind == ["proc-macro"]) | {"ListMacro": {"lib": .filenames[]}}' |
>     $2 proc-macro |
>     jq
> }list-macro 1.48.0 ./rust-analyzer-2021-07-12
{
  "ListMacro": {
    "macros": [
      [
        "nop",
        "FuncLike"
      ],
      [
        "identity",
        "FuncLike"
      ]
    ]
  }
}list-macro 1.48.0 ./rust-analyzer-2021-07-19
{
  "ListMacro": {
    "macros": [
      [
        "nop",
        "FuncLike"
      ],
      [
        "identity",
        "FuncLike"
      ]
    ]
  }
}list-macro 1.47.0 ./rust-analyzer-2021-07-12
{
  "ListMacro": {
    "macros": [
      [
        "nop",
        "FuncLike"
      ],
      [
        "identity",
        "FuncLike"
      ]
    ]
  }
}list-macro 1.47.0 ./rust-analyzer-2021-07-19
{
  "Error": {
    "code": "ExpansionError",
    "message": "Cannot create expander for /home/ryo/src/local/play-expand-macros/target/debug/deps/libmy_macros_impl-e1f836fa719da873.so: Io(Custom { kind: Other, error: StreamHeader { byte: 141 } })"
  }
}

(Of course) unresolved-proc-macro warnings show up for Rust 1.47.0.

image

  • Target: x86_64-unknown-linux-gnu
  • OS: GNU/Linux (Arch Linux)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions