cargo install rust-code-analysis-cli does not compile

Offen
#1,140 4 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
rust

Rechercherichtung

Start by reproducing the reported cargo install rust-code-analysis-cli failure and inspect the dependency tree for the conflicting tree-sitter versions, especially the dependencies named in the compiler log. The issue gives a concrete failure and affected platforms; done means the CLI installs successfully with the reported Cargo version on Linux and Windows.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Hello,

Installation via cargo of rust-code-analysis-cli failed in Linux and Windows with cargo 1.85.0.
Log:

cargo install rust-code-analysis-cli
error[E0308]: mismatched types
   --> ~\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\rust-code-analysis-0.0.25\src\macros.rs:42:9
    |
42  |           $name::language()
    |           ^^^^^^^^^^^^^^^^^ expected `tree_sitter::Language`, found a different `tree_sitter::Language`
...
264 |                   fn get_language() -> Language {
    |                                        -------- expected `tree_sitter::Language` because of return type
    |
   ::: ~\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\rust-code-analysis-0.0.25\src\langs.rs:8:1
    |
8   | / mk_langs!(
...   |
117 | | );
    | |_- in this macro invocation
    |
note: two different versions of crate `tree_sitter` are being used; two types coming from two different versions of the same crate are different types even if they look the same
   --> ~\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\tree-sitter-0.20.9\binding_rust\lib.rs:43:1
    |
43  | pub struct Language(*const ffi::TSLanguage);
    | ^^^^^^^^^^^^^^^^^^^ this is the expected type `tree_sitter::Language`
    |
   ::: ~\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\tree-sitter-0.25.3\binding_rust\lib.rs:63:1
    |
63  | pub struct Language(*const ffi::TSLanguage);
    | ^^^^^^^^^^^^^^^^^^^ this is the found type `tree_sitter::Language`
    |
   ::: ~\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\rust-code-analysis-0.0.25\src\node.rs:1:5
    |
1   | use tree_sitter::Node as OtherNode;
    |     ----------- one version of crate `tree_sitter` used here, as a direct dependency of the current crate
    |
   ::: ~\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\rust-code-analysis-0.0.25\src\langs.rs:53:9
    |
53  |         tree_sitter_rust,
    |         ---------------- one version of crate `tree_sitter` used here, as a dependency of crate `tree_sitter_rust`
    = help: you can use `cargo tree` to explore your dependency tree
    = note: this error originates in the macro `get_language` which comes from the expansion of the macro `mk_langs` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0308`.
error: could not compile `rust-code-analysis` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `rust-code-analysis-cli v0.0.25`, intermediate artifacts can be found at `~\AppData\Local\Temp\cargo-installNWcqlt`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Related: https://github.com/mozilla/rust-code-analysis/issues/714

Thanks,

Vorherrschende Sprache
Rust
Sterne
469
Forks
74
Ø Merge
17 Std. 16 Min.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus mozilla/rust-code-analysis

Alle Issues in mozilla/rust-code-analysis

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.