summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2015-05-12Squeeze 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-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-23/+23
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-13/+13
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-13rustdoc: Prevent '/' from showing the help dialogBarosl Lee-3/+5
Only '?' should do that. Fixes #24289.
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: Handle tests with bare `#` marksAlex Crichton-1/+3
Strip them from output like other `# `-starting lines. Closes #23106
2015-04-07rustdoc: Encode ABI in all methodsAlex Crichton-2/+15
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: 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: Allowing specifying attrs for doctestsAlex Crichton-2/+4
This adds support in rustdoc to blanket apply crate attributes to all doc tests for a crate at once. The syntax for doing this is: #![doc(test(attr(...)))] Each meta item in `...` will be applied to each doctest as a crate attribute. cc #18199
2015-04-07rustdoc: Link "Trait Implementations" to sourcesAlex Crichton-105/+107
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-4/+11
Closes #15318
2015-04-07rustdoc: Run external traits through filtersAlex Crichton-14/+6
This ensures that all external traits are run through the same filters that the rest of the AST goes through, stripping hidden function as necessary. Closes #13698
2015-04-06rustdoc: Use iterators to collapse whitespaceMichael Macias-21/+8
Thanks, @alexcrichton!
2015-04-06rustdoc: Add a custom callback for codespan to collapse whitespaceMichael Macias-3/+59
Because the current style for `code` in rustdoc is to prewrap whitespace, code spans that are hard wrapped in the source documentation are prematurely wrapped when rendered in HTML. CommonMark 0.18 [[1]] specifies "interior spaces and line endings are collapsed into single spaces" for code spans, which would actually prevent this issue, but hoedown does not currently conform to the CommonMark spec. The added span-level callback attempts to adhere to how whitespace is handled as described by CommonMark, fixing the issue of early, unintentional wrapping of code spans in rendered HTML. [1]: http://spec.commonmark.org/0.18/
2015-04-05Auto merge of #24055 - estsauver:24044, r=alexcrichtonbors-0/+2
If a result is highlighted, when the search changes that state should no longer be highlighted. Fixes #24044 cc @steveklabnik
2015-04-04Make changing doc search unhighlight current resultEarl St Sauver-0/+2
If a result is highlighted, when the search changes that state should no longer be highlighted. Fixes #24044 cc @steveklabnik
2015-04-04Rollup merge of #23941 - carloslfu:patch-1, r=steveklabnikManish Goregaokar-4/+6
Validate if the description is available in the rawSearchIndex
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-5/+5
2015-04-01Fix sidebar bugCarlos Galarza-4/+6
Validate if the description is available in the rawSearchIndex
2015-03-29Fix extremely small stability bars on docs pageWesley Wiser-0/+4
Fixes #23397
2015-03-29Auto merge of #23809 - cmr:issue-21310, r=Manishearthbors-2/+6
This isn't really possible to test in an automatic way, since the only traits you can negative impl are `Send` and `Sync`, and the implementors page for those only exists in libstd. Closes #21310
2015-03-27rustdoc: show negative impls properly in the implementors pageCorey Richardson-2/+6
This isn't really possible to test in an automatic way, since the only traits you can negative impl are `Send` and `Sync`, and the implementors page for those only exists in libstd. Closes #21310
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-6/+6
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27rollup merge of #23752: alexcrichton/remove-should-failAlex Crichton-9/+9
This attribute has been deprecated in favor of #[should_panic]. This also updates rustdoc to no longer accept the `should_fail` directive and instead renames it to `should_panic`.
2015-03-27default => or_insert per RFCAlexis Beingessner-3/+3
2015-03-26update everything to use Entry defaultsAlexis-9/+4
2015-03-26syntax: Remove support for #[should_fail]Alex Crichton-9/+9
This attribute has been deprecated in favor of #[should_panic]. This also updates rustdoc to no longer accept the `should_fail` directive and instead renames it to `should_panic`.
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-6/+6
Now that support has been removed, all lingering use cases are renamed.
2015-03-24Test fixes and rebase conflicts, round 2Alex Crichton-6/+6
2015-03-24rollup merge of #23674: nagisa/fallout-1Alex Crichton-6/+6
2015-03-25Fix some fallout in librustdocSimonas Kazlauskas-6/+6
2015-03-25Add trivial cast lints.Nick Cameron-7/+7
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-1/+1
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23rollup merge of #23633: tomjakubowski/rustdoc-array-primAlex Crichton-8/+13
Previously, impls for `[T; n]` were collected in the same place as impls for `[T]` and `&[T]`. This splits them out into their own primitive page in both core and std.
2015-03-23rollup merge of #23601: nikomatsakis/by-value-indexAlex Crichton-6/+6
This is a [breaking-change]. When indexing a generic map (hashmap, etc) using the `[]` operator, it is now necessary to borrow explicitly, so change `map[key]` to `map[&key]` (consistent with the `get` routine). However, indexing of string-valued maps with constant strings can now be written `map["abc"]`. r? @japaric cc @aturon @Gankro
2015-03-23Add generic conversion traitsAaron Turon-3/+3
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23rustdoc: Add #[doc(test(no_inject_crate))] attributeBrian Anderson-1/+1
So that collections doctests don't automatically fail themselves by injecting `extern crate collections` when they are mostly using the std facade.
2015-03-23rustdoc: Support for "array" primitiveTom Jakubowski-8/+13
Impls on `clean::Type::FixedVector` are now collected in the array primitive page instead of the slice primitive page. Also add a primitive docs for arrays to `std`.
2015-03-23Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses ofNiko Matsakis-6/+6
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about how to use `[]`.
2015-03-18[rustdoc] Fix source hyperlinks in docsIvan Petkov-5/+12
* rustdoc was doubly appending the file name to the path of where to generate the source files, meanwhile, the [src] hyperlinks were not * Added a flag to rustdoc::html::render::clean_srcpath to ignore the last path component, i.e. the file name itself to prevent the issue * This also avoids creating directories with the same name as source files, and it makes sure the link to `main.css` is correct as well. * Added regression tests to ensure the rustdoc heirarchy of rendered source files remains consistent Fixes #23192
2015-03-15Strip trailing whitespaceTamir Duberstein-4/+4
2015-03-15Strip all leading/trailing newlinesTamir Duberstein-2/+0
2015-03-15Auto merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichtonbors-9/+10
Previously it would fail on a trivial case like /// Summary line /// <trailing space> /// Regular content Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line extractor interprets both lines as the same paragraph and includes both into the short summary resulting in ![screenshot from 2015-03-13 22 47 08](https://cloud.githubusercontent.com/assets/679122/6648596/7ef792b2-c9e4-11e4-9c19-704c288ec4de.png)
2015-03-14Auto merge of #23289 - mihneadb:rustdoc-search-by-type, r=alexcrichtonbors-3/+142
This adds search by type (for functions/methods) support to Rustdoc. Target issue is at https://github.com/rust-lang/rfcs/issues/658. I've described my approach here: https://github.com/rust-lang/rfcs/issues/658#issuecomment-76484200. I'll copy the text in here as well: --- Hi, it took me longer than I wished, but I have implemented this in a not-too-complex way that I think can be extended to support more complex features (like the ones mentioned [here](https://github.com/rust-lang/rust/issues/12866#issuecomment-66945317)). The idea is to generate a JSON representation of the types of methods/functions in the existing index, and then make the JS understand when it should look by type (and not by name). I tried to come up with a JSON representation that can be extended to support generics, bounds, ref/mut annotations and so on. Here are a few samples: Function: ```rust fn to_uppercase(c: char) -> char ``` ```json { "inputs": [ {"name": "char"} ], "output": { "name": "char", } } ``` Method (implemented or defined in trait): ```rust // in struct Vec // self is considered an argument as well fn capacity(&self) -> usize ``` ```json { "inputs": [ {"name": "vec"} ], "output": { "name": "usize" } } ``` This simple format can be extended by adding more fields, like `generic: bool`, a `bounds` mapping and so on. I have a working implementation in https://github.com/rust-lang/rust/compare/master...mihneadb:rustdoc-search-by-type. You can check out a live demo [here](http://data.mihneadb.net/doc/std/index.html?search=charext%20-%3E%20char). ![screenshot from 2015-02-28 00 54 00](https://cloud.githubusercontent.com/assets/643127/6422722/7e5374ee-bee4-11e4-99a6-9aac3c9d5068.png) The feature list is not that long: - search by types (you *can* use generics as well, as long as you use the exact name - e.g. [`vec,t -> `](http://data.mihneadb.net/doc/std/index.html?search=vec%2C%20t%20-%3E)) - order of arguments does not matter - `self` is took into account as well (e.g. search for `vec -> usize`) - does not use "complex" annotations (e.g. you don't search for `&char -> char` but for `char -> char`) My goal is to get a working, minimal "base" merged so that others can build upon it. How should I proceed? Do I open a PR (badly in need of code review since this is my first non "hello world"-ish rust code)? ---
2015-03-14Add support to search functions by type to rustdoc.Mihnea Dobrescu-Balaur-3/+142
2015-03-14Split rustdoc summary lines in a smarter waySimonas Kazlauskas-9/+10
Previously it would fail on a trivial case like /// Summary line /// <trailing space> /// Regular content Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line extractor would interpret both lines as the same paragraph and include both into the short summary.
2015-03-13Auto merge of #23292 - alexcrichton:stabilize-io, r=aturonbors-2/+3
The new `std::io` module has had some time to bake now, and this commit stabilizes its functionality. There are still portions of the module which remain unstable, and below contains a summart of the actions taken. This commit also deprecates the entire contents of the `old_io` module in a blanket fashion. All APIs should now have a reasonable replacement in the new I/O modules. Stable APIs: * `std::io` (the name) * `std::io::prelude` (the name) * `Read` * `Read::read` * `Read::{read_to_end, read_to_string}` after being modified to return a `usize` for the number of bytes read. * `ReadExt` * `Write` * `Write::write` * `Write::{write_all, write_fmt}` * `WriteExt` * `BufRead` * `BufRead::{fill_buf, consume}` * `BufRead::{read_line, read_until}` after being modified to return a `usize` for the number of bytes read. * `BufReadExt` * `BufReader` * `BufReader::{new, with_capacity}` * `BufReader::{get_ref, get_mut, into_inner}` * `{Read,BufRead} for BufReader` * `BufWriter` * `BufWriter::{new, with_capacity}` * `BufWriter::{get_ref, get_mut, into_inner}` * `Write for BufWriter` * `IntoInnerError` * `IntoInnerError::{error, into_inner}` * `{Error,Display} for IntoInnerError` * `LineWriter` * `LineWriter::{new, with_capacity}` - `with_capacity` was added * `LineWriter::{get_ref, get_mut, into_inner}` - `get_mut` was added) * `Write for LineWriter` * `BufStream` * `BufStream::{new, with_capacities}` * `BufStream::{get_ref, get_mut, into_inner}` * `{BufRead,Read,Write} for BufStream` * `stdin` * `Stdin` * `Stdin::lock` * `Stdin::read_line` - added method * `StdinLock` * `Read for Stdin` * `{Read,BufRead} for StdinLock` * `stdout` * `Stdout` * `Stdout::lock` * `StdoutLock` * `Write for Stdout` * `Write for StdoutLock` * `stderr` * `Stderr` * `Stderr::lock` * `StderrLock` * `Write for Stderr` * `Write for StderrLock` * `io::Result` * `io::Error` * `io::Error::last_os_error` * `{Display, Error} for Error` Unstable APIs: (reasons can be found in the commit itself) * `Write::flush` * `Seek` * `ErrorKind` * `Error::new` * `Error::from_os_error` * `Error::kind` Deprecated APIs * `Error::description` - available via the `Error` trait * `Error::detail` - available via the `Display` implementation * `thread::Builder::{stdout, stderr}` Changes in functionality: * `old_io::stdio::set_stderr` is now a noop as the infrastructure for printing backtraces has migrated to `std::io`. [breaking-change]