Rustdoc only works on crates using the nightly compiler
I tried running this on my stable crate github-rs and it failed becausse it couldn't generate the analysis. The reason is because we use the -Z option to pass in to cargo. This option now only works on nightly. However, with rustup that directory is set to stable rust so the version of cargo called there is the stable version which doesn't work with -Z causing the failure.
EDIT:
- Tracking Issue: https://github.com/rust-lang/rust/issues/43606
- Using cargo directly is not the best thing to do
- We just need to wait on the save analysis feature being stabilized at some point
I think the solution is to use cargo as dependency like RLS and just invoke the build as a Rust function to bypass this issue. I'll experiment with this.
And if not we need to get this stabilized somehow in rustc because otherwise this is kind of useless to stable users.
If we use cargo as a dep, then we're tied to that exact version of Cargo...
And if not we need to get this stabilized somehow in rustc
There's plans in place for this, it's going to be a while though.
If it's going to be a while it seems counter to the whole impl period which says that it wants to get:
New rustdoc at parity with existing rustdoc, and starting to explore new design space
I would think this is a huge blocker to that goal.
@nrc would know better about when rls-analysis is likely to be supported on stable.
Awesome! :D Looking forward to that answer.
I think the solution is to use cargo as dependency like RLS
I think you would need to link the compiler too and copy the machinery in the RLS for actually using all that stuff. I would not recommend doing this.
@nrc would know better about when rls-analysis is likely to be supported on stable.
RLS is meant to be riding the trains this cycle but is blocked on some implementation effort (by me).
There is also the question of stabilising -Zsave-analysis. The idea has been tossed around a little bit, but I haven't started a formal discussion (I'll do that today - we need this for the RLS too)
Thanks for the reply @nrc!
Small update here, rls-preview is now available on stable. But that's about it.