about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-10-11Cleanup .item-table CSSStefan Schindler-1/+1
2021-10-11Rollup merge of #89736 - GuillaumeGomez:rm-unused-css-rule, r=dns2utf8Matthias Krüger-2/+0
Remove unused CSS rule As you can see in the firefox devtools: ![Screenshot from 2021-10-10 14-28-08](https://user-images.githubusercontent.com/3050060/136695689-16c77ceb-b1ab-40df-963a-048f2258e217.png) It needs the display to be `grid` or `inline-grid`, which isn't the case. r? `@dns2utf8`
2021-10-11Rollup merge of #89722 - jkugelman:cannonical-typo, r=joshtriplettMatthias Krüger-1/+1
Fix spelling: Cannonical -> Canonical
2021-10-11Rollup merge of #89632 - GuillaumeGomez:fix-docblock-code, r=jshaMatthias Krüger-0/+4
Fix docblock code display on mobile Fixes https://github.com/rust-lang/rust/issues/89618. Before: ![Screenshot from 2021-10-07 12-01-37](https://user-images.githubusercontent.com/3050060/136363624-72bedddd-b45e-48a0-89b4-6563612f8677.png) After: ![Screenshot from 2021-10-07 20-17-21](https://user-images.githubusercontent.com/3050060/136440704-fa9ffa68-8e94-46a7-b556-c41aa5153750.png) r? `@jsha`
2021-10-10Remove unused CSS ruleGuillaume Gomez-2/+0
2021-10-10Fix <code> blocks in doc blocks display on mobileGuillaume Gomez-0/+4
2021-10-10Fix spelling: Cannonical -> CanonicalJohn Kugelman-1/+1
2021-10-10Auto merge of #89695 - jsha:more-templates, r=GuillaumeGomezbors-55/+113
Move top part of print_item to Tera templates Part of #84419. This moves the first line of each item page (E.g. `Struct foo::Bar .... 1.0.0 [-][src]` into a Tera template. I also moved template initialization into its own module and added a small macro to reduce duplication and opportunity for errors.
2021-10-09Auto merge of #88379 - camelid:cleanup-clean, r=jyn514bors-514/+415
rustdoc: Cleanup various `clean` types Cleanup various `clean` types.
2021-10-09Remove some stray whitespace.Jacob Hoffman-Andrews-3/+3
2021-10-09Rollup merge of #89700 - GuillaumeGomez:fix-rustdoc-higher-bound-html-gen, ↵Guillaume Gomez-2/+6
r=notriddle Fix invalid HTML generation for higher bounds Considering this is a bug, I cherry-picked the commit from #89676 so it's merged more quickly. r? ``@notriddle``
2021-10-09Fix invalid HTML generation for higher boundsGuillaume Gomez-2/+6
2021-10-08Move template initialization into its own file.Jacob Hoffman-Andrews-15/+23
2021-10-08Add template for print_itemJacob Hoffman-Andrews-46/+96
Add print_item.html and the code in print_item.rs to use it.
2021-10-08Rollup merge of #89669 - Urgau:json-remove-type-never, r=GuillaumeGomezGuillaume Gomez-2/+1
Remove special-casing of never primitive in rustdoc-json-types Fixes https://github.com/rust-lang/rust/issues/89349 r? `@GuillaumeGomez`
2021-10-08Rollup merge of #89649 - matthiaskrgr:clippycompl, r=jyn514Guillaume Gomez-1/+1
clippy::complexity fixes
2021-10-08Rollup merge of #89538 - notriddle:notriddle/arrow-highlight, r=GuillaumeGomezGuillaume Gomez-6/+25
Make rustdoc not highlight `->` and `=>` as operators It was marking them up as `<span class="op">=</span><span class="op">&gt;</span>`, which is bloaty and wrong (at least, I think `<=` and `=>` should probably be different colors, since they're so different and yet made from the same symbols). Before: ![image](https://user-images.githubusercontent.com/1593513/135939748-f49b0f9e-6a7d-4d65-935a-e31cdf688a81.png) After: ![image](https://user-images.githubusercontent.com/1593513/135940063-5ef1f6b1-7e03-4227-b46b-572b063aba05.png)
2021-10-08clippy::complexity fixesMatthias Krüger-1/+1
2021-10-08Remove special-casing of never primitive in rustdoc-json-typesLoïc BRANSTETT-2/+1
2021-10-08Auto merge of #89576 - tom7980:issue-89275-fix, r=estebankbors-1/+2
Prevent error reporting from outputting a recursion error if it finds an ambiguous trait impl during suggestions Closes #89275 This fixes the compiler reporting a recursion error during another already in progress error by trying to make a conversion method suggestion and encounters ambiguous trait implementations that can convert a the original type into a type that can then be recursively converted into itself via another method in the trait. Updated OverflowError struct to be an enum so I could differentiate between passes - it's no longer a ZST but I don't think that should be a problem as they only generate when there's an error in compiling code anyway
2021-10-07Auto merge of #89638 - rust-lang:revert-88548-intersperse, r=Mark-Simulacrumbors-0/+1
Revert "Stabilize `Iterator::intersperse()`" Reverts rust-lang/rust#88548 First step in resolving https://github.com/rust-lang/rust/issues/88967
2021-10-07Revert "Stabilize `Iterator::intersperse()`"Jane Lusby-0/+1
2021-10-07Rollup merge of #89596 - GuillaumeGomez:implicit-doc-cfg, r=jyn514Guillaume Gomez-10/+73
Make cfg imply doc(cfg) This is a reopening of #79341, rebased and modified a bit (we made a lot of refactoring in rustdoc's types so they needed to be reflected in this PR as well): * `hidden_cfg` is now in the `Cache` instead of `DocContext` because `cfg` information isn't stored anymore on `clean::Attributes` type but instead computed on-demand, so we need this information in later parts of rustdoc. * I removed the `bool_to_options` feature (which makes the code a bit simpler to read for `SingleExt` trait implementation. * I updated the version for the feature. There is only one thing I couldn't figure out: [this comment](https://github.com/rust-lang/rust/pull/79341#discussion_r561855624) > I think I'll likely scrap the whole `SingleExt` extension trait as the diagnostics for 0 and >1 items should be different. How/why should they differ? EDIT: this part has been solved, the current code was fine, just needed a little simplification. cc `@Nemo157` r? `@jyn514` Original PR description: This is only active when the `doc_cfg` feature is active. The implicit cfg can be overridden via `#[doc(cfg(...))]`, so e.g. to hide a `#[cfg]` you can use something like: ```rust #[cfg(unix)] #[doc(cfg(all()))] pub struct Unix; ``` By adding `#![doc(cfg_hide(foobar))]` to the crate attributes the cfg `#[cfg(foobar)]` (and _only_ that _exact_ cfg) will not be implicitly treated as a `doc(cfg)` to render a message in the documentation.
2021-10-06Rollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomezManish Goregaokar-105/+217
librustdoc: Use correct heading levels. Closes #89309 This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy. - I ran a script to manually check that we don't have any files with multiple `<h1>` tags. - Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`. - I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).
2021-10-06Simplify AttributesExt::cfg function and remove error emissions since they ↵Guillaume Gomez-27/+10
are not useful
2021-10-06Clean up code a bit:Guillaume Gomez-8/+16
* Remove "bool_to_options" feature * Update version for compiler feature * rustfmt
2021-10-06Restore h1 styles, which got accidentally removed.Mukund Lakshman-3/+3
2021-10-05Issue 89275 fix and testTom Farmer-1/+2
Issue 89275 fix and test Fix librustdoc OverflowError usage rust tidy run Issue 89275 fix and test
2021-10-05Allow adding a set of cfg's to hide from being implicitly doc(cfg)'dWim Looman-9/+36
By adding #![doc(cfg_hide(foobar))] to the crate attributes the cfg #[cfg(foobar)] (and _only_ that _exact_ cfg) will not be implicitly treated as a doc(cfg) to render a message in the documentation.
2021-10-05Make cfg implicitly imply doc(cfg)Wim Looman-9/+54
This is only active when the `doc_cfg` feature is active. The implicit cfg can be overridden via #[doc(cfg(...))], so e.g. to hide a #[cfg] you can use something like: ```rust #[cfg(unix)] #[doc(cfg(all()))] pub struct Unix; ``` (since `all()` is always true, it is never shown in the docs)
2021-10-04Rollup merge of #88816 - dns2utf8:rustdoc_test_gui_2k_constants, ↵Manish Goregaokar-21/+17
r=GuillaumeGomez Rustdoc migrate to table so the gui can handle >2k constants Closes #88545. This PR adds a test for overlapping entries in the `item-table` https://github.com/rust-lang/rust/issues/88545 It currently includes the commit with the workaround from https://github.com/rust-lang/rust/pull/88776
2021-10-04Rollup merge of #88234 - hkmatsumoto:rustdoc-impls-for-primitive, r=jyn514Manish Goregaokar-3/+23
rustdoc-json: Don't ignore impls for primitive types Fix the issue discussed at [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Json.20output.20lacks.20some.20item.20which.20are.20supposed.20to.20be.20there) r? ``@jyn514``
2021-10-04Rollup merge of #89474 - camelid:better-pass-name, r=jyn514Jubilee-14/+14
rustdoc: Improve doctest pass's name and module's name As the docs at the top of the file say, it is an overloaded pass and actually runs two lints.
2021-10-04heading_level: u32 -> heading_offset: HeadingOffsetMukund Lakshman-59/+86
2021-10-04No need to default offset since we always override it.Mukund Lakshman-39/+35
2021-10-04Change `Markdown(...)` to `Markdown { ... }`Mukund Lakshman-38/+99
2021-10-04Fix heading for methods on trait impls.Mukund Lakshman-1/+1
2021-10-04Make rustdoc not highlight `->` and `=>` as operatorsMichael Howell-6/+25
It was marking them up as `<span class="op">=</span><span class="op">&gt;</span>`, which is bloaty and wrong.
2021-10-04Rollup merge of #89444 - notriddle:notriddle/contains-str, r=jyn514Jubilee-2/+2
rustdoc: use slice::contains instead of open-coding it
2021-10-04librustdoc: Use correct heading levels.Mukund Lakshman-59/+87
- Avoid multiple <h1>s on a page. - The <h#> tags should follow a semantic hierarchy. - Cap at h6 (no h7)
2021-10-03Fix implementation of `clean::Path::whole_name()`Noah Lev-1/+5
I think that before this commit, the path `::std::vec::Vec` would have rendered as `{{root}}::std::vec::Vec`. Now, it should render correctly as `::std::vec::Vec`.
2021-10-03Fix a place that used the old `Path` representationNoah Lev-2/+1
2021-10-03Rename `strip_path` to `strip_path_generics`Noah Lev-2/+3
The new name is more descriptive of what the function does.
2021-10-03Move from grid layout to table based layout because of browser limits that ↵Stefan Schindler-21/+17
overlay row entries after a UA specific amount of rows
2021-10-02Explain `ResolvedPath` vs `hir::Path`Noah Lev-1/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2021-10-02Replace all uses of `path.res.def_id()` with `path.def_id()`Noah Lev-19/+19
2021-10-02Remove outdated commentNoah Lev-2/+1
`CACHE_KEY` no longer exists.
2021-10-02Update `clean::Type` docsNoah Lev-25/+29
They've barely been updated since this version of `rustdoc` (originally called `rustdoc_ng`) was checked into the tree! Note that the formatting of a couple `Type` variants changed; rustfmt seems to change formatting based on whether all variants have docs.
2021-10-02Turn some comments into docsNoah Lev-57/+57
2021-10-02rustdoc: Improve doctest pass's name and module's nameNoah Lev-14/+14
As the docs at the top of the file say, it is an overloaded pass and actually runs two lints.