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
Closed

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

jdm opened this issue Jul 20, 2017 · 13 comments
Assignees
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@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 Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jul 20, 2017
@jdm
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 jdm added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Jul 20, 2017
@jdm
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
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
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
Copy link
Contributor Author

jdm commented Jul 20, 2017

My money is on #40939.

@jdm jdm added regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Jul 20, 2017
@alexcrichton
Copy link
Member

cc @jseyfried, @nrc

@nrc
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
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 Mark-Simulacrum added I-nominated P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 27, 2017
@Mark-Simulacrum
Copy link
Member

Nominating; needs investigation and a fix.

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 28, 2017
@nrc
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
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
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 as completed Jul 28, 2017
@Aceeri
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
Labels
C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants