summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-21/+15
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-30Auto merge of #34541 - jseyfried:rollup, r=jseyfriedbors-16/+1
Rollup of 5 pull requests - Successful merges: #34105, #34305, #34512, ~~#34531,~~ #34547
2016-06-29Rollup merge of #34105 - ollie27:rustdoc_derived, r=alexcrichtonJeffrey Seyfried-16/+1
rustdoc: Remove Derived Implementations title As far as I know whether a trait was derived or not does not change the public API so there is no need to include this information in the docs. This title currently just adds an extra divide in the list of trait implementations which I don't think needs to be there.
2016-06-28rustdoc: Fix empty Implementations section on some module pagesOliver Middleton-0/+3
These are caused by `DefaultImpl`s.
2016-06-23rustdoc: Fix panic caused by doc(hidden) trait methodsOliver Middleton-10/+13
2016-06-20rustdoc: Fix a couple of issues with src links to external cratesOliver Middleton-6/+9
- src links/redirects to extern fn from another crate had an extra '/'. - src links to `pub use` of a crate module had an extra '/'. - src links to renamed reexports from another crate used the new name for the link but should use the original name.
2016-06-17Auto merge of #34292 - ollie27:rustdoc_depr_impl, r=GuillaumeGomezbors-17/+30
rustdoc: Add stability notices to impl items Also fixes missing stability notices on methods with no docs. For example [`f64::is_positive`](https://doc.rust-lang.org/nightly/std/primitive.f64.html#method.is_positive) is missing its deprecation message.
2016-06-15rustdoc: Add stability notices to impl itemsOliver Middleton-17/+30
Also fixes missing stability notices on methods with no docs.
2016-06-14Auto merge of #34245 - ollie27:rustdoc_redirect_rename, r=alexcrichtonbors-12/+10
rustdoc: Fix redirect pages for renamed reexports We need to use the name of the target not the name of the current item when creating the link. An example in `std` is [`std::sys::ext`](https://doc.rust-lang.org/nightly/std/sys/ext/index.html).
2016-06-14Auto merge of #34234 - GuillaumeGomez:bad_inlining, r=steveklabnikbors-2/+2
Fix invalid inlining r? @steveklabnik So to put a context. @nox found an issue on the generated doc: ![screenshot from 2016-06-11 19-53-38](https://cloud.githubusercontent.com/assets/3050060/15987898/f7341de0-303b-11e6-9cd7-f2a6df423ee7.png) So as you can see, the two variants are on the same where they shouldn't. I found out that the issue is also on structs: ![screenshot from 2016-06-11 19-53-31](https://cloud.githubusercontent.com/assets/3050060/15987900/0f66c5de-303c-11e6-90fc-5e49d11b6903.png) And so such is the result of the PR: ![screenshot from 2016-06-12 01-15-21](https://cloud.githubusercontent.com/assets/3050060/15987904/19d9183c-303c-11e6-91c1-7c3f1163fbb0.png) ![screenshot from 2016-06-12 01-15-24](https://cloud.githubusercontent.com/assets/3050060/15987905/1b5d2db0-303c-11e6-8f43-9a8ad2371007.png)
2016-06-14rustdoc: Fix redirect pages for renamed reexportsOliver Middleton-12/+10
We need to use the name of the target not the name of the current item when creating the link.
2016-06-12Auto merge of #34045 - ollie27:rustdoc_stripped, r=brsonbors-17/+24
rustdoc: Don't generate empty files for stripped items We need to traverse stripped modules to generate redirect pages, but we shouldn't generate anything else for them. This now renders the file contents to a Vec before writing it to a file in one go. I think that's probably a better strategy anyway. Fixes: #34025
2016-06-12Fix invalid inliningGuillaume Gomez-2/+2
2016-06-09Auto merge of #34108 - jseyfried:refactor_prelude_injection, r=nrcbors-1/+4
Refactor away the prelude injection fold Instead, just inject `#[prelude_import] use [core|std]::prelude::v1::*;` at the crate root while injecting `extern crate [core|std];` and process `#[no_implicit_prelude]` attributes in `resolve`. r? @nrc
2016-06-07Fix bug in `librustdoc` in which an unmatched "</table>" is emitted.Jeffrey Seyfried-1/+4
2016-06-05rustdoc: Remove Derived Implementations titleOliver Middleton-16/+1
As far as I know whether a trait was derived or not does not change the public API so there is no need to include this information in the docs. This title currently just adds an extra divide in the list of trait implementations which I don't think needs to be there.
2016-06-03rustdoc: Fix generating redirect pages for statics and constsOliver Middleton-1/+3
These were missing from the cache for some reason meaning the redirect pages failed to render.
2016-06-02rustdoc: Don't generate empty files for stripped itemsOliver Middleton-17/+24
We need to traverse stripped modules to generate redirect pages, but we shouldn't generate anything else for them. This now renders the file contents to a Vec before writing it to a file in one go. I think that's probably a better strategy anyway.
2016-05-30print enum variant fields in docsOliver Schneider-32/+37
2016-05-21Rollup merge of #33679 - Manishearth:rustdoc-readmore-impls, r=alexcrichtonManish Goregaokar-12/+43
rustdoc: Add doc snippets for trait impls, with a read more link The read more link only appears if the documentation is more than one line long. ![screenshot from 2016-05-17 06 54 14](https://cloud.githubusercontent.com/assets/1617736/15308544/4c2ba0ce-1bfc-11e6-9add-29de8dc7ac6e.png) It currently does not appear on non-defaulted methods, since you can document them directly. I could make it so that default documentation gets forwarded if regular docs don't exist. Fixes #33672 r? @alexcrichton cc @steveklabnik
2016-05-20Update testsManish Goregaokar-15/+17
2016-05-19Make the #[stable(since)] version attribute clearer with a tooltipRémy Rakic-2/+3
2016-05-18Move read more link to same lineManish Goregaokar-5/+6
2016-05-18rustdoc: Support short doc fallback for non-default itemsManish Goregaokar-9/+25
2016-05-18rustdoc: Add doc snippets for trait impls, with a read more linkManish Goregaokar-0/+12
Fixes #33672
2016-05-14Remove ExplicitSelf from HIRVadim Petrochenkov-36/+14
2016-05-10Improve "since" tag placementGuillaume Gomez-3/+3
2016-05-09Rollup merge of #33509 - birkenfeld:issue-30219, r=alexcrichtonManish Goregaokar-1/+1
rustdoc: fix emitting duplicate implementors in .js files The collect() fn checks for double quotes; use them here as well. Fixes: #30219
2016-05-09Rollup merge of #33431 - GuillaumeGomez:issue-30416, r=steveklabnikManish Goregaokar-3/+6
Update CSS for future rustdoc merge cc #33382 r? @steveklabnik cc @Manishearth cc @birkenfeld
2016-05-09rustdoc: fix emitting duplicate implementors in .js filesGeorg Brandl-1/+1
The collect() fn checks for double quotes; use them here as well. Fixes: #30219
2016-05-07Rollup merge of #33382 - birkenfeld:issue-30416, r=alexcrichtonSteve Klabnik-39/+59
rustdoc: add "src" links to individual impls Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined. NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good. Fixes: #30416
2016-05-06rustdoc: add "src" links to individual implsGeorg Brandl-39/+59
Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined. Fixes: #30416
2016-05-05Improve rustdoc css of "source" and "since" elementsggomez-3/+6
2016-05-03rustdoc: HTML-escape Rust code (from constants)Georg Brandl-2/+2
Especially in cases like the one in the test file, this can blow up the docs big time if string constants in the code contain HTML. But also other constants can contain special chars (e.g. `&` as an operator in constant expressions).
2016-04-27Auto merge of #33151 - ollie27:rustdoc_abi, r=alexcrichtonbors-6/+1
rustdoc: Cleanup ABI rendering Use a common method for rendering `extern "<abi>"`. This now consistently shows `extern fn` rather than `extern "C" fn`.
2016-04-26Auto merge of #33191 - alexcrichton:rustdoc-create-dir-all-racy, r=steveklabnikbors-6/+9
rustdoc: Handle concurrent mkdir requests It's likely that `rustdoc` as a tool is run concurrently in the same output (e.g. documenting multiple crates as Cargo does), in which case it needs to handle concurrent calls to `fs::create_dir`.
2016-04-26Rollup merge of #33196 - mitaa:rdoc-crate-links, r=alexcrichtonManish Goregaokar-2/+5
rustdoc: Linkify extern crates fixes #33178 r? @alexcrichton
2016-04-26Rollup merge of #33194 - mitaa:rdoc-a, r=alexcrichtonManish Goregaokar-2/+3
rustdoc: Improve accessibility of rustdoc pages fixes #33131 r? @alexcrichton
2016-04-26Rollup merge of #33160 - euclio:rustdoc-unstable-deprecated, r=alexcrichtonManish Goregaokar-29/+38
show unstable status for deprecated items Fixes #32374.
2016-04-25Linkify extern crates on rustdoc pagesmitaa-2/+5
2016-04-25Improve accessibility of rustdoc pagesmitaa-2/+3
2016-04-24rustdoc: Handle concurrent mkdir requestsAlex Crichton-6/+9
It's likely that `rustdoc` as a tool is run concurrently in the same output (e.g. documenting multiple crates as Cargo does), in which case it needs to handle concurrent calls to `fs::create_dir`.
2016-04-22show unstable status for deprecated itemsAndy Russell-29/+38
2016-04-22Only record the same impl oncemitaa-24/+38
Due to inlining it is possible to visit the same module multiple times during `<Cache as DocFolder>::fold_crate`, so we keep track of the modules we've already visited.
2016-04-22rustdoc: Cleanup ABI renderingOliver Middleton-6/+1
Use a common method for rendering `extern "<abi>"`. This now consistently shows `extern "C" fn` rather than just `extern fn`.
2016-04-19Auto merge of #33002 - mitaa:rdoc-cross-impls, r=alexcrichtonbors-21/+33
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
2016-04-19Auto merge of #32985 - caipre:rustdoc-disambiguate-impl-anchors, r=alexcrichtonbors-14/+26
rustdoc: Disambiguate anchors Closes https://github.com/rust-lang/rust/issues/32890
2016-04-18Rollup merge of #32558 - sanxiyn:rustdoc-self-link, r=steveklabnikSteve Klabnik-1/+4
Avoid linking to itself in implementors section of trait page Fix #32474.
2016-04-17rustdoc: Disambiguate anchors for assoc item implsNick Platt-14/+26
2016-04-18Reachability check cross-crate linksmitaa-4/+5