summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2018-09-10[beta] rustdoc: disable blanket impl collectionQuietMisdreavus-111/+2
2018-07-30Delete unused code in rustdocMark Rousskov-121/+96
2018-07-30Auto merge of #52830 - matthewjasper:bootstrap-prep, r=matthewjasperbors-1/+1
[NLL] Fix some things for bootstrap Some changes that are required when bootstrapping rustc with NLL enabled. * Remove a bunch of unused `mut`s that aren't needed, but the existing lint doesn't catch. * Rewrite a function call to satisfy NLL borrowck. Note that the borrow is two-phase, but gets activated immediately by an unsizing coercion. cc #51823
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-1/+1
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-29Auto merge of #52738 - ljedrz:push_to_extend, r=eddybbors-6/+2
Replace push loops with extend() where possible Or set the vector capacity where I couldn't do it. According to my [simple benchmark](https://gist.github.com/ljedrz/568e97621b749849684c1da71c27dceb) `extend`ing a vector can be over **10 times** faster than `push`ing to it in a loop: 10 elements (6.1 times faster): ``` test bench_extension ... bench: 75 ns/iter (+/- 23) test bench_push_loop ... bench: 458 ns/iter (+/- 142) ``` 100 elements (11.12 times faster): ``` test bench_extension ... bench: 87 ns/iter (+/- 26) test bench_push_loop ... bench: 968 ns/iter (+/- 3,528) ``` 1000 elements (11.04 times faster): ``` test bench_extension ... bench: 311 ns/iter (+/- 9) test bench_push_loop ... bench: 3,436 ns/iter (+/- 233) ``` Seems like a good idea to use `extend` as much as possible.
2018-07-29Remove unused `mut`sMatthew Jasper-1/+1
2018-07-29Replace push loops with collect() and extend() where possibleljedrz-6/+2
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-18/+18
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-15/+11
Misc cleanups
2018-07-29Auto merge of #52751 - QuietMisdreavus:you-shall-not-pass, r=GuillaumeGomezbors-26/+50
rustdoc: rework how default passes are chosen This is a refactor that changes how we select default passes, and changes the set of passes used for `--document-private-items`. It's groundwork for a bigger refactor i want to do. The major changes: * There are now two sets of "default passes": one set for "no flags given" and one for "document private items". * These sets can be selected by a new `DefaultPassOption` enum, which is selected from based on the presence of `--no-defaults` or `--document-private-items` CLI flags, or their associated crate attributes. * When printing the list of passes, we also print the list of passes for `--document-private-items` in addition to the "default defaults". * I added `propagate-doc-cfg` and `strip-priv-imports` to the "document private items" set. The former is to ensure items are properly tagged with the full set of cfg flags even when "document private items" is active. The latter is based on feedback and personal experience navigating the `rustc` docs, which use that flag. `strip-priv-imports` only removes non-pub `use` statements, so it should be harmless from a documentation standpoint to remove those items from "private items" documentation.
2018-07-28Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavusbors-64/+217
[rustdoc] Generic impls Fixes #33772. r? @QuietMisdreavus
2018-07-28Move blanket implementations generation into its own functionGuillaume Gomez-19/+29
2018-07-28Remove core exclusion conditionGuillaume Gomez-13/+13
2018-07-28Don't format!() string literalsljedrz-1/+1
2018-07-28Don't display full blanket implementation and put it into its own sectionGuillaume Gomez-20/+55
2018-07-28Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakiskennytm-3/+3
Use a slice where a vector is not necessary
2018-07-27Use slices where a vector is not necessaryljedrz-3/+3
2018-07-27Use str::repeatShotaro Yamada-15/+11
2018-07-27Prefer to_string() to format!()ljedrz-18/+18
2018-07-26rustdoc: rework how default passes are chosenQuietMisdreavus-26/+50
2018-07-25Add missing dynTatsuyuki Ishi-8/+8
2018-07-24Auto merge of #52257 - steveklabnik:refactor-rustdoc, r=QuietMisdreavusbors-72/+16
Refactor rustdoc This is based on https://github.com/rust-lang/rust/pull/52194 and so shouldn't be merged until it gets merged. Now that plugin functionality has been removed, let's kill PluginManager. Additionally, rustdoc now follows the standard cargo layout instead of dumping everything at the top level. r? @rust-lang/rustdoc
2018-07-24remove zombie codesteveklabnik-5/+0
2018-07-24remove pluginmanagersteveklabnik-69/+18
2018-07-24Auto merge of #52181 - QuietMisdreavus:panicked-tester, r=GuillaumeGomezbors-45/+47
rustdoc: set panic output before starting compiler thread pool When the compiler was updated to run on a thread pool, rustdoc's processing of compiler/doctest stderr/stdout was moved into each compiler thread. However, this caused output of the test to be lost if the test failed at *runtime* instead of compile time. This change sets up the `set_panic` call and output bomb before starting the compiler thread pool, so that the `Drop` call that writes back to the test's stdout happens after the test runs, not just after it compiles. Fixes https://github.com/rust-lang/rust/issues/51162
2018-07-24force the doctest rustc thread to share the name of the testQuietMisdreavus-2/+2
2018-07-24Remove generic-impl rendering filterGuillaume Gomez-85/+83
2018-07-24Add src and fix generics display issuesGuillaume Gomez-6/+6
2018-07-23Auto merge of #52211 - bjorn3:misc_rustdoc_changes, r=QuietMisdreavusbors-16/+4
Misc rustdoc changes
2018-07-23Auto merge of #52568 - oli-obk:span_bug_error, r=varkorbors-0/+1
Fix loop label resolution around constants And make `delay_span_bug` a little more helpful r? @varkor fixes #52442 fixes #52443
2018-07-23Fix style issuesGuillaume Gomez-7/+9
2018-07-22Fix urlsGuillaume Gomez-4/+4
2018-07-22Prevent some items to get generic impls listedGuillaume Gomez-1/+2
2018-07-22Improve codeGuillaume Gomez-64/+44
2018-07-22Add new tests and fix old onesGuillaume Gomez-37/+65
2018-07-22CleanupGuillaume Gomez-65/+1
2018-07-22Add filter over non generic implsGuillaume Gomez-54/+38
2018-07-22Working generic implGuillaume Gomez-137/+198
2018-07-22some improvementsGuillaume Gomez-7/+23
2018-07-22part 2Guillaume Gomez-59/+46
2018-07-22First step to generic trait implsGuillaume Gomez-20/+114
2018-07-22Start of generic impl fix for rustdocGuillaume Gomez-3/+24
2018-07-23Rollup merge of #52581 - petrochenkov:bmacrodoc, r=alexcrichtonkennytm-7/+5
Avoid using `#[macro_export]` for documenting builtin macros Use a special `rustc_*` attribute instead. cc https://github.com/rust-lang/rust/pull/52234
2018-07-22Auto merge of #52368 - ↵bors-4/+63
GuillaumeGomez:intra_doc_link_resolution_failure-documented, r=QuietMisdreavus Add "self" intra-link support Fixes #49583. r? @QuietMisdreavus
2018-07-22Add "self" intra-link supportGuillaume Gomez-4/+63
2018-07-21Avoid using `#[macro_export]` for documenting builtin macrosVadim Petrochenkov-7/+5
2018-07-20Auto merge of #52354 - QuietMisdreavus:rustdoc-lints, r=GuillaumeGomezbors-5/+5
stabilize lint handling in rustdoc When https://github.com/rust-lang/rust/pull/51732 added CLI flags to manipulate lints in rustdoc, they were added as unstable flags. This made sense as they were new additions, but since they mirrored the flags that rustc has, it's worth considering them to not need an unstable period. Stabilizing them also provides the opportunity for a critical fix: allowing Cargo to pass `--cap-lints allow` when documenting dependencies, the same as when it compiles them. r? @rust-lang/rustdoc
2018-07-20report doctest compile failures correctlyQuietMisdreavus-19/+19
2018-07-20rustdoc: set panic output before starting compiler thread poolQuietMisdreavus-25/+27
2018-07-20Make sure the compiler actually panics on `delay_span_bug`Oliver Schneider-0/+1
Even if that is just happening because of `abort_if_errors`