codeql icon indicating copy to clipboard operation
codeql copied to clipboard

[Rust] macro expansion failed warnings 2

Open intrigus-lgtm opened this issue 6 months ago • 4 comments

Description of the issue

Similarly to https://github.com/github/codeql/issues/19966 I'm also hitting quite a few macro expansion failed warnings:

WARN /home/sg/dev/cosmwasm/contracts/ibc-reflect/src/msg.rs:14:21: macro expansion failed: the macro 'vec' expands to ERROR but a Expr was expected

As I don't know whether the bugs share a common root cause, I'm opening this issue.

Reproduction steps

git clone https://github.com/CosmWasm/cosmwasm.git
git checkout cf413c5ad6a58a87e0be894584f01506f3b2e0af^
codeql database create --language=rust "cosmwasm-db-cf413c5ad6a58a87e0be894584f01506f3b2e0af^" --overwrite

Files

database-create-20250701.203330.097.log database-index-files-20250701.203333.834.log cosmwasm-db-cf413c5ad6a58a87e0be894584f01506f3b2e0af^.zip

intrigus-lgtm avatar Jul 05 '25 14:07 intrigus-lgtm

Hi @intrigus-lgtm

Thanks for the report. I'll let the engineering team know about the issue.

jketema avatar Jul 05 '25 15:07 jketema

Hi @intrigus-lgtm, thanks for reaching out about this! As far as I could test, seems like this is an upstream issue with rust-analyzer, as can be highlighted by opening the contracts/ibc-reflect directory in VSCode with the rust-analyzer plugin:

Image

(opening the cosmwasm directory doesn't index that crate because it is explicitly excluded from the root workspace).

I'll file an issue about this.

redsun82 avatar Jul 07 '25 08:07 redsun82

Hi @intrigus-lgtm, thanks for reaching out about this! As far as I could test, seems like this is an upstream issue with rust-analyzer, as can be highlighted by opening the contracts/ibc-reflect directory in VSCode with the rust-analyzer plugin:

Ah, yes I could have checked that, but I would not have expected rust-analyzer to fail.

I'll file an issue about this.

Did you already do? If so, do you already have a reducer? If not, I may try to create a reproducer :)

EDIT: https://github.com/rust-lang/rust-analyzer/issues/20191 and https://github.com/rust-lang/rust-analyzer/issues/20191#issuecomment-3046541217 🙂

intrigus-lgtm avatar Jul 07 '25 15:07 intrigus-lgtm

The fix has been merged to rust-analyzer 🎉 https://github.com/rust-lang/rust-analyzer/pull/20164

intrigus-lgtm avatar Nov 28 '25 14:11 intrigus-lgtm