summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2020-06-01Split payload of FileName::Real to track both real and virutalized paths.Felix S. Klock II-7/+8
Such splits arise from metadata refs into libstd. This way, we can (in a follow on commit) continue to emit the virtual name into things like the like the StableSourceFileId that ends up in incremetnal build artifacts, while still using the devirtualized file path when we want to access the file. Note that this commit is intended to be a refactoring; the actual fix to the bug in question is in a follow-on commit.
2020-04-20Rollup merge of #71250 - GuillaumeGomez:use-json-instead-of-js, r=kinnisonDylan DPC-5/+41
Replace big JS dict with JSON parsing Part of #56545. @ollie27 suggested that using JSON instead of a JS dict might be faster, so I decided to test it. And the results far exceeded whatever expectations I had... I used https://github.com/adamgreig/stm32ral for my tests. If you want to build it locally: ```bash $ cargo doc --features doc --open ``` But I strongly recommend to do it with this PR. Some numbers: * Loading a page with the JSON search-index: less than 1 second * Loading a page with the JS search-index: crashed after 30 seconds I think the results are clear enough... r? @ollie27 cc @rust-lang/rustdoc
2020-04-19Replace uses of `parse_opt_*` with `parse_*` where possible.Nicholas Nethercote-2/+2
This lets us specify the default at the options declaration point, instead of using `.unwrap(default)` or `None | Some(default)` at some use point far away. It also makes the code more concise.
2020-04-17Replace big JS dict with JSON parsingGuillaume Gomez-5/+41
2020-04-16Rollup merge of #71221 - cuviper:rustdoc_or_patterns, r=Mark-SimulacrumDylan DPC-30/+33
Dogfood or_patterns in rustdoc We can start using `or_patterns` in `rustdoc` as a step toward stabilization. cc #54883 @Centril
2020-04-16Dogfood or_patterns in rustdocJosh Stone-30/+33
2020-04-16Rollup merge of #71179 - matthiaskrgr:cl6ppy, r=Dylan-DPCDylan DPC-6/+6
fix more clippy warnings
2020-04-16Rollup merge of #71145 - pfmooney:illumos-triple, r=nagisaDylan DPC-0/+1
Add illumos triple This fixes rust-lang/rust#55553 and adds support for `illumos` as a `target_os` on `x86_64`. In addition to the compile spec and libstd additions, several library dependencies have been bumped in order to permit working builds of cargo and rustup for the new target. Work originally started by @jasonbking, with subsequent additions by @pfmooney and @jclulow.
2020-04-16Rollup merge of #70990 - GuillaumeGomez:rustdoc-cleanup, r=ollie27Dylan DPC-29/+25
Improve rustdoc source code a bit Very small clean up. I realized that there were too many nested conditions whereas we could just use `and_then`. r? @kinnison cc @ollie27
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-4/+4
2020-04-15Fix clippy warningsMatthias Krüger-2/+2
clippy::{filter_next,single_char_pattern,unit_arg,identity_conversion,nonminimal_bool}
2020-04-15Rollup merge of #71116 - marmeladema:dummy-hir-id-removal, r=eddybMazdak Farrokhzad-15/+9
Entirely remove `DUMMY_HIR_ID` Some helpers functions have been introduced to deal with (buggy) cases where either a `NodeId` or a `DefId` do not have a corresponding `HirId`. Those cases are tracked in issue #71104.
2020-04-14Rollup merge of #71082 - NeoRaider:ptr_slice_len, r=oli-obk,SimonSapinDylan DPC-0/+2
ptr: introduce len() method on raw slices It is already possible to extract the pointer part of a raw slice by a simple cast, but retrieving the length is not possible without relying on the representation of the raw slice when it is not valid to convert the raw slice into a slice reference (i.e. the pointer is null or unaligned). ~Introduce a new function ptr::slice_len() to add this missing feature.~ Introduce a len() method on raw slices to add this missing feature.
2020-04-14Rollup merge of #71002 - Freax13:fix-target, r=ollie27Dylan DPC-2/+7
fix target & runtool args order - `TargetTripple::to_string` converts "path triples" to `<target>-<hash>`, but in this case we need the path. Afaict there is no method to get the real triple other than manually matching - the order of the runtools arguments is inconsistent with the way tests usually pass arguments ie using `runner` key in `.cargo/config`
2020-04-14Add illumos triplePatrick Mooney-0/+1
Co-Authored-By: Jason King <jason.brian.king@gmail.com> Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
2020-04-14rustdoc: add "const_slice_ptr" and "mut_slice_ptr" trait implsMatthias Schiffer-0/+2
2020-04-14Remove `DUMMY_HIR_ID`marmeladema-15/+9
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-13/+14
Rename fn_has_self_argument to fn_has_self_parameter Rename AssocItemKind::Method to AssocItemKind::Fn Refine has_no_input_arg Refine has_no_input_arg Revert has_no_input_arg Refine suggestion_descr Move as_def_kind into AssocKind Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Fix tidy check issue Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-13Rollup merge of #70656 - GuillaumeGomez:scrollbar-display, r=kinnisonDylan DPC-0/+64
Improve scrollbar display in rustdoc The scrollbar of the left sidebar in rustdoc looks very bad on firefox (on dark theme). This PR improves it: <div style="display:inline-block;"> <div style="width:50%;display:inline-block;float:left;"> <image src="https://user-images.githubusercontent.com/3050060/78148412-202b0380-7435-11ea-8ff3-79f02ea8f9ed.png"> </div> <div style="width:50%;display:inline-block;float:left;"> <image src="https://user-images.githubusercontent.com/3050060/78148437-28833e80-7435-11ea-946b-a6fc9320b705.png"> </div> </div> With light theme: ![old-firefox-light](https://user-images.githubusercontent.com/3050060/78148718-7bf58c80-7435-11ea-93d3-2a2cafd5c6ae.png) ![firefox-light](https://user-images.githubusercontent.com/3050060/78148736-7f891380-7435-11ea-8b10-a8898f73b4c9.png) And on chrome: ![chrome-light](https://user-images.githubusercontent.com/3050060/78148903-ac3d2b00-7435-11ea-9a10-6c0376a675c3.png) ![chrome-dark](https://user-images.githubusercontent.com/3050060/78148907-ae9f8500-7435-11ea-9b89-0397b977753c.png) Small extra question: should I extend it to all scrollbars? I think it'd be better but just in case... r? @kinnison
2020-04-12Rollup merge of #71029 - Mark-Simulacrum:cargo-build, r=Mark-SimulacrumDylan DPC-1/+2
Partial work on building with Cargo This cherry picks the commits I'm directly approving from #70999, I want to land them so that that PR is smaller.
2020-04-11Depend on getopts from crates.ioLuca Barbieri-1/+2
rustc_session exports it for other crates to avoid mismatching crate versions.
2020-04-11Auto merge of #70161 - cjgillot:query-arena, r=nikomatsakisbors-17/+10
Allocate some query results on an arena This avoids a cloning few `Lrc` and `Vec`s in the queries.
2020-04-10fix target & runtool args orderTom Dohrmann-2/+7
2020-04-10Improve rustdoc source code a bitGuillaume Gomez-29/+25
2020-04-10librustc_middle: return LocalDefId instead of DefId in local_def_id_from_node_idmarmeladema-3/+7
2020-04-10librustc_middle: return LocalDefId instead of DefId in body_owner_def_idmarmeladema-1/+4
2020-04-10librustc_middle: return LocalDefId instead of DefId in opt_local_def_idmarmeladema-2/+5
2020-04-08Rollup merge of #70828 - ollie27:rustdoc_external_macro_src, r=eddybDylan DPC-6/+10
rustdoc: Don't try to load source files from external crates Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead. Part of #70757 r? @GuillaumeGomez cc @eddyb
2020-04-08rustdoc: Don't try to load source files from external cratesOliver Middleton-6/+10
Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.
2020-04-07Extend sidebar scrollbar changes to all scrollbarsGuillaume Gomez-13/+41
2020-04-07Improve scrollbar display in rustdocGuillaume Gomez-0/+36
2020-04-06ty: remove `{Existential,}Trait{Ref,Predicate}::input_types`.Eduard-Mihai Burtescu-52/+52
2020-04-06ty: remove unnecessary `Predicate::walk_tys` and `collect_regions`.Eduard-Mihai Burtescu-19/+22
2020-04-05Retire rustc::ty::Attributes enum.Camille GILLOT-14/+6
2020-04-05Allocate query Vecs on the arena.Camille GILLOT-3/+4
2020-04-05Stop importing int modules in librustdocLinus Färnstrand-2/+0
2020-04-03Rollup merge of #70706 - gizmondo:check-theme, r=GuillaumeGomezDylan DPC-13/+7
Minor cleanup in rustdoc --check-theme Expand and remove try_something macro. Since https://github.com/rust-lang/rust/commit/2f6226518bd5085896a0f27cfd3ea396367ecd50 there has been only one invocation. r? @GuillaumeGomez
2020-04-02Expand and remove try_something macro.Alex Aktsipetrov-13/+7
Since https://github.com/rust-lang/rust/commit/2f6226518bd5085896a0f27cfd3ea396367ecd50 there has been only one invocation.
2020-04-02direct imports for langitem stuffMazdak Farrokhzad-2/+2
2020-04-02use direct import for ErrorReportedMazdak Farrokhzad-1/+1
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-1/+1
2020-03-31Rollup merge of #69458 - Luro02:master, r=GuillaumeGomez,ollie27Dylan DPC-40/+63
improve folder name for persistent doc tests This fixes #69411, by using the entire path as folder name and storing already visited paths in a HashMap + appending a number to the file name for duplicates.
2020-03-31more clippy fixesMatthias Krüger-115/+93
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-31improve folder name for persistent doc testsLuro02-40/+63
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-23/+23
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-38/+38
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
2020-03-28Auto merge of #66938 - GuillaumeGomez:lint-for-no-crate-level-doc, r=Dylan-DPCbors-2/+22
Add lint when no doc is present at the crate-level Follow-up of #66267. r? @kinnison
2020-03-28Rollup merge of #70493 - 0xd4d:rustdoc-tab-size, r=GuillaumeGomezDylan DPC-2/+2
Fix rustdoc.css CSS tab-size property This fixes the CSS tab size property names which are called `tab-size` / `-moz-tab-size` and not `tab-width` Old issue https://github.com/rust-lang/rust/issues/49155 and related PR https://github.com/rust-lang/rust/pull/50947 tab-size: https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size
2020-03-28Rollup merge of #70448 - TimotheeGerber:rustdoc-create-output-dir, ↵Dylan DPC-1/+6
r=GuillaumeGomez Create output dir in rustdoc markdown render `rustdoc` command on a standalone markdown document fails because the output directory (which default to `doc/`) is not created, even when specified with the `--output` argument. This PR adds the creation of the output directory before the file creation to avoid an unexpected error which is unclear. I am not sure about the returned error code. I did not find a table explaining them. So I simply put the same error code that is returned when `File::create` fails because they are both related to file-system errors. Resolve #70431