Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error: mismatched types #10

Open
diocletiann opened this issue Mar 5, 2024 · 5 comments
Open

Compilation error: mismatched types #10

diocletiann opened this issue Mar 5, 2024 · 5 comments

Comments

@diocletiann
Copy link

Compiling syntastica-parsers v0.4.1
error[E0308]: mismatched types
  --> /Users/xxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syntastica-parsers-0.4.1/src/lib.rs:11:1
   |
11 | syntastica_macros::parsers_dep!();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | expected `syntastica_core::language_set::Language`, found `tree_sitter::Language`
   | expected `syntastica_core::language_set::Language` because of return type
   |
   = note: `tree_sitter::Language` and `syntastica_core::language_set::Language` have similar names, but are actually distinct types
note: `tree_sitter::Language` is defined in crate `tree_sitter`
  --> /Users/xxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tree-sitter-0.21.0/binding_rust/lib.rs:54:1
   |
54 | pub struct Language(*const ffi::TSLanguage);
   | ^^^^^^^^^^^^^^^^^^^
note: `syntastica_core::language_set::Language` is defined in crate `tree_sitter`
  --> /Users/xxx/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tree-sitter-0.20.10/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 `syntastica_macros::parsers_dep` (in Nightly builds, run with -Z macro-backtrace for more info)
@RubixDev
Copy link
Owner

RubixDev commented Mar 5, 2024

note: perhaps two different versions of crate tree_sitter are being used?

this is exactly the case. syntastica is expecting tree-sitter v0.20.10 everywhere, but somewhere in the dependencies v0.21.0 is pulled in and used. Could you please see if you can find where and why this happens? cargo tree might be useful for that

@diocletiann
Copy link
Author

Thanks for the quick reply. Looks like tree-sitter-css v0.19.0 and tree-sitter-rust v0.20.3 are pulling in tree-sitter v0.21.0.

@RubixDev
Copy link
Owner

RubixDev commented Mar 5, 2024

That's curious. Both of them depend on ~0.20.10 just like syntastica. Can you maybe just post your full cargo tree output here?

Also if it's feasible for you i'd recommend using syntastica-parsers-git instead of syntastica-parsers as it shouldn't have those issues and also supports more languages. You can read about the advantages and drawbacks here.

@diocletiann
Copy link
Author

syntastica-parsers-git works, thanks!

Here's the relevant cargo-tree output with syntastica-parsers:

── syntastica-parsers v0.4.1
│   ├── once_cell v1.19.0
│   ├── strum v0.25.0 (*)
│   ├── syntastica-core v0.4.1 (*)
│   ├── syntastica-macros v0.4.1 (proc-macro)
│   │   ├── heck v0.4.1
│   │   ├── once_cell v1.19.0
│   │   ├── proc-macro2 v1.0.78 (*)
│   │   ├── quote v1.0.35 (*)
│   │   ├── quote-use v0.7.2
│   │   │   ├── quote v1.0.35 (*)
│   │   │   ├── quote-use-macros v0.7.2 (proc-macro)
│   │   │   │   ├── derive-where v1.2.7 (proc-macro)
│   │   │   │   │   ├── proc-macro2 v1.0.78 (*)
│   │   │   │   │   ├── quote v1.0.35 (*)
│   │   │   │   │   └── syn v2.0.52 (*)
│   │   │   │   ├── proc-macro2 v1.0.78 (*)
│   │   │   │   ├── quote v1.0.35 (*)
│   │   │   │   └── syn v2.0.52 (*)
│   │   │   └── syn v2.0.52 (*)
│   │   ├── serde v1.0.197
│   │   │   └── serde_derive v1.0.197 (proc-macro)
│   │   │       ├── proc-macro2 v1.0.78 (*)
│   │   │       ├── quote v1.0.35 (*)
│   │   │       └── syn v2.0.52 (*)
│   │   ├── tft v0.1.1
│   │   │   ├── casey v0.4.0 (proc-macro) (*)
│   │   │   ├── serde v1.0.197 (*)
│   │   │   ├── serde_with v3.6.1
│   │   │   │   ├── serde v1.0.197 (*)
│   │   │   │   ├── serde_derive v1.0.197 (proc-macro) (*)
│   │   │   │   └── serde_with_macros v3.6.1 (proc-macro)
│   │   │   │       ├── darling v0.20.8
│   │   │   │       │   ├── darling_core v0.20.8
│   │   │   │       │   │   ├── fnv v1.0.7
│   │   │   │       │   │   ├── ident_case v1.0.1
│   │   │   │       │   │   ├── proc-macro2 v1.0.78 (*)
│   │   │   │       │   │   ├── quote v1.0.35 (*)
│   │   │   │       │   │   ├── strsim v0.10.0
│   │   │   │       │   │   └── syn v2.0.52 (*)
│   │   │   │       │   └── darling_macro v0.20.8 (proc-macro)
│   │   │   │       │       ├── darling_core v0.20.8 (*)
│   │   │   │       │       ├── quote v1.0.35 (*)
│   │   │   │       │       └── syn v2.0.52 (*)
│   │   │   │       ├── proc-macro2 v1.0.78 (*)
│   │   │   │       ├── quote v1.0.35 (*)
│   │   │   │       └── syn v2.0.52 (*)
│   │   │   └── strum v0.25.0 (*)
│   │   └── toml v0.7.8
│   │       ├── serde v1.0.197 (*)
│   │       ├── serde_spanned v0.6.5
│   │       │   └── serde v1.0.197 (*)
│   │       ├── toml_datetime v0.6.5
│   │       │   └── serde v1.0.197 (*)
│   │       └── toml_edit v0.19.15
│   │           ├── indexmap v2.2.5 (*)
│   │           ├── serde v1.0.197 (*)
│   │           ├── serde_spanned v0.6.5 (*)
│   │           ├── toml_datetime v0.6.5 (*)
│   │           └── winnow v0.5.40
│   ├── syntastica-queries v0.4.1
│   ├── tree-sitter-c v0.20.4
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-cpp v0.20.2
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-css v0.19.0
│   │   └── tree-sitter v0.21.0
│   │       └── regex v1.10.3 (*)
│   │       [build-dependencies]
│   │       └── cc v1.0.89
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-go v0.20.0
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-java v0.20.0
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-javascript v0.20.0
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-json v0.19.0
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-lua v0.0.18
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-python v0.20.3
│   │   └── tree-sitter v0.20.10 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   ├── tree-sitter-rust v0.20.3
│   │   └── tree-sitter v0.21.0 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.89
│   └── tree-sitter-toml v0.20.0
│       └── tree-sitter v0.20.10 (*)
│       [build-dependencies]
│       └── cc v1.0.89

@RubixDev
Copy link
Owner

RubixDev commented Mar 5, 2024

syntastica-parsers-git works, thanks!

That's good to hear

Here's the relevant cargo-tree output with syntastica-parsers

Very curios indeed. I'll leave this issue open so I can investigate what's going on here once I eventually get back to working on syntastica

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants