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

Add trait alias support in rustdoc #58243

Merged
merged 4 commits into from
Feb 11, 2019

Conversation

GuillaumeGomez
Copy link
Member

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 6, 2019
Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

r=me

impl Clean<Item> for doctree::TraitAlias {
fn clean(&self, cx: &DocContext) -> Item {
let attrs = self.attrs.clean(cx);
let is_spotlight = attrs.has_doc_flag("spotlight");
Copy link
Member

Choose a reason for hiding this comment

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

We should check if spotlight actually works for trait impls using an aliased trait.

So, we should see what happens for:

#[doc(spotlight)]
trait Foo {}
trait Bar = Foo;
struct Ty;
impl Bar for Ty;

and

trait Foo {}
#[doc(spotlight)]
trait Bar = Foo;
struct Ty;
impl Bar for Ty;

Copy link
Member Author

Choose a reason for hiding this comment

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

You can't implement a trait alias directly. So I guess that spotlight doesn't make sense for a trait alias. I'll remove spotlight "support" for them.

@@ -1908,6 +1911,7 @@ impl fmt::Display for AllTypes {
print_entries(f, &self.derives, "Derive Macros", "derives")?;
print_entries(f, &self.functions, "Functions", "functions")?;
print_entries(f, &self.typedefs, "Typedefs", "typedefs")?;
print_entries(f, &self.trait_aliases, "Trait Aliases", "trait-alias")?;
Copy link
Member

Choose a reason for hiding this comment

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

trait-aliases, to be consistent.

(should there be a hyphen at all?)

Copy link
Member Author

@GuillaumeGomez GuillaumeGomez Feb 10, 2019

Choose a reason for hiding this comment

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

It's a css class so I guess it's fine (but I'll keep the hyphen :) )

Copy link
Member

Choose a reason for hiding this comment

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

It's nice to be consistent, also: y'all have theming support so the css classes do matter, if only a little bit

@GuillaumeGomez
Copy link
Member Author

Updated.

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 10, 2019

📌 Commit b1d82ac has been approved by Manishearth

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2019
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 10, 2019
bors added a commit that referenced this pull request Feb 10, 2019
Rollup of 16 pull requests

Successful merges:

 - #57259 (Update reference of rlibc crate to compiler-builtins crate)
 - #57740 (Use `to_ne_bytes` for converting IPv4Addr to octets)
 - #57926 (Tiny expansion to docs for `core::convert`.)
 - #58157 (Add Cargo.lock automatically adding message)
 - #58203 (rustdoc: display sugared return types for async functions)
 - #58243 (Add trait alias support in rustdoc)
 - #58262 (Add #[must_use] message to Fn* traits)
 - #58295 (std::sys::unix::stdio: explain why we do into_raw)
 - #58297 (Cleanup JS a bit)
 - #58317 (Some writing improvement, conciseness of intro)
 - #58324 (miri: give non-generic functions a stable address)
 - #58332 (operand-to-place copies should never be overlapping)
 - #58345 (When there are multiple filenames, print what got interpreted as filenames)
 - #58346 (rpath computation: explain why we pop())
 - #58350 (Fix failing tidy (line endings on Windows))
 - #58352 (miri value visitor: use `?` in macro)

Failed merges:

r? @ghost
@bors bors merged commit b1d82ac into rust-lang:master Feb 11, 2019
@GuillaumeGomez GuillaumeGomez deleted the trait-alias-docs branch February 11, 2019 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants