rustdoc icon indicating copy to clipboard operation
rustdoc copied to clipboard

Rustdoc only works on crates using the nightly compiler

Open mgattozzi opened this issue 8 years ago • 9 comments

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

mgattozzi avatar Aug 01 '17 13:08 mgattozzi

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.

mgattozzi avatar Aug 01 '17 17:08 mgattozzi

And if not we need to get this stabilized somehow in rustc because otherwise this is kind of useless to stable users.

mgattozzi avatar Aug 01 '17 18:08 mgattozzi

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.

steveklabnik avatar Aug 01 '17 18:08 steveklabnik

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.

mgattozzi avatar Aug 01 '17 18:08 mgattozzi

@nrc would know better about when rls-analysis is likely to be supported on stable.

steveklabnik avatar Aug 01 '17 18:08 steveklabnik

Awesome! :D Looking forward to that answer.

mgattozzi avatar Aug 01 '17 18:08 mgattozzi

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)

nrc avatar Aug 01 '17 20:08 nrc

Thanks for the reply @nrc!

mgattozzi avatar Aug 01 '17 21:08 mgattozzi

Small update here, rls-preview is now available on stable. But that's about it.

steveklabnik avatar Nov 28 '17 15:11 steveklabnik