summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
AgeCommit message (Collapse)AuthorLines
2016-10-11Rollup merge of #36679 - QuietMisdreavus:rustdoc-line-breaks, r=steveklabnikGuillaume Gomez-100/+318
rustdoc: print non-self arguments of bare functions and struct methods on their own line This change alters the formatting rustdoc uses when it creates function and struct method documentation. For bare functions, each argument is printed on its own line. For struct methods, non-self arguments are printed on their own line. In both cases, no line breaks are introduced if there are no arguments, and for struct methods, no line breaks are introduced if there is only a single self argument. This should aid readability of long function signatures and allow for greater comprehension of these functions. I've run rustdoc with these changes on my crate egg-mode and its set of dependencies and put the result [on my server](https://shiva.icesoldier.me/doc-custom/egg_mode/). Of note, here are a few shortcut links that highlight the changes: * [Bare function with a long signature](https://shiva.icesoldier.me/doc-custom/egg_mode/place/fn.reverse_geocode.html) * [Struct methods, with single self argument and with self and non-self arguments](https://shiva.icesoldier.me/doc-custom/egg_mode/tweet/struct.Timeline.html#method.reset) * [Bare functions with no arguments](https://shiva.icesoldier.me/doc-custom/rand/fn.thread_rng.html) and [struct methods with no arguments](https://shiva.icesoldier.me/doc-custom/hyper/client/struct.Client.html#method.new) are left unchanged. This PR consists of two commits: one for bare functions and one for struct methods.
2016-10-02Remove redundant 'Import' in variant names, stop reexporting.Corey Farwell-3/+3
2016-10-02Rename method 'to_string' to match conventions.Corey Farwell-1/+1
2016-09-26rustdoc: fix regression when printing single-element tuplesQuietMisdreavus-1/+1
2016-09-26rustdoc: format bare functions like rustfmtQuietMisdreavus-24/+29
see commit 2a274e72 for details
2016-09-26rustdoc: format struct methods like rustfmtQuietMisdreavus-99/+304
* ignore signatures 80 characters or shorter * otherwise, put arguments and return arrow on their own line, indented to the opening parenthesis in doing this, most of a plain-text output has been written for rustdoc, accessible through "alternate" Display printing: "{:#}"
2016-09-23rustdoc: format non-self arguments for struct methods on their own lineQuietMisdreavus-1/+5
2016-09-23rustdoc: print arguments to bare functions on their own lineQuietMisdreavus-1/+5
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-2/+1
2016-08-24Remove unnecessary 'Primitive' prefix on `PrimitiveType` enum variants.Corey Farwell-7/+7
2016-08-24Stop reexporting `PrimitiveType` enum in librustdoc.Corey Farwell-13/+14
2016-08-17Auto merge of #35236 - nrc:rustdoc-redirects, r=@alexcrichtonbors-1/+1
rustdoc: redirect URLs cc #35020 which does this properly r? @alexcrichton
2016-08-17rustdoc: refactoring and tidying upNick Cameron-1/+1
pulled out of #35020
2016-08-13Rename empty/bang to neverAndrew Cann-1/+1
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Remove obsolete divergence related stuffAndrew Cann-1/+0
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-12syntax: add anonymized type syntax, i.e. impl TraitA+TraitB.Eduard Burtescu-0/+10
2016-07-12rustdoc: Fix methods in seach resultsOliver Middleton-22/+19
Currently methods from extern crates are sometimes added to the search index when they shouldn't be or added with the original path rather than the reexported path. This fixes that by making sure `cache().paths` only contains local paths like the description for it states. It also fixes a few minor issues with link rendering and redirect generation which would point to local crate docs even if the docs for that crate hadn't been generated. Also a bug with methods implemented on traits which caused wrong paths and so dead links in the search results has been fixed.
2016-07-06rustc: Update stage0 to beta-2016-07-06Alex Crichton-2/+1
Hot off the presses, let's update our stage0 compiler!
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-12/+8
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-09fix damage in librustcAriel Ben-Yehuda-3/+4
2016-05-30print enum variant fields in docsOliver Schneider-8/+8
2016-05-15Auto merge of #33505 - petrochenkov:self, r=nrcbors-20/+22
Remove ExplicitSelf from HIR `self` argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication. The same changes can be applied to AST, I'll make them in the next breaking batch. The first commit also improves parsing of method declarations and fixes https://github.com/rust-lang/rust/issues/33413. r? @eddyb
2016-05-14Remove ExplicitSelf from HIRVadim Petrochenkov-20/+22
2016-05-12rustdoc: Fix missing type parameters on implsOliver Middleton-1/+7
2016-05-03rustdoc: HTML-escape Rust code (from constants)Georg Brandl-1/+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/+2
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-27rustdoc: Render `extern fn` instead of `extern "C" fn`Oliver Middleton-0/+1
2016-04-26Rollup merge of #33196 - mitaa:rdoc-crate-links, r=alexcrichtonManish Goregaokar-9/+24
rustdoc: Linkify extern crates fixes #33178 r? @alexcrichton
2016-04-25Linkify extern crates on rustdoc pagesmitaa-9/+24
2016-04-24Check reachability for inlined extern links toomitaa-3/+5
An item is inlined and recorded as inlined even if it is `doc(hidden)`, leading to unchecked external links.
2016-04-22rustdoc: Cleanup ABI renderingOliver Middleton-7/+2
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-0/+4
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-18Rollup merge of #32558 - sanxiyn:rustdoc-self-link, r=steveklabnikSteve Klabnik-9/+23
Avoid linking to itself in implementors section of trait page Fix #32474.
2016-04-18Reachability check cross-crate linksmitaa-0/+4
2016-04-14Fix fallout in rustdocJeffrey Seyfried-4/+4
2016-04-07Make `hir::Visibility` non-copyable and add `ty::Visibility`Jeffrey Seyfried-6/+6
2016-04-06rustc: move middle::{def,def_id,pat_util} to hir.Eduard Burtescu-1/+1
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-1/+1
2016-03-29Avoid linking to itself in implementors section of trait pageSeo Sanghyeon-9/+23
2016-03-22fix alignmentJorge Aparicio-14/+13
2016-03-22try! -> ?Jorge Aparicio-93/+93
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-01-28rustdoc: Add missing trailing comma for single element tuplesOliver Middleton-1/+1
2016-01-23Handle generics in raw pointersManish Goregaokar-3/+11
2016-01-22Correctly output links for primitive types which enclose their contentsManish Goregaokar-9/+22
2015-11-26fix tests & rustdocAriel Ben-Yehuda-1/+1
2015-10-23Add colors for rustdoc primitives, type, and macros linksmdinger-2/+2
2015-10-01Convert DefId to use DefIndex, which is an index into a list ofNiko Matsakis-3/+2
paths, and construct paths for all definitions. Also, stop rewriting DefIds for closures, and instead just load the closure data from the original def-id, which may be in another crate.
2015-10-01move direct accesses of `node` to go through `as_local_node_id`, unlessNiko Matsakis-1/+1
they are being used as an opaque "position identifier"
2015-10-01move LOCAL_CRATE to cstoreNiko Matsakis-1/+2
2015-09-03Add an intital HIR and lowering stepNick Cameron-14/+15