Commit Graph

296 Commits

Author SHA1 Message Date
Josh Stone
554847c513 Dogfood or_patterns in rustdoc 2020-04-16 13:58:47 -07:00
Matthias Krüger
08f2904dfa more clippy fixes
use is_empty() instead of len comparison (clippy::len_zero)
use if let instead of while let loop that never loops (clippy::never_loop)
remove redundant returns (clippy::needless_return)
remove redundant closures (clippy::redundant_closure)
use if let instead of match and wildcard pattern (clippy::single_match)
don't repeat field names redundantly (clippy::redundant_field_names)
2020-03-31 15:20:05 +02:00
Matthias Krüger
7aad89a900 Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) 2020-03-07 21:46:47 +01:00
Matthias Krüger
9fa79813f9 rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion) 2020-03-07 21:46:47 +01:00
Dylan DPC
67d735c4bf
Rollup merge of #69736 - matthiaskrgr:even_more_clippy, r=Dylan-DPC
even more clippy cleanups

* Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed)
* Use more efficient &&str to String conversion (clippy::inefficient_to_string)
* Don't always eval arguments inside .expect(), use unwrap_or_else and closure. (clippy::expect_fun_call)
* Use righthand '&' instead of lefthand "ref". (clippy::toplevel_ref_arg)
* Use simple 'for i in x' loops instead of 'while let Some(i) = x.next()' loops on iterators. (clippy::while_let_on_iterator)
* Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes)
* Remove redundant patterns when matching ( x @ _  to  x) (clippy::redundant_pattern)
2020-03-05 22:04:10 +01:00
Matthias Krüger
3e70c8ec2f Use simple 'for i in x' loops instead of 'while let Some(x) = x.next()' loops on iterators. (clippy::while_let_on_iterator) 2020-03-05 16:38:48 +01:00
Matthias Krüger
38f5db7268 Use .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) 2020-03-04 20:39:22 +01:00
Matthias Krüger
de7c40c168 use .iter() instead of .into_iter() on references. 2020-02-29 03:14:01 +01:00
Matthias Krüger
7c84ba1124 use char instead of &str for single char patterns 2020-02-27 14:57:22 +01:00
Matthias Krüger
addd7426be don't explicitly compare against true or false 2020-02-24 16:52:40 +01:00
Guillaume Gomez
d8589de1f0 Update pulldown-cmark dependency 2020-02-14 22:39:45 +01:00
Guillaume Gomez
0e6a941820 Don't keep link title either, text is generated outside of the link tag 2020-01-16 14:19:37 +01:00
Guillaume Gomez
1bf9f69579 Prevent urls in headings 2020-01-14 19:21:10 +01:00
Mazdak Farrokhzad
b1aad76586 Normalize syntax::edition imports. 2020-01-02 19:31:38 +01:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Eric Huss
1907589fbb rustdoc: Stabilize edition annotation. 2019-11-08 16:15:17 -08:00
Mark Rousskov
3f144e119e Move Toc printing from fmt::Display 2019-09-13 19:44:44 -04:00
bors
87b0c9036f Auto merge of #60387 - Goirad:test-expansion, r=ollie27
Allow cross-compiling doctests

This PR allows doctest to receive a --runtool argument, as well as possibly many --runtool-arg arguments, which are then used to run cross compiled doctests.
Also, functionality has been added to rustdoc to allow it to skip testing doctests on a per-target basis, in the same way that compiletest does it. For example, tagging the doctest with "ignore-sgx" disables testing on any targets that contain "sgx". A plain "ignore" still skips testing on all targets.

See [here](https://github.com/rust-lang/cargo/pull/6892) for the companion PR in the cargo project that extends functionality in Cargo so that it passes the appropriate parameters to rustdoc when cross compiling and testing doctests.

Part of [#6460](https://github.com/rust-lang/cargo/issues/6460)
2019-09-10 12:19:41 +00:00
Eric Huss
fb387088e2 rustdoc: fix diagnostic with mixed code block styles 2019-09-07 12:21:32 -07:00
Dario Gonzalez
14110ebd93 added rustdoc book documentation, improved behavior when unstable flag not present 2019-09-03 13:53:00 -07:00
Dario Gonzalez
3f76408841 added feature gate enable-per-target-ignores
updated and augmented tests in html/markdown.rs
2019-09-03 13:50:36 -07:00
Dario Gonzalez
98bd8fd88c Added ability to crosscompile doctests 2019-09-03 13:48:18 -07:00
Mark Rousskov
b0fab966fa Shorten line during rendering instead of in markdown 2019-08-26 20:30:10 -04:00
Mark Rousskov
1aa0964b54 Drop RefCell from IdMap in markdown rendering 2019-08-11 10:47:58 -04:00
Mark Rousskov
c250b5fd03 Remove fmt::Display impls on Markdown structs
These impls prevent ergonomic use of the config (e.g., forcing us to use
RefCell) despite all usecases for these structs only using their Display
impls once.
2019-08-11 10:36:46 -04:00
Mark Rousskov
dbad77ffdd Remove thread-local for playground config 2019-08-11 10:36:46 -04:00
Vadim Petrochenkov
a332e224a3 librustdoc: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
Vadim Petrochenkov
5a9643c95b Fix tidy 2019-06-16 14:17:21 +03:00
chansuke
46e622beb9 Separate librustcdoc module 2019-06-16 14:17:01 +03:00
Andy Russell
ed8a4d5bc1
upgrade rustdoc's pulldown-cmark to 0.5.2
Fixes #60482.
2019-05-29 10:59:59 -04:00
QuietMisdreavus
e61ff7717e update rustdoc doc test 2019-05-06 15:20:18 -05:00
QuietMisdreavus
5b167bf4bb update rustdoc unit tests 2019-05-06 15:20:18 -05:00
QuietMisdreavus
20a5aa302e set the default edition when pre-parsing a doctest 2019-05-06 15:20:18 -05:00
Andy Russell
303016485b
upgrade rustdoc's pulldown-cmark to 0.4.1 2019-04-22 09:11:26 -04:00
Hirokazu Hata
1932d7a52d Transition librustdoc to 2018 edition 2019-02-23 16:40:07 +09:00
Alexander Regueiro
c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Andy Russell
8c93798e9f
rustdoc: check code block syntax in early pass 2019-01-14 21:21:21 -05:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Guillaume Gomez
987bf2ed29 Split on words instead 2018-12-13 22:11:22 +01:00
Guillaume Gomez
24031466b7 Remove unneeded extra chars to reduce search-index size 2018-12-11 22:29:43 +01:00
Guillaume Gomez
3030cbea95 Remove short doc where it starts with a codeblock 2018-11-10 19:03:58 +01:00
QuietMisdreavus
d0c9385781 add Debug impls for the Options structs 2018-11-04 16:39:24 -06:00
QuietMisdreavus
157833c588 swap uses of Matches with pre-parsed args 2018-11-02 16:24:58 -05:00
Guillaume Gomez
d6385631f4 Add lint for doc without codeblocks 2018-10-09 16:47:12 +02:00
Philip Munksgaard
b01e0e43d4 Add a documentation banner for edition specific code 2018-09-20 08:36:07 +02:00
Philip Munksgaard
c996c4d316 Add support for running doc test in specific edition 2018-09-19 14:32:09 +02:00
Eduard-Mihai Burtescu
93f3f5b155 Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc. 2018-08-28 17:04:04 +03:00
ljedrz
44d32d4413 Avoid unnecessary pattern matching against Option and Result 2018-08-07 10:24:27 +02:00
Mark Rousskov
8e65a46268 Cleanup highlighting code
Removes some unused code and de-publicizes structs
2018-07-31 17:55:12 -06:00
Mark Rousskov
7bea518d3a Remove global derive_id and reset_ids functions
Previously these functions relied on TLS but we can instead thread the
relevant state through explicitly.
2018-07-31 17:55:12 -06:00