Skip to content

I can't build rust-code-analysis by tree-sitter version conflicts with tree-sitter-rust #1083

Description

@pponaldo

When I build the code, I can't build it with the following error: There is a version conflict between the dependencies, is there anything you are checking for this?

|
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
    |
   ::: /Users/jbpark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rust-code-analysis-0.0.25/src/langs.rs:8:1
    |
8   | / mk_langs!(
9   | |     // 1) Name for enum
10  | |     // 2) Language description
11  | |     // 3) Display name
...   |
116 | |     )
117 | | );
    | |_- in this macro invocation
    |
    = note: `tree_sitter::Language` and `tree_sitter::Language` have similar names, but are actually distinct types
note: `tree_sitter::Language` is defined in crate `tree_sitter`
   --> /Users/jbpark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tree-sitter-0.22.2/binding_rust/lib.rs:56:1
    |
56  | pub struct Language(*const ffi::TSLanguage);
    | ^^^^^^^^^^^^^^^^^^^
note: `tree_sitter::Language` is defined in crate `tree_sitter`
   --> /Users/jbpark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tree-sitter-0.20.9/binding_rust/lib.rs:43:1
    |
43  | pub struct Language(*const ffi::TSLanguage);
    | ^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `tree_sitter` are being used?
    = 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

Activity

  1. jayvdb commented on May 18, 2024

    @jayvdb
    Contributor

    #1086 fixes the problem.

  2. aytey commented on Jul 23, 2024

    @aytey

    #1086 fixes the problem.

    Yep, I just had this failure and rebasing (and then building) update-grammars from @alexle0nte built and all tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions