Stream: t-compiler/rust-analyzer

Topic: vec![] not working


Eh2406 (Feb 04 2021 at 16:09, on Zulip):

I am getting errors like

{
    "resource": "/c:/.../pubgrub-rs/src/internal/core.rs",
    "owner": "rustc",
    "code": {
        "value": "macro-error",
        "target": {
            "$mid": 1,
            "external": "https://rust-analyzer.github.io/manual.html#macro-error",
            "path": "/manual.html",
            "scheme": "https",
            "authority": "rust-analyzer.github.io",
            "fragment": "macro-error"
        }
    },
    "severity": 8,
    "message": "could not resolve macro `$crate::__export::force_expr`",
    "source": "rust-analyzer",
    "startLineNumber": 47,
    "startColumn": 40,
    "endLineNumber": 47,
    "endColumn": 63
}

every time there is a vac![somthing] im my code, Has this been reported?

bjorn3 (Feb 04 2021 at 16:10, on Zulip):

Are you using the latest rust-analyzer version? I believe it is already fixed.

Jonas Schievink [he/him] (Feb 04 2021 at 16:12, on Zulip):

It should be fixed on the latest Rust nightly

Eh2406 (Feb 04 2021 at 16:15, on Zulip):

Thanks for fixing it! Sorry for the noize. I look forward to having it fixed in the next update.

Jonas Schievink [he/him] (Feb 04 2021 at 16:16, on Zulip):

Hmm, this should already be fixed on the latest nightly Rust version

Jonas Schievink [he/him] (Feb 04 2021 at 16:17, on Zulip):

And it should only be a problem with a handful of nightly Rust versions, not beta or stable

Eh2406 (Feb 04 2021 at 16:21, on Zulip):

That is odd, what dose an RA errore have to do with Rust version. But I can do a Rustup update if that may help.

Jonas Schievink [he/him] (Feb 04 2021 at 16:22, on Zulip):

rust-analyzer processes the Rust sysroot to know about the standard library, which is where vec![] is defined

Jonas Schievink [he/him] (Feb 04 2021 at 16:22, on Zulip):

It was changed to use force_expr to improve error messages, but that was defined using macros 2.0 syntax, which r-a doesn't yet support, hence the error

Eh2406 (Feb 04 2021 at 16:30, on Zulip):

nightly-x86_64-pc-windows-msvc updated - rustc 1.51.0-nightly (04caa632d 2021-01-30) (from rustc 1.51.0-nightly (d98d2f57d 2021-01-18))

And it is working now! Thank you!

Last update: Jul 28 2021 at 02:45UTC