willcrichton / flowistry

Flowistry is an IDE plugin for Rust that helps you focus on relevant code.
https://marketplace.visualstudio.com/items?itemName=wcrichton.flowistry
MIT License
1.91k stars 45 forks source link

Build fails when adding flowistry as dependency #70

Closed momvart closed 1 year ago

momvart commented 1 year ago

I'm trying to use flowistry as a rustc plugin. However, when building the project, it gives lots of compile errors regarding building flowistry. It looks like it is a configuration problem but I'm not sure whether it is on my side or the published crate.

An example of errors:

   Compiling flowistry v0.5.35
error: expected `const`
  --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flowistry-0.5.35/src/indexed/impls.rs:54:7
   |
54 |       DEBUG_FORMAT = "l{}"
   |       ^^^^^^^^^^^^

error: expected `const`
  --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flowistry-0.5.35/src/indexed/impls.rs:83:7
   |
83 |       DEBUG_FORMAT = "f{}"
   |       ^^^^^^^^^^^^

error: expected `const`
   --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flowistry-0.5.35/src/mir/aliases.rs:164:7
    |
164 |       DEBUG_FORMAT = "rs{}"
    |       ^^^^^^^^^^^^

error[E0432]: unresolved import `crate::indexed::impls::LocationOrArgIndex`
  --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flowistry-0.5.35/src/mir/aliases.rs:34:55
   |
34 |       build_location_arg_domain, LocationOrArgDomain, LocationOrArgIndex, PlaceSet,
   |                                                       ^^^^^^^^^^^^^^^^^^
   |                                                       |
   |                                                       no `LocationOrArgIndex` in `indexed::impls`
   |                                                       help: a similar name exists in the module: `LocationOrArgSet`

My Cargo.toml:

[package]
name = "flowistry_pg"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
flowistry = "0.5.35"

[package.metadata.rust-analyzer]
rustc_private = true

rust-toolchain.toml:

[toolchain]
channel = "nightly-2023-04-12"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
willcrichton commented 1 year ago

Make sure to check out the Github tag corresponding to the release: https://github.com/willcrichton/flowistry/tree/v0.5.35

The latest published Flowistry (0.5.35) is still on nightly-2022-12-07, so you'll need to use that for now. I'll release 0.6.0 soon.

momvart commented 1 year ago

Oh, my bad. You're right. I was looking at master which is using a newer version of Rust.

Thanks.