about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2015-08-16rustdoc: Pass the Context down to short_stability()Martin Wernstål-56/+58
2015-08-16rustdoc: Added issue tracker option and issue data to clean::StabilityMartin Wernstål-1/+10
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-3/+3
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-18Fix rustdoc formatting of implsWilliam Throwe-24/+5
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-11/+11
2015-07-09Use vec![elt; n] where possibleUlrik Sverdrup-1/+1
The common pattern `iter::repeat(elt).take(n).collect::<Vec<_>>()` is exactly equivalent to `vec![elt; n]`, do this replacement in the whole tree. (Actually, vec![] is smart enough to only call clone n - 1 times, while the former solution would call clone n times, and this fact is virtually irrelevant in practice.)
2015-07-01rustdoc: Update jQuery from 2.1.0 to 2.1.4Nick Howell-2/+2
2015-06-14Find type of orphan methods for rustdoc search.Mihnea Dobrescu-Balaur-1/+3
2015-06-11Conver reborrows to .iter() calls where appropriateJoshua Landau-1/+1
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-06-08Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichtonbors-1/+1
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical. Let’s deprecate now and plan to remove in the next cycle. (It’s `#[unstable]`.) r? @alexcrichton CC @nagisa
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-1/+1
2015-06-08Implement RFC 839Johannes Oertel-1/+1
Closes #25976.
2015-05-26Auto merge of #25675 - bluss:rustdoc-assoc-types-index, r=alexcrichtonbors-7/+12
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: Show where clauses in type aliasesUlrik Sverdrup-2/+3
Yes, it's allowed. Example: type MapFn<I, B> where I: Iterator = Map<I, fn(I::Item) -> B>; Fixes #25769
2015-05-25Rustdoc: ignore deref-inherited static methodsAdolfo Ochagavía-22/+37
Fixes #24575
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-13/+20
2015-05-21rustdoc: Skip types in impls in search indexUlrik Sverdrup-5/+9
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. Fixes #22442
2015-05-11Auto merge of #25225 - bluss:doc-search-assoc-items, r=alexcrichtonbors-0/+13
Rustdoc fixes for associated items This is related to isssue #22442 and solves it partly. This solves the search index links of associated types and constants, so that they link to the trait page. Also add an Associated Constants section if constants are present.
2015-05-09Rollup merge of #25216 - barosl:no-more-task, r=ManishearthManish Goregaokar-6/+6
I've found that there are still huge amounts of occurrences of `task`s in the documentation. This PR tries to eliminate all of them in favor of `thread`.
2015-05-09rustdoc: Add Associated Constants sectionUlrik Sverdrup-0/+11
Section only visible if there are assoc. consts. present.
2015-05-08Remove references to deprecated `extern crate "foo" as bar` syntaxCarol Nichols-1/+1
This syntax was removed in b24a3b8 but references remained in the grammar, the reference, rustdoc generation, and some auxiliary test files that don't seem to have been used since 812637e.
2015-05-09rustdoc: Link associated items in search index to traitUlrik Sverdrup-0/+2
This is related to isssue #22442 and solves it partly. This solves the links of associated types and constants, so that they link to the trait page.
2015-05-09Squeeze the last bits of `task`s in documentation in favor of `thread`Barosl Lee-6/+6
An automated script was run against the `.rs` and `.md` files, subsituting every occurrence of `task` with `thread`. In the `.rs` files, only the texts in the comment blocks were affected.
2015-05-07Auto merge of #24973 - roryokane:fix-minus-doc-buttons, r=alexcrichtonbors-1/+3
My change in #24797 had a bug, described in that issue’s comments, and first discovered in issue #24918. This fixes it. I tested this new `main.js` by changing the `main.js` content of [a rendered docs page](https://doc.rust-lang.org/std/option/) to this new content. The ‘[−]’ button worked again. I am also including another related fix, because it would require manual merging if I made a separate pull request for it. The page-global ‘[−]’ button currently adds `#` to the end of the URL whenever it is clicked. I am changing its `href` from `#` to `javascript:void(0)` (the same as the `href` for section-specific ‘[−]’ links) to fix that.
2015-05-07Refactor doc toggle button label changingRory O’Kane-2/+3
To separate concerns, instead of checking the state of `#toggle-all-docs` by looking at its label text, I add or remove a class `will-expand` depending on whether the button’s next click will expand everything. (The `if` statement’s two branches were swapped as part of this change.) I moved the desired text values to a function `labelForToggleButton`, so changing the values will be easier. I also note in a comment the other file where the text is duplicated. To allow the labels of both types of toggle buttons to be uniformly set, I added a `span.inner` to the global button too. I split the template in `render.rs` into multiple lines to make room for the `span`, and that adds whitespace around the `[` and `]` text elements. That seems to be okay, though – the page still looks the same. I updated the CSS styling for `.collapse-toggle > .inner` to add a little extra space around the symbol, to make minus signs easier to identify. (`#toggle-all-docs > .inner` does not need the same style, since its text size is bigger, so it naturally puts more space around the symbol.)
2015-04-30rustdoc: Fix rendering associated constantsAlex Crichton-7/+24
Associated constants were now showing up for traits and would panic if they were found on an inherent impl. This commit unblocks the nighly builders.
2015-04-30Fix style warning, “line longer than 100 chars”Rory O’Kane-1/+2
Error was noted at https://travis-ci.org/rust-lang/rust/builds/60643081#L371 I didn’t just put the content of the node on another line, because that would add spaces around the element content, messing up the JavaScript that checks what the content is.
2015-04-30Change docs toggle href from # to javascript:Rory O’Kane-1/+1
So that when you click the link, the URL doesn’t get # appended to it. The non-page-global docs toggle link, which is created in `main.js`, already uses this `href` value.
2015-04-30Fix doc [−] button bug by escaping differentlyRory O’Kane-1/+1
The cause of the problem is described here: https://github.com/rust-lang/rust/pull/24797#issuecomment-97049765 . I tested this new `main.js` by changing the `main.js` content of a rendered docs page to this new content. The [−] button worked again.
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-38/+61
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-27Change literal minus ‘−’ to HTML entity ‘&minus;’Rory O’Kane-1/+1
So that if people accidentally delete the character, they won’t re-type it as a hyphen, which would cause bugs. I changed ‘&plus;’ too, even though it won’t be re-typed incorrectly, so that it is easier to see when plus is used as a symbol for the button, and when it is used as an operator in code. It also makes it clearer that the use of an entity for minus is on purpose, so people won’t be tempted to replace the entity incorrectly with a hyphen character.
2015-04-27Change hyphen to minus in HTML template tooRory O’Kane-1/+1
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-2/+22
constants is not yet working.
2015-04-23Structural changes for associated constantsSean Patrick Santos-38/+41
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-23rustdoc: toggle collapse/expand all docs using the same linkLiigo Zhuang-3/+3
2015-04-17Remove info for path (fixup #24452)Manish Goregaokar-1/+0
2015-04-16Use BTreeMap in build_sidebar_itemsMathijs van de Nes-3/+4
This ensures that later when generating HTML, the JSON will be sorted aswell. We now have a deterministic build of sidebar-items.js
2015-04-16rustdoc: Inline methods inhereted through DerefAlex Crichton-34/+99
Whenever a type implements Deref, rustdoc will now add a section to the "methods available" sections for "Methods from Deref<Target=Foo>", listing all the inherent methods of the type `Foo`. Closes #19190
2015-04-16rustdoc: Fix cross-crate macro source linksAlex Crichton-14/+37
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-96/+86
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-14/+14
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-6/+6
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-07rustdoc: Index inherent methods on primitivesAlex Crichton-42/+17
The set of types which can have an inherent impl changed slightly and rustdoc just needed to catch up to understand what it means to see a `impl str`! Closes #23511
2015-04-07rustdoc: Encode ABI in all methodsAlex Crichton-2/+3
This commit ensures that the ABI of functions is propagated all the way through to the documentation. Closes #22038
2015-04-07rustdoc: Show impls for references to typesAlex Crichton-1/+6
It's somewhat common to impl traits for `&T` and `&mut T` so show these on the pages for `T` to ensure they're listed somewhere at least. Closes #20175
2015-04-07rustdoc: Render methods/impls for bare traitsAlex Crichton-32/+35
This renders a "Methods" and "Trait Implementations" section for each item implemented for a bare trait itself. Closes #19055
2015-04-07rustdoc: Link "Trait Implementations" to sourcesAlex Crichton-38/+66
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: Only hide possibly private modulesAlex Crichton-1/+3
If an empty public module has no documentation, it shouldn't emit a page that's just a redirect loop to itself! Closes #16265
2015-04-07rustdoc: Add a primitive page for raw pointersAlex Crichton-3/+9
Closes #15318