about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-07-05Auto merge of #86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomezbors-3/+2
Use rustdoc.css for error index Closes #86512.
2021-07-05Auto merge of #86282 - camelid:macro_rules-matchers, r=jyn514bors-47/+39
Pretty-print macro matchers instead of using source code Fixes #86208.
2021-07-03Pretty-print macro matchers instead of using source codeNoah Lev-47/+39
The output is not quite as nice as it used to be, but it does work.
2021-07-04Clean up rustdoc IDsGuillaume Gomez-4/+11
2021-07-03Warn when `rustdoc::` group is omitted from lint namesJoshua Nelson-1/+1
2021-07-02Rollup merge of #85749 - GuillaumeGomez:revert-smart-extern-crate-load, r=jyn514Guillaume Gomez-78/+37
Revert "Don't load all extern crates unconditionally" Fixes https://github.com/rust-lang/rust/issues/84738. This reverts https://github.com/rust-lang/rust/pull/83738. For the "smart" load of external crates, we need to be able to access their items in order to check their doc comments, which seems, if not impossible, quite complicated using only the AST. For some context, I first tried to extend the `IntraLinkCrateLoader` visitor by adding `visit_foreign_item`. Unfortunately, it never enters into this call, so definitely not the right place... I then added `visit_use_tree` to then check all the imports outside with something like this: ```rust let mut loader = crate::passes::collect_intra_doc_links::IntraLinkCrateLoader::new(resolver); ast::visit::walk_crate(&mut loader, krate); let mut items = Vec::new(); for import in &loader.imports_to_check { if let Some(item) = krate.items.iter().find(|i| i.id == *import) { items.push(item); } } for item in items { ast::visit::walk_item(&mut item); for attr in &item.attrs { loader.check_attribute(attr); } } ``` This was, of course, a failure. We find the items without problems, but we still can't go into the external crate to check its items' attributes. Finally, `@jyn514` suggested to look into the [`CrateLoader`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/creader/struct.CrateLoader.html), but it only seems to provide metadata (I went through [`CStore`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/creader/struct.CStore.html) and [`CrateMetadata`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/decoder/struct.CrateMetadata.html)). I think we are too limited here (with AST only) to be able to determine the crates we actually need to import, but it's very likely that I missed something. Maybe `@petrochenkov` or `@Aaron1011` have an idea? So until we find a way to make it work completely, we need to revert it to fix the ICE. Once merged, we'll need to re-open #68427. r? `@jyn514`
2021-07-01Auto merge of #86791 - JohnTitor:rollup-96ltzpz, r=JohnTitorbors-19/+88
Rollup of 7 pull requests Successful merges: - #86148 (Check the number of generic lifetime and const parameters of intrinsics) - #86659 (fix(rustdoc): generics search) - #86768 (Add myself to mailmap) - #86775 (Test for const trait impls behind feature gates) - #86779 (Allow anyone to add or remove any label starting with perf-) - #86783 (Move Mutex::unlock to T: ?Sized) - #86785 (proc_macro/bridge: Remove dead code Slice type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-01Auto merge of #86749 - bjorn3:link_info_refactor_part1, r=petrochenkovbors-3/+3
Rename all_crate_nums query to crates and remove useless wrapper Split out of https://github.com/rust-lang/rust/pull/86105 r? `@petrochenkov`
2021-07-01Revert "Don't load all extern crates unconditionally"Guillaume Gomez-78/+37
2021-07-01Rename all_crate_nums query to crates and remove useless wrapperbjorn3-3/+3
2021-07-01fix(rustdoc): generics searchMichael Howell-19/+88
This commit adds a test case for generics, re-adds generics data to the search index, and tweaks function indexing to use less space in JSON. This reverts commit 14ca89446c076bcf484d3d05bd991a4b7985a409.
2021-07-01Auto merge of #86757 - JohnTitor:rollup-acevhz7, r=JohnTitorbors-1/+2
Rollup of 8 pull requests Successful merges: - #85504 (the foundation owns rust trademarks) - #85520 (Fix typo and improve documentation for E0632) - #86680 (Improve error for missing -Z with debugging option) - #86728 (Check node kind to avoid ICE in `check_expr_return()`) - #86740 (copy rust-lld as ld in dist) - #86746 (Fix rustdoc query type filter) - #86750 (Test cross-crate usage of `feature(const_trait_impl)`) - #86755 (alloc: `RawVec<T, A>::shrink` can be in `no_global_oom_handling`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-07-01Rollup merge of #86746 - GuillaumeGomez:query-type-filter, r=notriddleYuki Okushi-1/+2
Fix rustdoc query type filter I realized while reviewing #86659 that the type filter was broken on search so I'd prefer it to get merged before merging #86659. r? `@notriddle`
2021-06-30Move AST crate.Camille GILLOT-3/+2
2021-06-30Inline lower_to_hir.Camille GILLOT-1/+0
2021-06-30Enforce search typed queriesGuillaume Gomez-1/+2
2021-06-30Auto merge of #86650 - GuillaumeGomez:fix-boldness, r=Nemo157bors-3/+9
Fix boldness (put it back where needed) I realized that I created a GUI test that wasn't run because it had ".rs" extension instead of ".goml" so I moved its content into `font-weight.goml` (since it was checking font weight).
2021-06-29Auto merge of #86725 - JohnTitor:normalizecss-8, r=GuillaumeGomezbors-3/+24
Upgrade normalize.css to v8.0.1 Fixes #86629, this addresses #82548 and #82542 with tweaks. I expect that this changes the style *slightly* but shouldn't have any major changes. Here's some changes I observed, I'd say they all are an improvement. <details> <summary>Before</summary> ![before 1](https://user-images.githubusercontent.com/25030997/123854746-0fc84800-d95a-11eb-8484-ea86dfe0ae14.png) ![before 2](https://user-images.githubusercontent.com/25030997/123854754-135bcf00-d95a-11eb-8cca-f49994629e08.png) </details> <details> <summary>After</summary> ![after 1](https://user-images.githubusercontent.com/25030997/123854809-21115480-d95a-11eb-9dd2-0d3b9ca45edd.png) ![after 2](https://user-images.githubusercontent.com/25030997/123854818-22428180-d95a-11eb-83aa-fb5a698124f9.png) </details> r? `@jsha`
2021-06-30Fix some style regressions due to normalize.css 8Yuki Okushi-2/+23
2021-06-30Upgrade normalize.css to v8.0.1Yuki Okushi-1/+1
2021-06-29Auto merge of #86603 - Mark-Simulacrum:stage-step, r=pietroalbinibors-2/+0
Update to new bootstrap compiler r? `@pietroalbini`
2021-06-28Move stab_tags to symbol in tablesStefan Schindler-4/+5
2021-06-28Update to new bootstrap compilerMark Rousskov-2/+0
2021-06-28Auto merge of #85876 - jeanlucthumm:master, r=GuillaumeGomezbors-4/+4
Add `go_to_first` query param to jump to first result Fixes #84214 Note that while the issue initially wanted to navigate to an entry on exact match, the discussion settled on using a query parameter (`&go_to_first=true`) instead, regardless of exact or partial match. Demonstration is attached https://user-images.githubusercontent.com/4934853/120258768-7ff28980-c247-11eb-8c8f-1a2ceb242788.mp4
2021-06-27Auto merge of #86589 - JohnTitor:add-triangle-to-summary, r=jshabors-4/+6
Show triangle on the "Details" disclosure element in all cases Re-submission of #82805, fixes the style issue by applying the same margin as `<p>`. <details><summary>Before</summary> ![before 1](https://user-images.githubusercontent.com/25030997/123215032-e4c99880-d502-11eb-9ccc-6df58f3a6b0b.png) ![before 2](https://user-images.githubusercontent.com/25030997/123215035-e5622f00-d502-11eb-9275-6c6dfcfdf72e.png) </details> <details><summary>After</summary> ![after 1](https://user-images.githubusercontent.com/25030997/123215037-e5fac580-d502-11eb-9b49-c99d1eafb1b4.png) ![after 2](https://user-images.githubusercontent.com/25030997/123215040-e5fac580-d502-11eb-8afc-ab713d3dc658.png) </details> r? `@GuillaumeGomez`
2021-06-27Auto merge of #85359 - lrh2000:reserved-prefixes, r=nikomatsakisbors-1/+1
Reserve prefixed identifiers and literals (RFC 3101) This PR denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip]. [Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099 The tracking issue #84599 says we'll add a feature gate named `reserved_prefixes`, but I don't think I can do this because it is impossible for the lexer to know whether a feature is enabled or not. I guess determining the behavior by the edition information should be enough. Fixes #84599
2021-06-27Add go_to_first boolean query param to immeidately jump to the first search ↵Jean-Luc Thumm-4/+4
result
2021-06-27Use rustdoc.css for error indexDeadbeef-3/+2
2021-06-27Add FIXME commentYuki Okushi-0/+1
2021-06-26Fix font weight on types, methods and associated types/constsGuillaume Gomez-3/+9
2021-06-26Auto merge of #86449 - Stupremee:render-self-cast-in-type-bound, ↵bors-3/+18
r=GuillaumeGomez rustdoc: Render `<Self as X>::Y` type casts properly across crate bounds My last PR that introduced the type casting did not work for cross-crate re-exported traits, which is fixed in this PR. Fully resolves #85454
2021-06-26Rename 'bad prefix' to 'unknown prefix'.Mara Bos-1/+1
2021-06-26Reserve prefixed identifiers and string literals (RFC 3101)lrh2000-1/+1
This commit denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip]. [Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099
2021-06-26Auto merge of #84814 - Stupremee:properly-render-hrtbs, r=GuillaumeGomezbors-106/+172
Properly render HRTBs ```rust pub fn test<T>() where for<'a> &'a T: Iterator, {} ``` This will now render properly including the `for<'a>` ![image](https://user-images.githubusercontent.com/39732259/116808426-fe6ce600-ab38-11eb-9452-f33f554fbb8e.png) I do not know if this covers all cases, it only covers everything that I could think of that includes `for` and lifetimes in where bounds. Also someone need to mentor me on how to add a proper rustdoc test for this. Resolves #78482
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-1/+1
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-26Rollup merge of #86608 - notriddle:notriddle/cleanup-rustdoc, r=jyn514Yuki Okushi-52/+7
chore(rustdoc): remove unused members of RenderType PR #86561 removes the only place the `generics` member is read. This PR does even more cleanup.
2021-06-26Rollup merge of #86513 - fee1-dead:cross-crate-doc-hidden, r=danielhenrymantillaYuki Okushi-1/+18
Rustdoc: Do not list impl when trait has doc(hidden) Fixes #86448.
2021-06-25Show triangle on the "Details" disclosure element in all casesYuki Okushi-4/+5
Co-authored-by: Miguel Ojeda <ojeda@kernel.org>
2021-06-24chore(rustdoc): remove unused members of RenderTypeMichael Howell-52/+7
Commit e629381653bb3579f0cea0b256e391edef5e8dbb removes the only place these members variables are actually read.
2021-06-24Migrate from custom elements to divs with classes to be compatible with safariStefan Schindler-21/+26
2021-06-24Hide Crate Version on narrow ScreensStefan Schindler-5/+21
2021-06-24Implement Desktop and Mobile version with gridlayoutStefan Schindler-16/+46
* implement sans-serif #85621
2021-06-24Rollup merge of #86561 - notriddle:notriddle/cleanup-rustdoc, r=jyn514Yuki Okushi-22/+0
chore(rustdoc): Remove unused impl block
2021-06-23Use HTTPS links where possibleSmitty-1/+1
2021-06-23Auto merge of #86548 - GuillaumeGomez:fix-crate-filter-search-reset, r=jshabors-0/+4
Fix crate filter search reset I found a fun bug when using rustdoc recently: I made a search, cut the search input content, changed the crate filter, pasted back the input content. To my surprise, the crate filter wasn't applied. It's because that our search input was empty when receiving the `<select>` "onchange" event. To fix this issue, I reset the `currentResults` variable to `null`. It's using the first commit from #86542 so it needs to wait for it before getting merged. r? `@jsha`
2021-06-23Fix search filter updateGuillaume Gomez-0/+4
2021-06-23Auto merge of #86564 - jsha:revert-83826, r=jyn514bors-8/+8
Revert "List trait impls before methods from deref in the sidebar ..." This reverts commit 8a058926ecd6d0988714f8f7a5a31293c533f8c6. Fixes #85618 r? `@jyn514`
2021-06-22Revert "List trait impls before methods from deref in the sidebar of ↵Jacob Hoffman-Andrews-8/+8
Rustdoc's output" This reverts commit 8a058926ecd6d0988714f8f7a5a31293c533f8c6.
2021-06-22chore(rustdoc): Remove unused impl blockMichael Howell-22/+0
2021-06-23Rollup merge of #86523 - LeSeulArtichaut:macros-disambiguators, r=jyn514Dylan DPC-27/+12
Improvements to intra-doc link macro disambiguators A few small improvements around macro disambiguators: - display the link text as it was entered: previously `[macro!()]` would be displayed without the parantheses (fixes #86309) - support `!{}` and `![]` as macro disambiguators (fixes #86310) r? `@jyn514` cc `@Manishearth` `@camelid`