summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2015-05-12Auto merge of #25323 - eddyb:coherent-coherence, r=pnkfelixbors-1/+1
The loop to load all the known impls from external crates seems to have been used because `ty::populate_implementations_for_trait_if_necessary` wasn't doing its job, and solely relying on it resulted in loading only impls in the same crate as the trait. Coherence for `librustc` was reduced from 18.310s to 0.610s, from stage1 to stage2. Interestingly, type checking also went from 46.232s to 42.003s, though that could be noise or unrelated improvements. On a smaller scale, `fn main() {}` now spends 0.003s in coherence instead of 0.368s, which fixes #22068. It also peaks at only 1.2MB, instead of 16MB of heap usage.
2015-05-12rustc: rename ty::populate_implementations_for_type_if_necessary to make it ↵Eduard Burtescu-1/+1
clear that it only populates inherent impls.
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-11Auto merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnikbors-1/+1
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
2015-05-09Rollup merge of #25216 - barosl:no-more-task, r=ManishearthManish Goregaokar-9/+9
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-9/+9
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-07Rollup merge of #25146 - piatra:doc-search-patch, r=steveklabnikSteve Klabnik-0/+4
I noticed this feature added in https://github.com/rust-lang/rust/pull/23289 was missing from the `Search tricks`. Thanks! r? @steveklabnik
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-05-06fix typos caught by codespellTshepang Lekhonkhobe-1/+1
2015-05-03Update old uses of ~ in comments and debugging statementsCarol Nichols-1/+1
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-42/+120
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-23Get associated consts working in match patterns.Sean Patrick Santos-0/+2
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-6/+47
constants is not yet working.
2015-04-23Structural changes for associated constantsSean Patrick Santos-39/+74
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-23rustdoc: add back [-]/[+] toggle links for unstable-methodsLiigo Zhuang-3/+7
2015-04-23rustdoc: toggle collapse/expand all docs using the same linkLiigo Zhuang-15/+20
2015-04-21implement rfc 1054: split_whitespace() fn, deprecate words()kwantam-5/+4
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
2015-04-20Auto merge of #24597 - bombless:doc, r=steveklabnikbors-1/+1
This patch will make links like http://doc.rust-lang.org/std/collections/struct.BTreeMap.html#examples actually playable without modifying the code. It seems that this patch cannot be tested on test/rustdoc. And I suggest adding a `&run=1` to those links. Thank @jorisgio for noticing me this! r? @steveklabnik Closes https://github.com/rust-lang/rust/issues/24332
2015-04-19rustdoc: don't inject "extern crate std;"York Xiang-1/+1
2015-04-18Auto merge of #24428 - kwantam:deprecate_unicode_fns, r=alexcrichtonbors-2/+2
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-17Auto merge of #24461 - nikomatsakis:issue-22077-unused-lifetimes, r=aturonbors-1/+1
This makes it illegal to have unconstrained lifetimes that appear in an associated type definition. Arguably, we should prohibit all unconstrained lifetimes -- but it would break various macros. It'd be good to evaluate how large a break change it would be. But this seems like the minimal change we need to do to establish soundness, so we should land it regardless. Another variant would be to prohibit all lifetimes that appear in any impl item, not just associated types. I don't think that's necessary for soundness -- associated types are different because they can be projected -- but it would feel a bit more consistent and "obviously" safe. I'll experiment with that in the meantime. r? @aturon Fixes #22077.
2015-04-17Fix some missing casesNiko Matsakis-1/+1
2015-04-17Remove info for path (fixup #24452)Manish Goregaokar-2/+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-16deprecate Unicode functions that will be moved to crates.iokwantam-2/+2
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-16rustdoc: Inline methods inhereted through DerefAlex Crichton-66/+220
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-20/+51
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-447/+132
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-26/+26
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-21/+21
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14rollup merge of #24385: aturon/unstable-scopedAlex Crichton-2/+2
Conflicts: src/libstd/thread/mod.rs src/test/bench/shootout-mandelbrot.rs src/test/bench/shootout-reverse-complement.rs src/test/run-pass/capturing-logging.rs src/test/run-pass/issue-9396.rs src/test/run-pass/tcp-accept-stress.rs src/test/run-pass/tcp-connect-timeouts.rs src/test/run-pass/tempfile.rs
2015-04-14Fallout: move from scoped to spawnAaron Turon-2/+2