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

Locking flowistry to a specific toolchain can cause it to fail if the project uses a newer toolchain #60

Closed danheuck closed 2 years ago

danheuck commented 2 years ago

Flowistry is currently failing for my project with a lot of errors that look like this because one of my dependencies uses generic associated types extensively:

error[E0658]: generic associated types are unstable
  --> /Users/Daniel/.cargo/registry/src/github.com-1ecc6299db9ec823/embedded-hal-async-0.1.0-alpha.3/src/delay.rs:11:5
   |
11 | /     type DelayUsFuture<'a>: Future<Output = Result<(), Self::Error>>
12 | |     where
13 | |         Self: 'a;
   | |_________________^
   |
   = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
   = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable

It seems that flowistry is using the nightly toolchain from 2022-09-12 and generic associated types were stabilized (in nightly) on 2022-09-13. This is obviously a very specific issue, but it seems like a symptom of a problem that could come up quite frequently in any project using a nightly toolchain.

It seems like flowistry currently uses its own toolchain to make it compatible with projects using a stable toolchain (#2). If that's the only reason, is it possible to detect when a project is already using the nightly toolchain so that the same toolchain can be used by flowistry?

willcrichton commented 2 years ago

The issue is more that Flowistry has to pin to a specific toolchain, because it uses the Rust compiler API. That API changes frequently, so I usually have to do manual codebase patches every time I change the toolchain.

Honestly, the only solution right now is I should just set a reminder to bump the Flowistry version a few days before a Rust stable release happens.

Regardless, I just bumped the Flowistry toolchain version and release v0.5.31. Should fix your issue in a few hours.