summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2015-06-22Auto merge of #26037 - nhowell:plain_js_playpen, r=steveklabnikbors-14/+34
Since the "Book" already avoids jQuery in its inline script tags and playpen.js is tiny, I figured I would convert it to plain old JS as well. Side note: This is a separate issue, but another thing I noticed in my testing is that the "⇱" character doesn't display correctly in Chrome on Windows 7. (Firefox and IE work fine; other browsers not tested) r? @steveklabnik Edit: Github didn't like the "script" tag above Edit 2: Actually, now IE seems to render "⇱" fine for me. Odd.
2015-06-18rustdoc: Update document title when displaying search resultsJohannes Oertel-0/+3
Fixes #26360.
2015-06-14Find type of orphan methods for rustdoc search.Mihnea Dobrescu-Balaur-1/+3
2015-06-12Convert playpen.js to plain JS.Nick Howell-14/+34
It is still compatible with IE9+. This removes the jQuery dependency from the "Book" entirely.
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-4/+3
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-08Auto merge of #25989 - jooert:implement_rfc839, r=Gankrobors-1/+1
I had to use `impl<'a, V: Copy> Extend<(usize, &'a V)> for VecMap<V>` instead of `impl<'a, V: Copy> Extend<(&'a usize, &'a V)> for VecMap<V>` as that's what is needed for doing ```rust let mut a = VecMap::new(); let b = VecMap::new(); b.insert(1, "foo"); a.extend(&b) ``` I can squash the commits after review. r? @Gankro
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-4/+3
2015-06-08Implement RFC 839Johannes Oertel-1/+1
Closes #25976.
2015-06-04Fix order of rustdoc arguments.Steven Allen-2/+2
rust-example-rendered should be a class, not an id. fixes #26013
2015-05-31rustdoc: Tweak css of function where clausesUlrik Sverdrup-3/+3
Method where clauses are put indented on a new line, do the same tweak to free functions, which makes it cleaner and easier to read.
2015-05-26Auto merge of #25675 - bluss:rustdoc-assoc-types-index, r=alexcrichtonbors-10/+15
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: 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-25Rustdoc: ignore deref-inherited static methodsAdolfo Ochagavía-22/+37
Fixes #24575
2015-05-24Auto merge of #25609 - nikomatsakis:const-fn, r=pnkfelixbors-13/+39
This is a port of @eddyb's `const-fn` branch. I rebased it, tweaked a few things, and added tests as well as a feature gate. The set of tests is still pretty rudimentary, I'd appreciate suggestions on new tests to write. Also, a double-check that the feature-gate covers all necessary cases. One question: currently, the feature-gate allows the *use* of const functions from stable code, just not the definition. This seems to fit our usual strategy, and implies that we might (perhaps) allow some constant functions in libstd someday, even before stabilizing const-fn, if we were willing to commit to the existence of const fns but found some details of their impl unsatisfactory. r? @pnkfelix
2015-05-22Rustdoc Search: Add Hint to Primitive Type ResultPascal Hertleif-0/+2
Closes #25167
2015-05-22Rustdoc Search: Increase Relevance of PrimitivesPascal Hertleif-0/+7
2015-05-22Rustdoc: Clean Up Some JSPascal Hertleif-60/+57
There are more possible optimizations left (cached length in loops) as well as some possible bugs (shadowed variables) to fix. This is mostly syntactic.
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-13/+39
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-19rustdoc: Fix left margin for type aliasesUlrik Sverdrup-1/+1
Fixes #24655 Margin for associated types was applied to type aliases (in return value) by mistake.
2015-05-14syntax: replace sess.span_diagnostic.cm with sess.codemap().Eduard Burtescu-5/+3
2015-05-14syntax: refactor (Span)Handler and ParseSess constructors to be methods.Eduard Burtescu-1/+1
2015-05-11Auto merge of #25225 - bluss:doc-search-assoc-items, r=alexcrichtonbors-1/+15
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-7/+7
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-1/+4
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-7/+7
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-15/+31
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-07Remove trailing whitespace on blank lineRory O’Kane-1/+1
This style inconsistency was noted at https://travis-ci.org/rust-lang/rust/builds/61583070#L371
2015-05-07Refactor doc toggle button label changingRory O’Kane-16/+31
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-05-06Add note about type signature searching to docsAndrei Oprea-0/+4
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-9/+9
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/+64
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-27Rollup merge of #24804 - liigo:new-trait-color, r=steveklabnikSteve Klabnik-1/+1
Fixes #24441 Preview: ![new-trait-color](https://cloud.githubusercontent.com/assets/346530/7331922/d6cbcf72-eb58-11e4-8a1d-4ca5e3683ed2.png)
2015-04-27Rollup merge of #24797 - roryokane:patch-1, r=nikomatsakisSteve Klabnik-9/+9
The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look slightly smoother. If you don’t want to use literal Unicode characters, I can change ‘−’ to `\u2212`. I’m not starting with that suggestion because ‘−’ is easier to read and understand, and if I used `\u2212`, it would probably be necessary to also comment the usage on each line to explain what character is being used.
2015-04-27Change literal minus ‘−’ to HTML entity ‘&minus;’Rory O’Kane-9/+9
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-24In [-] doc buttons, change hyphen ‘-’ to minus ‘−’Rory O’Kane-5/+5
The minus sign ‘−’ is the same width as the plus sign ‘+’, so the button’s transition between the two symbols will look more smooth.
2015-04-25rustdoc: change color of trait typesLiigo Zhuang-1/+1
Fixes #24441
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-24Rollup merge of #24717 - liigo:add-back-toggle-links, r=alexcrichtonManish Goregaokar-3/+7
r? @alexcrichton (since you added `.stability` warning messages)
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-2/+22
constants is not yet working.