about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2018-08-01Rollup merge of #52835 - GuillaumeGomez:ice-rustdoc-links, r=eddybPietro Albini-23/+27
Fix Alias intra doc ICE Fixes #52611. cc @QuietMisdreavus r? @varkor
2018-07-31Add dyn to WriteMark Rousskov-1/+1
2018-07-31Cleanup highlighting codeMark Rousskov-42/+23
Removes some unused code and de-publicizes structs
2018-07-31Remove global derive_id and reset_ids functionsMark Rousskov-149/+181
Previously these functions relied on TLS but we can instead thread the relevant state through explicitly.
2018-07-31Put back original field discoveryGuillaume Gomez-2/+8
2018-07-31Format code for easier editingMark Rousskov-6/+5
2018-07-31Further extract error code switchMark Rousskov-56/+94
Removes dependency on UnstableFeatures from markdown rendering
2018-07-31Remove dependency on error handling from find_testable_codeMark Rousskov-13/+24
2018-07-31Provide test configuration through structMark Rousskov-28/+21
This is far more sound than passing many different arguments of the same type.
2018-07-31Provide warnings for invalid code blocks in markdown filesMark Rousskov-7/+5
Previously we would only warn on Rust code but we can also do so when testing markdown (the diag::Handler is available).
2018-07-31Pull out nightly checking to edgesMark Rousskov-8/+7
Parsing the code block's LangString (```foo) previously checked itself to see if we were on nightly; that isn't the right place to do so. Move that check slightly outwards to better abstract LangString. (This is also an optimization as we avoid the costly environment variable load of RUSTC_BOOTSTRAP).
2018-07-30Delete unused code in rustdocMark Rousskov-121/+96
2018-07-30Fix Alias intra doc ICEGuillaume Gomez-23/+21
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