about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-05-02initial step towards implementing C string literalsDeadbeef-1/+3
2023-05-02Rollup merge of #110955 - fee1-dead-contrib:sus-operation, r=compiler-errorsDylan DPC-1/+1
uplift `clippy::clone_double_ref` as `suspicious_double_ref_op` Split from #109842. r? ``@compiler-errors``
2023-05-01Make the BUG_REPORT_URL configurable by toolsjyn-1/+5
This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt
2023-04-30Rollup merge of #110631 - notriddle:notriddle/impl-trait-cycle, r=GuillaumeGomezMatthias Krüger-19/+56
rustdoc: catch and don't blow up on impl Trait cycles Fixes #110629 An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-29rustdoc: catch and don't blow up on impl Trait cyclesMichael Howell-19/+56
An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-30Rollup merge of #110983 - GuillaumeGomez:foreign-repr, r=notriddleMatthias Krüger-48/+96
rustdoc: Get `repr` information through `AdtDef` for foreign items As suggested by `@notriddle,` this approach works too. The only downside is that the display of the original attribute isn't kept, but I think it's an acceptable downside. r? `@notriddle`
2023-04-29Unify attributes retrieval for JSON and HTML renderingGuillaume Gomez-79/+76
2023-04-29Fix display of attributes for enumsGuillaume Gomez-2/+2
2023-04-29Get `repr` information through `AdtDef` for foreign itemsGuillaume Gomez-21/+72
2023-04-29Rollup merge of #110964 - notriddle:notriddle/deref-impl, r=GuillaumeGomezMatthias Krüger-6/+12
rustdoc: fix weird margins between Deref impl items ## Before ![image](https://user-images.githubusercontent.com/1593513/235245977-90770591-22c1-4a27-9464-248a3729a2b7.png) ## After ![image](https://user-images.githubusercontent.com/1593513/235246009-0e83113e-42b7-4e29-981d-969f9d20af01.png) ## Description In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl. This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
2023-04-29drive-by cleanup of rustdoc commentjyn-3/+3
2023-04-29Add `rustdoc::unescaped_backtick` lintLukas Markeffsky-5/+436
2023-04-29fix rustdoc and core testDeadbeef-1/+1
2023-04-28rustdoc: fix weird margins between Deref impl itemsMichael Howell-6/+12
In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl. This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
2023-04-28handle cfg(bootstrap)Pietro Albini-6/+1
2023-04-28rustdoc: render visibility on associated typeswackbyte-1/+3
This should only affect inherent associated types.
2023-04-28Auto merge of #110924 - matthiaskrgr:rollup-jvznpq2, r=matthiaskrgrbors-5/+5
Rollup of 6 pull requests Successful merges: - #110766 (More core::fmt::rt cleanup.) - #110873 (Migrate trivially translatable `rustc_parse` diagnostics) - #110904 (rustdoc: rebind bound vars to type-outlives predicates) - #110913 (Add some missing built-in lints) - #110918 (`remove_dir_all`: try deleting the directory even if `FILE_LIST_DIRECTORY` access is denied) - #110920 (Fix unavailable url) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-28Rollup merge of #110904 - fmease:rustdoc-fix-110900, r=compiler-errorsMatthias Krüger-5/+5
rustdoc: rebind bound vars to type-outlives predicates Fixes #110900.
2023-04-27rustdoc: rebind bound vars to type-outlives predicatesLeón Orell Valerian Liehr-5/+5
2023-04-27refactor(docs): remove macro resolution fallbackbohan-14/+16
2023-04-26Rollup merge of #110847 - aDotInTheVoid:rdj-time-serialization, r=GuillaumeGomezMatthias Krüger-1/+4
rustdoc-json: Time serialization. This lets us know how much time is spent in json specific code, and how much performance we could gain by using a different serialization format. For aws-sdk-ec2, it takes 0.7s, out of a 43s build (of which 6s is spent in json specific code), and makes a 173M json file ``` $ cargo +rust_stage2 rustdoc -p aws-sdk-ec2 -- -Zunstable-options -w json -Ztime-passes Documenting aws-sdk-ec2 v0.26.0 (/home/gh-aDotInTheVoid/aws-sdk-rust/sdk/ec2) time: 5.229; rss: 64MB -> 891MB ( +827MB) expand_crate time: 5.230; rss: 61MB -> 891MB ( +830MB) macro_expand_crate time: 0.256; rss: 891MB -> 891MB ( +0MB) AST_validation time: 0.025; rss: 891MB -> 891MB ( +1MB) finalize_imports time: 0.093; rss: 891MB -> 891MB ( +0MB) compute_effective_visibilities time: 0.122; rss: 891MB -> 891MB ( +0MB) finalize_macro_resolutions time: 2.442; rss: 891MB -> 1188MB ( +297MB) late_resolve_crate time: 0.120; rss: 1188MB -> 1190MB ( +2MB) resolve_check_unused time: 0.211; rss: 1190MB -> 1190MB ( +0MB) resolve_postprocess time: 3.017; rss: 891MB -> 1190MB ( +299MB) resolve_crate time: 8.520; rss: 61MB -> 1181MB (+1120MB) prepare_outputs time: 0.152; rss: 1181MB -> 1181MB ( +0MB) complete_gated_feature_checking time: 0.539; rss: 1633MB -> 1632MB ( -1MB) drop_ast time: 15.492; rss: 58MB -> 1621MB (+1563MB) type_collecting time: 1.503; rss: 1621MB -> 1705MB ( +84MB) item_types_checking time: 1.274; rss: 1705MB -> 1726MB ( +21MB) crate_lints time: 1.275; rss: 1705MB -> 1726MB ( +21MB) missing_docs time: 0.281; rss: 1726MB -> 1726MB ( +0MB) check_mod_attrs time: 0.433; rss: 1744MB -> 1750MB ( +6MB) clean_crate time: 11.581; rss: 1750MB -> 2107MB ( +357MB) collect_synthetic_impls time: 0.019; rss: 2107MB -> 2107MB ( +0MB) collect_items_for_trait_impls time: 12.588; rss: 1750MB -> 2139MB ( +389MB) collect-trait-impls time: 0.197; rss: 2139MB -> 2139MB ( +0MB) check_doc_test_visibility time: 0.281; rss: 2139MB -> 2150MB ( +11MB) strip-hidden time: 0.260; rss: 2150MB -> 2150MB ( +0MB) strip-private warning: unresolved link to `date` --> sdk/ec2/src/client/describe_instances.rs:7:11184 | 7 | ...te of the instance (for example, shows "User Initiated [date]" when you stop or terminate the instance). Similar to the state-reason-code filter.<... | ^^^^ no item named `date` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default time: 0.363; rss: 2150MB -> 2150MB ( +0MB) collect-intra-doc-links time: 0.946; rss: 2150MB -> 2150MB ( +0MB) propagate-doc-cfg time: 0.494; rss: 2150MB -> 2152MB ( +2MB) run-lints time: 0.658; rss: 2152MB -> 2163MB ( +11MB) create_format_cache time: 34.818; rss: 58MB -> 2163MB (+2105MB) run_global_ctxt time: 0.016; rss: 2163MB -> 2163MB ( +0MB) create_renderer(json) time: 0.723; rss: 2780MB -> 2780MB ( +0MB) rustdoc_json_serialization time: 2.216; rss: 2399MB -> 2599MB ( +199MB) renderer_after_krate(json) time: 6.639; rss: 2163MB -> 2417MB ( +254MB) render_json time: 0.312; rss: 2417MB -> 2071MB ( -346MB) free_global_ctxt warning: `aws-sdk-ec2` (lib doc) generated 1 warning Finished dev [unoptimized + debuginfo] target(s) in 43.06s ``` [(Zulip Discussion)](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/JSON.20metadata.20speed/near/352783145) r? `@GuillaumeGomez`
2023-04-26Rollup merge of #110835 - nnethercote:strict-region-folders-2, r=compiler-errorsMatthias Krüger-1/+3
Make some region folders a little stricter. Because certain regions cannot occur in them. r? ``@compiler-errors``
2023-04-26Rollup merge of #110798 - ozkanonur:rustdoc-unused-extern-crates, r=jyn514Matthias Krüger-0/+8
pass `unused_extern_crates` in `librustdoc::doctest::make_test` blocker for https://github.com/rust-lang/rust/pull/106621
2023-04-26rustdoc-json: Time serialization.Alona Enraght-Moony-1/+4
2023-04-26Fix uses of `TraitRef::identity` in clippy and rustdocMaybe Waffle-1/+1
2023-04-26Make some region folders a little stricter.Nicholas Nethercote-1/+3
Because certain regions cannot occur in them.
2023-04-25Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, ↵Matthias Krüger-6/+7
r=compiler-errors Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 :smiley:)
2023-04-25Use `ty::TraitRef::new` in rustdocMaybe Waffle-1/+1
2023-04-25pass `unused_extern_crates` in `librustdoc::doctest::make_test`ozkanonur-0/+8
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-24rustdoc-search: add slices and arrays to indexMichael Howell-2/+28
This indexes them as primitives with generics, so `slice<u32>` is how you search for `[u32]`, and `array<u32>` for `[u32; 1]`. A future commit will desugar the square bracket syntax to search both arrays and slices at once.
2023-04-24Fix `rustc_index` imports outside the compilerMaybe Waffle-1/+1
2023-04-24Rollup merge of #110514 - compiler-errors:remove-find_map_relevant_impl, ↵Matthias Krüger-9/+11
r=b-naber Remove `find_map_relevant_impl` Fixes #108895
2023-04-23Rollup merge of #110661 - notriddle:notriddle/settings-js-handlekey, ↵Matthias Krüger-19/+1
r=GuillaumeGomez rustdoc: clean up settings.css and settings.js `handleKey` was added in 9dc5dfb97504c538bc72f367a77bb9f714c30097 and 704050da2334c465784954d81c8990c4bc7a92c5 because the browser-native checkbox was `display: none`, breaking native keyboard accessibility. The native checkbox is now merely `appearance: none`, which does not turn off [behavior semantics], so JavaScript to reimplement it isn't needed any more. [behavior semantics]: https://w3c.github.io/csswg-drafts/css-ui/#appearance-semantics The other, one line change to settings.css is follow-up to #110205
2023-04-23Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillotbors-2/+0
Run various queries from other queries instead of explicitly in phases These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps. This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
2023-04-22Rollup merge of #110659 - notriddle:notriddle/js-cleanup-20230421, ↵Yuki Okushi-11/+6
r=GuillaumeGomez rustdoc: clean up JS * use `Set` for ignored crates in cross-crate trait impl JS, instead of `indexOf` string manipulation * lift constant `window.location.split` code out of a loop in source code sidebar builder * remove redundant history manipulation from search page exit
2023-04-22Rollup merge of #109949 - notriddle:notriddle/type-layout, r=jshaYuki Okushi-116/+154
rustdoc: migrate `document_type_layout` to askama
2023-04-21rustdoc: remove unused CSS `color: inherit`Michael Howell-1/+0
This code was added back when `border-color: currentColor` was used. Since it was changed in ad9a89eef2857a24ef049b9eee2d1db5bcbf1d11, the current color is not used any more.
2023-04-21rustdoc: remove unneeded handleKey from settings.jsMichael Howell-18/+1
This code was added in 9dc5dfb97504c538bc72f367a77bb9f714c30097 and 704050da2334c465784954d81c8990c4bc7a92c5 because the browser- native checkbox was `display: none`, breaking native keyboard accessibility. The native checkbox is now merely `appearance: none`, which does not turn off [behavior semantics], so JavaScript to reimplement it isn't needed any more. [behavior semantics]: https://w3c.github.io/csswg-drafts/css-ui/#appearance-semantics
2023-04-21Leave it to the query system to invoke the typeck query instead of invoking ↵Oli Scherer-2/+0
it eagerly. Later queries that are run on all body owners will invoke typeck as they need information from its result to perform their own logic
2023-04-21rustdoc: clean up redundant search hiding results codeMichael Howell-8/+1
* There's no need to call `history.replaceState` right before calling `searchState.hideResults`, which already does it. * There's no need to implement hiding search results when that is already implemented.
2023-04-21rustdoc: lift constant string manipulation out of loopMichael Howell-1/+1
2023-04-21rustdoc: use Set for ignored crates, instead of string matchingMichael Howell-2/+4
2023-04-21rustdoc: remove unnecessary bindingMichael Howell-5/+4
2023-04-21rustdoc: factor `document_type_layout` into its own moduleMichael Howell-77/+90
2023-04-21rustdoc: get rid of redundant, nested `let` linesMichael Howell-17/+13
2023-04-20rustdoc-search: use more descriptive "x not found; y instead" messageMichael Howell-1/+1
2023-04-20rustdoc-search: make type name correction choice deterministicMichael Howell-0/+3
2023-04-20rustdoc-search: clean up `checkIfInGenerics` call at end of `checkType`Michael Howell-5/+1
2023-04-20add subst_identity_iter and subst_identity_iter_copied methods on ↵Kyle Matsuda-4/+2
EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls
2023-04-20add EarlyBinder to output of explicit_item_bounds; replace ↵Kyle Matsuda-3/+3
bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query