Skip to content

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

Closed

Description

@jdm

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.

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Jul 20, 2017
  2. jdm commented on Jul 20, 2017

    @jdm
    ContributorAuthor

    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.

  3. jdm commented on Jul 20, 2017

    @jdm
    ContributorAuthor

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

  4. jdm commented on Jul 20, 2017

    @jdm
    ContributorAuthor
    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)
    
  5. jdm commented on Jul 20, 2017

    @jdm
    ContributorAuthor

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

  6. jdm commented on Jul 20, 2017

    @jdm
    ContributorAuthor

    My money is on #40939.

  7. added and removed on Jul 20, 2017
  8. alexcrichton commented on Jul 23, 2017

    @alexcrichton
    Member
  9. nrc commented on Jul 25, 2017

    @nrc
    Member

    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.

  10. oli-obk commented on Jul 25, 2017

    @oli-obk
    Contributor

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

  11. added
    P-highHigh priority
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jul 27, 2017
  12. Mark-Simulacrum commented on Jul 27, 2017

    @Mark-Simulacrum
    Member

    Nominating; needs investigation and a fix.

  13. nrc commented on Jul 28, 2017

    @nrc
    Member

    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%)

  14. nrc commented on Jul 28, 2017

    @nrc
    Member

    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?

  15. nrc commented on Jul 28, 2017

    @nrc
    Member

    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.

  16. Aceeri commented on Sep 9, 2017

    @Aceeri

    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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions