Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source is missing from docs for crates that use a procedural macro #43371

Closed
jdm opened this Issue Jul 20, 2017 · 13 comments

Comments

Projects
None yet
7 participants
@jdm
Copy link
Contributor

jdm commented Jul 20, 2017

Running ./mach doc on Servo's codebase yields a bunch of crates with the following warning:

warning: source code was requested to be rendered, but processing `<proc-macro source code>` had an error: No such file or directory (os error 2)
         skipping rendering of source code

This means that the source is available for some types, but not others.

I'll try to figure out when this regressed.

@jdm jdm added the T-rustdoc label Jul 20, 2017

@jdm

This comment has been minimized.

Copy link
Contributor Author

jdm commented Jul 20, 2017

Minimal reproduction:

extern crate heapsize;
#[macro_use] extern crate heapsize_derive;

#[derive(HeapSizeOf)]
pub struct Range;
[package]
name = "foo"
version = "0.1.0"
authors = ["Josh Matthews <josh@joshmatthews.net>"]

[dependencies]
heapsize = "0.4"
heapsize_derive = "0.1"

If I remove the pub or HeapSizeOf derivation then it works fine.

@jdm

This comment has been minimized.

Copy link
Contributor Author

jdm commented Jul 20, 2017

If I use cargo +beta doc --open then it works fine; cargo +nightly doc --open is broken.

@jdm

This comment has been minimized.

Copy link
Contributor Author

jdm commented Jul 20, 2017

godot:foo jdm$ cargo --version
cargo 0.21.0-nightly (eb6cf012a 2017-07-02)
godot:foo jdm$ rustc --version
rustc 1.20.0-nightly (b2c070787 2017-07-13)
@jdm

This comment has been minimized.

Copy link
Contributor Author

jdm commented Jul 20, 2017

The 7/6 nightly (3610a70) works fine, and the 7/7 nightly (696412d) is broken.

@jdm

This comment has been minimized.

Copy link
Contributor Author

jdm commented Jul 20, 2017

My money is on #40939.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 23, 2017

@nrc

This comment has been minimized.

Copy link
Member

nrc commented Jul 25, 2017

I believe the issue is that (since #40939) we no longer accurately track expansion info for names declared in a macro. That means that tools think some names are hand-written, when they are macro generated (this is also causing problems for the RLS). #43179 was meant to fix this, but it did not (at least not for all cases). I haven't looked into the details.

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Jul 25, 2017

Not just names. Clippy gets confused by the true or false inside the expansion of cfg!: #43268

@Mark-Simulacrum

This comment has been minimized.

Copy link
Member

Mark-Simulacrum commented Jul 27, 2017

Nominating; needs investigation and a fix.

@nrc

This comment has been minimized.

Copy link
Member

nrc commented Jul 28, 2017

This might get fixed by #43230, although perhaps not (the example here is a 1.1 custom derive, but looking at 43230 I'm not sure if the filename makes sense, so I'm not convinced I know what it going on 100%)

@nrc

This comment has been minimized.

Copy link
Member

nrc commented Jul 28, 2017

I can't reproduce the bug in the reduced example with today's nightly (perhaps it was fixed by #43179). @jdm can you still repro?

@nrc

This comment has been minimized.

Copy link
Member

nrc commented Jul 28, 2017

And the link to https://doc.servo.org/script/script_thread/struct.ScriptThread.html works. So I think this is fixed. @jdm please re-open if not.

@nrc nrc closed this Jul 28, 2017

@Aceeri

This comment has been minimized.

Copy link

Aceeri commented Sep 9, 2017

I'm receiving this error when trying to run rustdoc here: https://travis-ci.org/amethyst/website#L935

I'm unable to reproduce locally, but others on macos/linux have been able to. Unsure if this is related to this or not however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.