summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-36/+25
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-30Auto merge of #34541 - jseyfried:rollup, r=jseyfriedbors-16/+1
Rollup of 5 pull requests - Successful merges: #34105, #34305, #34512, ~~#34531,~~ #34547
2016-06-29Rollup merge of #34536 - ollie27:rustdoc_module_impls, r=alexcrichtonManish Goregaokar-0/+3
rustdoc: Fix empty Implementations section on some module pages These are caused by `DefaultImpl`s. For example [`core::marker`](https://doc.rust-lang.org/nightly/core/marker/#impls).
2016-06-29Rollup merge of #34105 - ollie27:rustdoc_derived, r=alexcrichtonJeffrey Seyfried-16/+1
rustdoc: Remove Derived Implementations title As far as I know whether a trait was derived or not does not change the public API so there is no need to include this information in the docs. This title currently just adds an extra divide in the list of trait implementations which I don't think needs to be there.
2016-06-28rustdoc: Fix empty Implementations section on some module pagesOliver Middleton-0/+3
These are caused by `DefaultImpl`s.
2016-06-27Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearthbors-1/+2
Batch up libsyntax breaking changes Batch of the following syntax-[breaking-change] changes: - #34213: Add a variant `Macro` to `TraitItemKind` - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path` - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream` - #33943: - Remove the type parameter from `visit::Visitor` - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead. - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`. - Remove the field `ctxt` of `ast::Mac_` - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead. - #34316: - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`. - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`) - Rename `ast::ExprKind::Again` to `Continue`. - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>` - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>` - Use autoderef instead of `.as_attr_slice()` - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list. - #34403: Move errors into a separate crate (unlikely to cause breakage)
2016-06-25Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichtonJeffrey Seyfried-1/+2
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors). This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes. As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos). While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25rustdoc: Fix search result layout for enum variants and struct fieldsOliver Middleton-1/+1
2016-06-24Auto merge of #34439 - ollie27:rustdoc_panic_fix, r=alexcrichtonbors-10/+13
rustdoc: Fix panic caused by doc(hidden) trait methods Fixes: #34423 r? @alexcrichton
2016-06-23rustdoc: Fix panic caused by doc(hidden) trait methodsOliver Middleton-10/+13
2016-06-23Auto merge of #34372 - ollie27:rustdoc_sidebar, r=steveklabnikbors-1/+5
rustdoc: Add more types to the sidebar They're displayed in the same order as they are on modules pages. You can test [here](https://ollie27.github.io/rust_doc_test/std/). For example: [before](https://doc.rust-lang.org/nightly/std/char/constant.MAX.html) [after](https://ollie27.github.io/rust_doc_test/std/char/constant.MAX.html) [before](https://doc.rust-lang.org/nightly/std/os/raw/type.c_char.html) [after](https://ollie27.github.io/rust_doc_test/std/os/raw/type.c_char.html)
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+2
2016-06-22Rollup merge of #34387 - ollie27:rustdoc_src_links, r=alexcrichtonManish Goregaokar-6/+9
rustdoc: Fix a couple of issues with src links to external crates - src links/redirects to extern fn from another crate had an extra '/'. - src links to `pub use` of a crate module had an extra '/'. - src links to renamed reexports from another crate used the new name for the link but should use the original name. Fixes: #34274
2016-06-20Auto merge of #34186 - GuillaumeGomez:err-code-check, r=alexcrichtonbors-18/+37
Implementation of #34168 r? @brson cc @alexcrichton cc @steveklabnik cc @jonathandturner I only updated `librustc_privacy/diagnostics.rs`, and I already found a case where the code doesn't throw the expected error code (E0448). Fixes #34168.
2016-06-20rustdoc: Fix a couple of issues with src links to external cratesOliver Middleton-6/+9
- src links/redirects to extern fn from another crate had an extra '/'. - src links to `pub use` of a crate module had an extra '/'. - src links to renamed reexports from another crate used the new name for the link but should use the original name.
2016-06-20Add error code flagGuillaume Gomez-12/+15
2016-06-19rustdoc: Add more types to the sidebarOliver Middleton-1/+5
They're displayed in the same order as they are on modules pages.
2016-06-17Auto merge of #34292 - ollie27:rustdoc_depr_impl, r=GuillaumeGomezbors-17/+30
rustdoc: Add stability notices to impl items Also fixes missing stability notices on methods with no docs. For example [`f64::is_positive`](https://doc.rust-lang.org/nightly/std/primitive.f64.html#method.is_positive) is missing its deprecation message.
2016-06-16Add an abs_path member to FileMap, use it when writing debug info.Ted Mielczarek-2/+2
When items are inlined from extern crates, the filename in the debug info is taken from the FileMap that's serialized in the rlib metadata. Currently this is just FileMap.name, which is whatever path is passed to rustc. Since libcore and libstd are built by invoking rustc with relative paths, they wind up with relative paths in the rlib, and when linked into a binary the debug info uses relative paths for the names, but since the compilation directory for the final binary, tools trying to read source filenames will wind up with bad paths. We noticed this in Firefox with source filenames from libcore/libstd having bad paths. This change stores an absolute path in FileMap.abs_path, and uses that if available for writing debug info. This is not going to magically make debuggers able to find the source, but it will at least provide sensible paths.
2016-06-15rustdoc: Add stability notices to impl itemsOliver Middleton-17/+30
Also fixes missing stability notices on methods with no docs.
2016-06-14Auto merge of #34245 - ollie27:rustdoc_redirect_rename, r=alexcrichtonbors-12/+10
rustdoc: Fix redirect pages for renamed reexports We need to use the name of the target not the name of the current item when creating the link. An example in `std` is [`std::sys::ext`](https://doc.rust-lang.org/nightly/std/sys/ext/index.html).
2016-06-14Auto merge of #34234 - GuillaumeGomez:bad_inlining, r=steveklabnikbors-2/+6
Fix invalid inlining r? @steveklabnik So to put a context. @nox found an issue on the generated doc: ![screenshot from 2016-06-11 19-53-38](https://cloud.githubusercontent.com/assets/3050060/15987898/f7341de0-303b-11e6-9cd7-f2a6df423ee7.png) So as you can see, the two variants are on the same where they shouldn't. I found out that the issue is also on structs: ![screenshot from 2016-06-11 19-53-31](https://cloud.githubusercontent.com/assets/3050060/15987900/0f66c5de-303c-11e6-90fc-5e49d11b6903.png) And so such is the result of the PR: ![screenshot from 2016-06-12 01-15-21](https://cloud.githubusercontent.com/assets/3050060/15987904/19d9183c-303c-11e6-91c1-7c3f1163fbb0.png) ![screenshot from 2016-06-12 01-15-24](https://cloud.githubusercontent.com/assets/3050060/15987905/1b5d2db0-303c-11e6-8f43-9a8ad2371007.png)
2016-06-14rustdoc: Fix redirect pages for renamed reexportsOliver Middleton-12/+10
We need to use the name of the target not the name of the current item when creating the link.
2016-06-12Add error codes block code flagGuillaume Gomez-6/+22
2016-06-12Auto merge of #34045 - ollie27:rustdoc_stripped, r=brsonbors-17/+24
rustdoc: Don't generate empty files for stripped items We need to traverse stripped modules to generate redirect pages, but we shouldn't generate anything else for them. This now renders the file contents to a Vec before writing it to a file in one go. I think that's probably a better strategy anyway. Fixes: #34025
2016-06-12Fix invalid inliningGuillaume Gomez-2/+6
2016-06-09Auto merge of #34108 - jseyfried:refactor_prelude_injection, r=nrcbors-1/+4
Refactor away the prelude injection fold Instead, just inject `#[prelude_import] use [core|std]::prelude::v1::*;` at the crate root while injecting `extern crate [core|std];` and process `#[no_implicit_prelude]` attributes in `resolve`. r? @nrc
2016-06-08Auto merge of #32202 - arielb1:slice-patterns, r=nikomatsakisbors-3/+4
Implement RFC495 semantics for slice patterns non-MIR translation is still not supported for these and will happily ICE. This is a [breaking-change] for many uses of slice_patterns. [RFC 495 text](https://github.com/rust-lang/rfcs/blob/master/text/0495-array-pattern-changes.md)
2016-06-09fix damage in librustcAriel Ben-Yehuda-3/+4
2016-06-08Auto merge of #34068 - ollie27:rustdoc_redirect_const, r=brsonbors-1/+3
rustdoc: Fix generating redirect pages for statics and consts These were missing from the cache for some reason meaning the redirect pages failed to render.
2016-06-07Rollup merge of #34138 - hoodie:bug/bool_colors, r=steveklabnikSteve Klabnik-2/+2
Bug/bool colors This is actually #33661 @steveklabnik, sorry about this, github ate my homework
2016-06-07Fix bug in `librustdoc` in which an unmatched "</table>" is emitted.Jeffrey Seyfried-1/+4
2016-06-05rustdoc: Remove Derived Implementations titleOliver Middleton-16/+1
As far as I know whether a trait was derived or not does not change the public API so there is no need to include this information in the docs. This title currently just adds an extra divide in the list of trait implementations which I don't think needs to be there.
2016-06-04rustdoc: Fix a few missing colors in the CSSOliver Middleton-5/+6
This adds color to some of the search results and sidebar items which were missing.
2016-06-03rustdoc: Fix generating redirect pages for statics and constsOliver Middleton-1/+3
These were missing from the cache for some reason meaning the redirect pages failed to render.
2016-06-02rustdoc: Don't generate empty files for stripped itemsOliver Middleton-17/+24
We need to traverse stripped modules to generate redirect pages, but we shouldn't generate anything else for them. This now renders the file contents to a Vec before writing it to a file in one go. I think that's probably a better strategy anyway.
2016-05-30Rollup merge of #33867 - oli-obk:rustdoc_variant_types, r=GuillaumeGomezManish Goregaokar-40/+64
print enum variant fields in docs Right now we are repeating enum variants at the top, because the fields aren't shown with the actual docs. It's very annoying to have to scroll up and down to have both docs and field info. For struct variants we already list the fields. enum docs look like this after this PR: ![screenshot from 2016-05-25 14-02-42](https://cloud.githubusercontent.com/assets/332036/15539231/84b018cc-2281-11e6-9666-1063655931f4.png) There are degenerate cases for enum tuple variants with lots of fields: ![screenshot from 2016-05-25 14-01-00](https://cloud.githubusercontent.com/assets/332036/15539260/91e537ca-2281-11e6-8bf1-a3d6b2e78f65.png) I was thinking that we could move the docs below the variant (slightly indented) or list the variant fields vertically instead of horizontally r? @steveklabnik
2016-05-30print enum variant fields in docsOliver Schneider-40/+64
2016-05-27Rollup merge of #33829 - GuillaumeGomez:stability-css, r=steveklabnikGuillaume Gomez-0/+4
Fix invalid background color in stability elements r? @steveklabnik
2016-05-24Rollup merge of #33797 - alex-ozdemir:rustdoc, r=GuillaumeGomezGuillaume Gomez-0/+1
Changed toggle all sections key to `T` Allows both `T` and `t`. It had been [Shift]+[+] before. In response to #33791. cc @Manishearth r? @GuillaumeGomez
2016-05-24Fix invalid background color in stability elementsGuillaume Gomez-0/+4
2016-05-22Fixed shortcut handling. Reverted to [Shift]+[+=]Alex Ozdemir-3/+3
Realized browsers use [Ctrl]+[+=] for zoom, so using [Shift]+[+=] for collapse/expand was not necessarily a conflict. Also a bugfix.
2016-05-22Changed toggle all sections key to `T`Alex Ozdemir-2/+3
Allows both `T` and `t`. It had been [Shift]+[+] before.
2016-05-21Auto merge of #33765 - alex-ozdemir:master, r=Manishearthbors-3/+11
Added a `rustdoc` shortcut for collapse/expand all Now when the user presses the "+" key all sections will collapse/expand. Also added a note to the help screen which describes this behavior. This required increasing the height of the help screen.
2016-05-21Rollup merge of #33679 - Manishearth:rustdoc-readmore-impls, r=alexcrichtonManish Goregaokar-12/+43
rustdoc: Add doc snippets for trait impls, with a read more link The read more link only appears if the documentation is more than one line long. ![screenshot from 2016-05-17 06 54 14](https://cloud.githubusercontent.com/assets/1617736/15308544/4c2ba0ce-1bfc-11e6-9add-29de8dc7ac6e.png) It currently does not appear on non-defaulted methods, since you can document them directly. I could make it so that default documentation gets forwarded if regular docs don't exist. Fixes #33672 r? @alexcrichton cc @steveklabnik
2016-05-20Added a `rustdoc` shortcut for collapse/expand allAlex Ozdemir-3/+11
Now when the user presses the "+" key all sections will collapse/expand. Also added a note to the help screen which describes this behavior.
2016-05-20Update testsManish Goregaokar-15/+17
2016-05-19Rollup merge of #33705 - lqd:rustdoc-version-tooltip, r=GuillaumeGomezManish Goregaokar-2/+3
rustdoc: Make the #[stable(since)] version attribute clearer with a tooltip Rustdoc's new 'since' version placement only shows the version number in which the item was marked stable. This gains space but might make the meaning of this version string less clear in the docs, so I tried to bring some explicitness in a tooltip.
2016-05-19Make the #[stable(since)] version attribute clearer with a tooltipRémy Rakic-2/+3
2016-05-18Move read more link to same lineManish Goregaokar-5/+6