summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
AgeCommit message (Collapse)AuthorLines
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
2015-08-24fallout from moving def-idNiko Matsakis-6/+6
2015-08-20Show variadic args in rustdoc output.Lee Jeffery-1/+5
2015-08-08rustc: rename multiple imports in a listSean McArthur-2/+7
2015-07-18Fix rustdoc formatting of implsWilliam Throwe-0/+13
Some cases displayed negative impls as positive, and some were missing where clauses. This factors all the impl formatting into one function so the different cases can't get out of sync again.
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-2/+1
2015-05-26Auto merge of #25675 - bluss:rustdoc-assoc-types-index, r=alexcrichtonbors-3/+3
rustdoc: Associated type fixes The first commit fixes a bug with "dud" items in the search index from misrepresented `type` items in trait impl blocks. For a trait *implementation* there are typedefs which are the types for that particular trait and implementor. Skip these in the search index. There were lots of dud items in the search index due to this (search for Item, Iterator's associated type). Add a boolean to clean::TypedefItem so that it tracks whether the it is a type alias on its own, or if it's a `type` item in a trait impl. The second commit fixes a bug that made signatures and where bounds using associated types (if they were not on `Self`) incorrect. The third commit fixes so that where clauses in type alias definititons are shown. Fixes #22442 Fixes #24417 Fixes #25769
2015-05-25rustdoc: Fix associated types in signaturesUlrik Sverdrup-3/+3
Functions such as `fn foo<I: Iterator>(x: I::Item)` would not render correctly and displayed `I` instead of `I::Item`. Same thing with `I::Item` appearing in where bounds. This fixes the bug by using paths for generics. Fixes #24417
2015-05-21Make various fixes:Niko Matsakis-1/+1
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-0/+19
2015-04-16rustdoc: Fix cross-crate macro source linksAlex Crichton-6/+6
The source filename for cross crate macros isn't quite right so the normal generated links are invalid. Closes #21311
2015-04-16rustdoc: Overhaul stability displaysAlex Crichton-122/+0
This commit is an overhaul to how rustdoc deals with stability of the standard library. The handling has all been revisited with respect to Rust's current approach to stability in terms of implementation as well as the state of the standard library today. The high level changes made were: * Stable items now have no marker by default * Color-based small stability markers have been removed * Module listings now fade out unstable/deprecated items slightly * Trait methods have a separate background color based on stability and also list the reason that they are unstable. * `impl` blocks with stability no longer render at all. This may be re-added once the compiler recognizes stability on `impl` blocks. * `impl` blocks no longer have stability of the methods implemente indicated * The stability summary has been removed Closes #15468 Closes #21674 Closes #24201
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-9/+9
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-07rustdoc: Encode ABI in all methodsAlex Crichton-0/+12
This commit ensures that the ABI of functions is propagated all the way through to the documentation. Closes #22038
2015-04-07rustdoc: Improve handling inlined associated typesAlex Crichton-11/+24
* All bounds are now discovered through the trait to be inlined. * The `?Sized` bound now renders correctly for inlined associated types. * All `QPath`s (`<A as B>::C`) instances are rendered as `A::C` where `C` is a hyperlink to the trait `B`. This should improve at least how the docs look at least. * Supertrait bounds are now separated and display as the source lists them. Closes #20727 Closes #21145
2015-04-07rustdoc: Link "Trait Implementations" to sourcesAlex Crichton-67/+41
All methods listed in "Trait Implementations" now hyperlink to the source trait instead of themselves, allowing easy browsing of the documentation of a trait method. Closes #17476
2015-04-07rustdoc: Add a primitive page for raw pointersAlex Crichton-1/+2
Closes #15318