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

Compatibility with stable rustc #2

Closed willcrichton closed 3 years ago

willcrichton commented 3 years ago

Flowistry should work with projects using stable, not just nightly. It seems like there are two ways to do this:

1) Become a component, like Clippy 2) Reimplement the compiler, like rust-analyzer

(2) would be too much work. We could become a rust-analyzer plugin, but this would require RA to support borrow checking / MIR, and right now they only lower to HIR.

(1) would be ideal, but would probably require a lot of buy-in from the community? Not sure what the threshold is for becoming a component.

A third option would be to mimic being a component by releasing with the specific nightly used to compile stable releases. I think? Not sure if any tools take this approach or how viable it is.

vakaras commented 3 years ago

In Prusti, we let the VS Code plugin handle the Rustc version. Basically, it works as follows:

  1. We publish Prusti binaries as GitHub release with information which Rust nightly was used.
  2. VS Code plugin has a command “Install/Update dependencies”, which queries GitHub to figure out which is the latest release, downloads it, and sets up to call cargo with +nightly-<the specific version of nightly that matches the Prusti binary>.

Maybe, something like this would also work for you?

willcrichton commented 3 years ago

Thanks for the info @vakaras! With that strategy, you would end up with two copies of your project in target -- one for the default toolchain, and one for the Prusti toolchain, is that right?

vakaras commented 3 years ago

I actually do not know because Prusti stops the compilation before it produces any artefacts.

willcrichton commented 3 years ago

Right, this would mainly be .rmeta files for dependencies of the project. Which I suppose wouldn't be too bad? I'll definitely explore this option.