cognitive-engineering-lab / rustc_plugin

A framework for writing plugins that integrate with the Rust compiler
MIT License
135 stars 16 forks source link

Add sym link to `rust-toolchain.toml` to fix rust-analyzer errors #28

Closed FedericoBruzzone closed 2 months ago

FedericoBruzzone commented 2 months ago

rust-analyzer needs to have next to the Cargo.toml the rust-toolchain.toml file in order to semantically highlight the extern crate rustc_*.

willcrichton commented 2 months ago

I don't think this should be necessary? At least, if I open this workspace from the root using VSCode with Rust Analyzer, then rustc symbols seem to be found just fine in both crates.

FedericoBruzzone commented 2 months ago

You are right, if you open from the root you don't need to have it. Even in case you open after moving into this direcory; this is because rust-analyzer is smart enough to look in the parent directory looking for the rust-toolchain.

For my own reasons I took the crate and moved it to another directoy and obviously this mechanism does not work. In order to make the crate independent and have the exact version of the nighly it would be correct to have this sym link; moreover as in the rustc_plugin crate, although I don't think it was added for this reason but only for use in the build.rs.