about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2020-03-19Auto merge of #69402 - GuillaumeGomez:extend-search, r=kinnisonbors-9/+61
Extend search I realized that when looking for "struct:String" in the rustdoc search for example, the "in arguments" and "returned" tabs were always empty. After some investigation, I realized it was because we only provided the name, and not the type, making it impossible to pass the "type filtering" check. To resolve this, I added the type alongside the name. Note for the future: we could improve this by instead only registering the path id and use the path dictionary directly. The only problem with that solution (which I already tested) is that it becomes complicated for types in other crates. It'd force us to handle both case with an id and a case with `(name, type)`. I found the current PR big enough to not want to provide it directly. However, I think this is definitely worth it to make it work this way in the future. About the two tests I added: they don't have much interest except checking that we actually have something returned in the search in the cases of a type filtering with and without literal search. I also had to update a bit the test script to add the new locally global (haha) variable I created (`NO_TYPE_FILTER`). I added this variable to make the code easier to read than just "-1". r? @kinnison cc @ollie27
2020-03-17Update rustdoc test and remove TODO commentGuillaume Gomez-1/+0
2020-03-16Rename render::Type to improve namingGuillaume Gomez-5/+5
2020-03-16formattingGuillaume Gomez-4/+1
2020-03-16Support type search for arguments and returned typesGuillaume Gomez-7/+62
2020-03-15Add FIXME notevarkor-1/+1
2020-03-15Render full attributes in rustdocvarkor-22/+2
2020-03-14Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPCYuki Okushi-6/+4
fix more clippy findings * reduce references on match patterns (clippy::match_ref_pats) * Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline) * libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string) * remove unneeded mutable references (cippy::unnecessary_mut_passed) * libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast) * rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes) * call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) * iterate over a maps values directly. (clippy::for_kv_map) * rustdoc: simplify boolean condition (clippy::nonminimal_bool) * Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) * rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some) * rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion)
2020-03-11Rollup merge of #66472 - GuillaumeGomez:show-coverage-json, r=ollie27Mazdak Farrokhzad-1/+2
--show-coverage json The purpose of this change is to be able to use it as a tool in docs.rs in order to provide some more stats to crates' owners. Eventually even create a badge or something along the line. r? @QuietMisdreavus
2020-03-10Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddybbors-1/+1
Cleanup `rmeta::MacroDef` Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`. The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well. Fixes #49511. r? @eddyb cc @matthewjasper @estebank @petrochenkov
2020-03-10Store `TokenStream` in `rmeta::MacroDef`.Mazdak Farrokhzad-1/+1
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-03-10Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnisonMazdak Farrokhzad-81/+4
Remove spotlight I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it. r? @kinnison cc @ollie27
2020-03-07iterate over a maps values directly. (clippy::for_kv_map)Matthias Krüger-1/+1
2020-03-07rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some)Matthias Krüger-5/+3
2020-03-06fix various typosMatthias Krüger-1/+1
2020-03-05Const items have by default a static lifetime, there's no need to annotate ↵Matthias Krüger-2/+2
it. (clippy::redundant_static_lifetimes)
2020-03-05Remove redundant patterns when matching ( x @ _ to x) ↵Matthias Krüger-1/+1
(clippy::redundant_pattern)
2020-03-02Put back output-format option for show-coverageGuillaume Gomez-1/+2
2020-03-01Rollup merge of #69598 - ollie27:rustdoc_crate-version_escape, r=GuillaumeGomezDylan DPC-2/+3
rustdoc: HTML escape crate version As `--crate-version` accepts arbitrary strings they need to be escaped. r? @GuillaumeGomez
2020-03-01rustdoc: HTML escape crate versionOliver Middleton-2/+3
As `--crate-version` accepts arbitrary strings they need to be escaped.
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-29Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-SimulacrumDylan DPC-3/+3
use is_empty() instead of len() == x to determine if structs are empty.
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-3/+3
2020-02-27use char instead of &str for single char patternsMatthias Krüger-1/+1
2020-02-27Remove "important traits" featureGuillaume Gomez-81/+4
2020-02-24don't explicitly compare against true or falseMatthias Krüger-1/+1
2020-02-04Rollup merge of #68818 - matthiaskrgr:misc_perf, r=Mark-SimulacrumDylan DPC-8/+1
fix couple of perf related clippy warnings librustc: don't clone a type that is copy librustc_incremental: use faster vector initialization librustc_typeck: don't clone a type that is copy librustdoc: don't create a vector where a slice will do
2020-02-04fix couple of perf related clipyp warningsMatthias Krüger-8/+1
librustc: don't clone a type that is copy librustc_incremental: use faster vector initialization librustc_typeck: don't clone a type that is copy librustdoc: don't create a vector where a slice will do
2020-02-04remove redundant imports (clippy::single_component_path_imports)Matthias Krüger-2/+0
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-1/+1
2020-01-22Auto merge of #68192 - GuillaumeGomez:remove-inlined-types, r=kinnisonbors-23/+32
Remove usage of global variable "inlined_types" r? @pietroalbini
2020-01-20rustdoc: Correct order of `async` and `unsafe` in `async unsafe fn`sOliver Middleton-5/+5
2020-01-20Remove usage of global variable "inlined_types"Guillaume Gomez-23/+32
2020-01-15Fix rendering on sidebar and update testsGuillaume Gomez-4/+4
2020-01-15Simplify deref impls for type aliasesGuillaume Gomez-37/+26
2020-01-15Include type alias implementationsGuillaume Gomez-21/+32
2020-01-15formattingGuillaume Gomez-12/+8
2020-01-15Fix deref impl on type aliasGuillaume Gomez-7/+17
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-3/+2
2020-01-07Rollup merge of #67908 - ollie27:rustdoc_const_html_escape, r=GuillaumeGomezYuki Okushi-2/+2
rustdoc: HTML escape const values r? @GuillaumeGomez
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-2/+3
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
2020-01-05rustdoc: HTML escape const valuesOliver Middleton-2/+2
2020-01-05Use `as_deref()` to replace `as_ref().map(...)`Ivan Tham-3/+3
Suggested by @lzutao
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+3
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::edition` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-24Deprecate Error::description for realDavid Tolnay-5/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.