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

rustdoc: refine cross-crate impl inlining #33002

Merged
merged 3 commits into from
Apr 19, 2016
Merged

Conversation

mitaa
Copy link
Contributor

@mitaa mitaa commented Apr 15, 2016

This changes the current rule that impls within doc(hidden) modules aren't inlined, to only inlining impls where the implemented trait and type are reachable in documentation.

fixes #14586
fixes #31948

.. and also applies the reachability checking to cross-crate links.

fixes #28480

r? @alexcrichton

The thread-local isn't needed and consists of mostly empty fields which
were just used to move the data into `html::render::CACHE_KEY`.
@mitaa mitaa force-pushed the rdoc-cross-impls branch 2 times, most recently from 78f29ce to 9589d72 Compare April 15, 2016 18:57
use ::visit_lib::LibEmbargoVisitor;
// FIXME: this is only partially correct for local items
// (we're reusing the access levels from crateanalysis,
// which does not considering `doc(hidden)`ness)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking more about this, this probably doesn't matter since an impl in an external crate can't reference a local type or trait (right??).

@mitaa mitaa force-pushed the rdoc-cross-impls branch from 9589d72 to 72b8fd6 Compare April 16, 2016 10:45
mitaa added 2 commits April 18, 2016 01:55
This changes the current rule that impls within `doc(hidden)` modules
aren't inlined, to only inlining impls where the implemented
trait and type are reachable in documentation.
@mitaa mitaa force-pushed the rdoc-cross-impls branch from 4ba8cf4 to 77b409a Compare April 17, 2016 23:56
@mitaa
Copy link
Contributor Author

mitaa commented Apr 18, 2016

Hmm, this probably doesn't yet fix this since this isn't related to inlining.

#![crate_type="lib"]

pub trait Bar {}

#[doc(hidden)]
pub mod hidden {
    pub struct Foo;
}

// impl shown in `foo::Bar`s implementors section (but without link)
impl Bar for hidden::Foo {}

edit: filed as #33069

@alexcrichton
Copy link
Member

@bors: r+ 77b409a

Holy cow, knocking out pre-15k bugs, nice!

@bors
Copy link
Contributor

bors commented Apr 19, 2016

⌛ Testing commit 77b409a with merge 478a33d...

bors added a commit that referenced this pull request Apr 19, 2016
rustdoc: refine cross-crate impl inlining

This changes the current rule that impls within `doc(hidden)` modules aren't inlined, to only inlining impls where the implemented trait and type are reachable in documentation.

fixes #14586
fixes #31948

.. and also applies the reachability checking to cross-crate links.

fixes #28480

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants