racer-rust / racer

Rust Code Completion utility
MIT License
3.36k stars 278 forks source link

Use rustc_private and bump nightly #1174

Closed flip1995 closed 2 years ago

flip1995 commented 2 years ago

This moves away from the rustc-ap crates and uses rustc-dev instead. It also bumps this crate to use the latest nightly.

I just experimented with this. Since the diff was so small, I decided to submit it as a PR. Feel free to close this, if you don't want to do this.

This would help with rust-lang/rust#91543

calebcartwright commented 2 years ago

If we were to go this route (and fwiw I'd like to see this change too) I think it might be helpful to update the top of the readme file and/or installation section to detail the extra requirements.

There's historically been duplicative issues (e.g. #1173) with folks attempting to install from crates.io using an unsupported toolchain, so I think emphasizing that in documentation along with the newly required rustc-dev component would be helpful.

One thing we heard after making the same switch in rustfmt is that the rustc-dev component isn't available for every target which was problematic for at least one case where someone was attempting to consume rustfmt as a lib. I doubt that'll be a problem here though given the nature of racer

flip1995 commented 2 years ago

I can adapt the documentation, if this should move forward.

One thing we heard after making the same switch in rustfmt is that the rustc-dev component isn't available for every target

Oh, we didn't hear anything like that in Clippy :thinking: Going through the components history, it is available on ever Tier 1 target and by random clicking on Tier 2 targets it is also available on every Tier 2 target, where also tools like rustfmt, clippy, ... are available. So I'm not that concerned here.

calebcartwright commented 2 years ago

I think someone was trying to use rustfmt in a wasm context perhaps? Can't recall the exact specifics but there was some edge case that was surfaced to us

flip1995 commented 2 years ago

Ok, I've updated the README with a note that rustc-dev has to be installed to compile Racer.

I'm not that concerned, that something like this will happen to Racer. Especially since it has a note that it is not actively maintaineddeveloped.

calebcartwright commented 2 years ago

@kngwyu what are your thoughts on this? The impacts of the current AP versions are starting to snowball, so think we'll either need to go this route or at least get the AP crate versions bumped

flip1995 commented 2 years ago

Should I bump this PR to the latest nightly before merging? Is anything missing, before this can get merged?

Xanewok commented 2 years ago

@flip1995 if that would not be a problem, please update to the newest nightly; I'll merge this immediately after. Thanks for all the work here!

flip1995 commented 2 years ago

@Xanewok Just required a rust-toolchain.toml bump and a Cargo.lock update.

I can also do the RLS update once a new Racer version is released :+1:

flip1995 commented 2 years ago

@Xanewok not sure if you're already at it, but are you planning to bump the Racer version soon, so that we can update Racer in RLS?