Stream: t-compiler/rust-analyzer

Topic: cargo gets confused compiling RA


Joshua Nelson (Jan 18 2021 at 21:55, on Zulip):

I just got the following error after compiling RA with stable, then nightly, then switching back to stable:

error[E0460]: found possibly newer version of crate `la_arena` which `profile` depends on
   --> crates/syntax/src/algo.rs:126:18
    |
126 |         let _p = profile::span("into_text_edit");
    |                  ^^^^^^^
    |
    = note: perhaps that crate needs to be recompiled?
    = note: the following crate versions were found:
            crate `la_arena`: /home/joshua/.local/lib/cargo/target/debug/deps/libla_arena-30ef6779a35b7e2f.rmeta
            crate `la_arena`: /home/joshua/.local/lib/cargo/target/debug/deps/libla_arena-af7c500c62bd5e59.rmeta
            crate `la_arena`: /home/joshua/.local/lib/cargo/target/debug/deps/libla_arena-af7c500c62bd5e59.rlib
            crate `profile`: /home/joshua/.local/lib/cargo/target/debug/deps/libprofile-6846f1b303b1dfdb.rmeta

Is this a known issue? Or should I report a cargo bug?

Joshua Nelson (Jan 18 2021 at 21:55, on Zulip):

I don't know how I manage to always run into bugs the first time I compile a project :joy:

Jonas Schievink [he/him] (Jan 18 2021 at 21:56, on Zulip):

hmm, haven't seen that before

Joshua Nelson (Jan 18 2021 at 21:56, on Zulip):

ok, will report a cargo bug

Joshua Nelson (Jan 18 2021 at 21:56, on Zulip):

hopefully I can replicate :sweat_smile:

Jonas Schievink [he/him] (Jan 18 2021 at 21:56, on Zulip):

I did notice r-a getting confused about la_arena though

Jonas Schievink [he/him] (Jan 18 2021 at 21:56, on Zulip):

Some imports weren't getting resolved

Jonas Schievink [he/him] (Jan 18 2021 at 21:57, on Zulip):

Looks like r-a was analyzing la_arena 0.1.x, while it was actually depending on 0.2

Joshua Nelson (Jan 18 2021 at 21:57, on Zulip):

maybe you edited cargo.toml without restarting RA?

Joshua Nelson (Jan 18 2021 at 21:58, on Zulip):

I think RA doesn't support changes to cargo.toml while it's running yet

Jonas Schievink [he/him] (Jan 18 2021 at 21:58, on Zulip):

it does support that

Joshua Nelson (Jan 18 2021 at 21:58, on Zulip):

that has not been my experience

Joshua Nelson (Jan 18 2021 at 22:07, on Zulip):

opened https://github.com/rust-lang/cargo/issues/9085

Laurențiu (Jan 19 2021 at 07:56, on Zulip):

Joshua Nelson said:

that has not been my experience

It mostly works, but you need to restart it for new proc macros and build scripts to kick in

Jeremy Kolb (Jan 19 2021 at 15:03, on Zulip):

la_arena is also confusing cargo-outdatedhttps://github.com/kbknapp/cargo-outdated/issues/248

Last update: Jul 28 2021 at 05:15UTC