about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-11-04rustdoc: add test for cross-crate trait-object typesLeón Orell Valerian Liehr-0/+3
as well as some FIXMEs
2022-11-04rustdoc: render the return type of cross-crate `Fn`-family trait bounds in ↵León Orell Valerian Liehr-7/+7
trait-object types
2022-11-04rustdoc: render `for<>` param lists of cross-crate trait-object typesLeón Orell Valerian Liehr-2/+19
2022-11-04rustdoc: move cross-crate lifetime/outlives bounds on GAT params from ↵León Orell Valerian Liehr-1/+10
where-clause to param declaration site I've overlooked this in #103190.
2022-11-04rustdoc: render unnamed arguments as underscores in cross-crate functions & ↵León Orell Valerian Liehr-14/+17
function pointers for consistency with the way we display local definitions (cleaned from HIR, not from rustc_middle).
2022-11-04rustdoc: render late-bound lifetimes in generic parameter list of ↵León Orell Valerian Liehr-7/+34
cross-crate functions and methods
2022-11-04Rollup merge of #103935 - GuillaumeGomez:remove-rustdoc-visibility-ty, ↵Matthias Krüger-153/+129
r=notriddle Remove rustdoc clean::Visibility type Fixes #90852. Follow-up of https://github.com/rust-lang/rust/pull/103690. This PR completely removes the rustdoc `clean::Visibility` type to use the `rustc_middle` one instead. I don't think there will be any impact on perf. r? `@notriddle`
2022-11-04Auto merge of #103954 - matthiaskrgr:rollup-tskpxnj, r=matthiaskrgrbors-21/+21
Rollup of 10 pull requests Successful merges: - #103825 (Remove let_underscore_must_use from list of uplifted lints) - #103884 (Add visit_fn_ret_ty to hir intravisit) - #103892 (Properly render asyncness for trait fns without default body) - #103905 (rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`) - #103912 (Add howto for adding new targets) - #103915 (Improve use of ErrorGuaranteed and code cleanup) - #103930 (Move some tests from `src/test/ui` to more reasonable places) - #103931 (Add note to RELEASES.md regarding issue 102754.) - #103938 (rustdoc: clean up hardcoded CSS border color on search results) - #103940 (rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-04Rollup merge of #103940 - ↵Matthias Krüger-1/+0
notriddle:notriddle/main-content-item-info-margin-top, r=GuillaumeGomez rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }` When this line was added in 04b4c40682c01cad8f9bc8d5b3907be91d6f81d4, it overrode a negative `margin-top` that was set on it by default. https://github.com/rust-lang/rust/blob/04b4c40682c01cad8f9bc8d5b3907be91d6f81d4/src/librustdoc/html/static/rustdoc.css#L500-L516 That negative top margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
2022-11-04Rollup merge of #103938 - notriddle:notriddle/search-results-border-bottom, ↵Matthias Krüger-2/+1
r=GuillaumeGomez rustdoc: clean up hardcoded CSS border color on search results Hardcoded colors in rustdoc.css should usually be avoided. Preview: http://notriddle.com/notriddle-rustdoc-demos/border-bottom-search/test_dingus/?search=test
2022-11-04Rollup merge of #103905 - notriddle:notriddle/sidebar-elems-background, ↵Matthias Krüger-1/+0
r=GuillaumeGomez rustdoc: remove redundant mobile CSS `.sidebar-elems { background }` The exact same background is already set for its parent, the `nav.sidebar`.
2022-11-04Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomezMatthias Krüger-17/+20
Properly render asyncness for trait fns without default body We weren't properly desugaring async fns in traits unless they had default bodies (in which case rustdoc treats them much like they came from an impl). cc ```@yoshuawuyts``` should help with https://rust-lang.zulipchat.com/#narrow/stream/330606-wg-async.2Fasync-fn-in-trait-impl/topic/type.20inside.20.60async.20fn.60.20body.20must.20be.20known.20in.20this.20context/near/306894869
2022-11-04Auto merge of #102928 - notriddle:notriddle/rustdoc-thin-vec, r=GuillaumeGomezbors-65/+62
rustdoc: use ThinVec for cleaned generics Depends on https://github.com/Gankra/thin-vec/pull/38
2022-11-03rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`Michael Howell-1/+0
When this line was added in 04b4c40682c01cad8f9bc8d5b3907be91d6f81d4, it overrode a negative `margin-top` that was set on it by default. https://github.com/rust-lang/rust/blob/04b4c40682c01cad8f9bc8d5b3907be91d6f81d4/src/librustdoc/html/static/rustdoc.css#L500-L516 That negative top margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
2022-11-03rustdoc: clean up hardcoded CSS border color on search resultsMichael Howell-2/+1
Hardcoded colors in rustdoc.css should usually be avoided.
2022-11-03Remove rustdoc clean::Visibility typeGuillaume Gomez-153/+129
2022-11-03roll another resolution logic in rustdocDeadbeef-1/+2
2022-11-02rustdoc: add size tracking for `Generics`Michael Howell-0/+1
2022-11-02rustdoc: remove unneeded Box from ItemKindMichael Howell-4/+4
2022-11-02rustdoc: use ThinVec for cleaned genericsMichael Howell-61/+57
2022-11-02rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`Michael Howell-1/+0
The exact same background is already set for its parent, the `nav.sidebar`.
2022-11-02Rollup merge of #103890 - notriddle:notriddle/mobile-rustdoc-padding-top, ↵Matthias Krüger-1/+0
r=GuillaumeGomez rustdoc: remove unused mobile CSS `.rustdoc { padding-top: 0 }` When this rule was added in dd437ee6ed81f85c715bf415d261feca484bb39f, as `body { padding-top: 0 }`, the desktop body tag had non-zero top padding. This padding was removed in 135281ed1525db15edd8ebd092aa10aa40df2386. This rule no longer overrides a rule in rustdoc's desktop styles, and also doesn't override the UA stylesheet, since the [HTML standard] has only margin, not padding, on the page body. [HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
2022-11-02Rollup merge of #103886 - GuillaumeGomez:local-reexport-doc, r=notriddleMatthias Krüger-18/+37
rustdoc: Fix merge of attributes for reexports of local items Fixes https://github.com/rust-lang/rust/issues/84619. The problem was that we didn't merge attributes between the the reexport and the item. r? `@notriddle`
2022-11-02Properly render asyncness for traits without default bodyMichael Goulet-17/+20
2022-11-02rustdoc: remove unused mobile CSS `.rustdoc { padding-top: 0 }`Michael Howell-1/+0
When this rule was added in dd437ee6ed81f85c715bf415d261feca484bb39f, as `body { padding-top: 0 }`, the desktop body tag had non-zero top padding. This padding was removed in 135281ed1525db15edd8ebd092aa10aa40df2386. This rule no longer overrides a rule in rustdoc's desktop styles, and also doesn't override the UA stylesheet, since the [HTML standard] has only margin, not padding, on the page body. [HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
2022-11-02Rollup merge of #103855 - notriddle:notriddle/mobile-item-table, ↵Dylan DPC-8/+1
r=GuillaumeGomez rustdoc: simplify mobile item-table CSS Using flexbox in column direction is needlessly complicated, since no special flex powers are being used here. Just use regular block layout. This should result in no visible changes.
2022-11-02Fix merge of attributes for reexports of local itemsGuillaume Gomez-18/+37
2022-11-02Auto merge of #103690 - GuillaumeGomez:visibility-on-demand, r=notriddlebors-145/+144
Make rustdoc Item::visibility computed on-demand This is a take-over of https://github.com/rust-lang/rust/pull/91408. Helps with https://github.com/rust-lang/rust/issues/90852 (needs to use `ty::Visibility` directly too). cc `@camelid` r? `@notriddle`
2022-11-02Auto merge of #103649 - petrochenkov:docnotrait, r=GuillaumeGomezbors-4/+0
rustdoc: Do not add external traits to the crate in `register_res` It's not clear why it was done, and apparently it's no longer necessary now. Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits. Fixes https://github.com/rust-lang/rust/issues/103463
2022-11-01rustdoc: simplify mobile item-table CSSMichael Howell-8/+1
Using flexbox in column direction is needlessly complicated, since no special flex powers are being used here. Just use regular block layout. This should result in no visible changes.
2022-11-01Auto merge of #103217 - mejrs:track, r=eholkbors-0/+5
Track where diagnostics were created. This implements the `-Ztrack-diagnostics` flag, which uses `#[track_caller]` to track where diagnostics are created. It is meant as a debugging tool much like `-Ztreat-err-as-bug`. For example, the following code... ```rust struct A; struct B; fn main(){ let _: A = B; } ``` ...now emits the following error message: ``` error[E0308]: mismatched types --> src\main.rs:5:16 | 5 | let _: A = B; | - ^ expected struct `A`, found struct `B` | | | expected due to this -Ztrack-diagnostics: created at compiler\rustc_infer\src\infer\error_reporting\mod.rs:2275:31 ```
2022-11-01Rollup merge of #103817 - notriddle:notriddle/attribute-css, r=GuillaumeGomezDylan DPC-7/+7
rustdoc: rename syntax highlighting CSS class `attribute` to `attr` Link classes use the abbreviation `attr` ... https://github.com/rust-lang/rust/blob/2afca78a0b03db144c5d8b9f8868feebfe096309/src/librustdoc/html/static/css/rustdoc.css#L255-L259 ... so why does syntax highlighting use the full word? https://github.com/rust-lang/rust/blob/2afca78a0b03db144c5d8b9f8868feebfe096309/src/librustdoc/html/static/css/rustdoc.css#L1095-L1097
2022-11-01Rollup merge of #103813 - notriddle:notriddle/search-results-clear-both, ↵Dylan DPC-2/+0
r=GuillaumeGomez rustdoc: remove unnecessary CSS `.search-results { clear: both }` Since the tabs use flexbox instead of float as of 44d9b8d07014d976c88f541dbe0af37e64e37bdd, clearing does nothing.
2022-11-01Rollup merge of #103799 - GuillaumeGomez:search-index-tuple-struct-field, ↵Yuki Okushi-15/+22
r=notriddle Remove generation of tuple struct fields in the search index This comes from [this discussion](https://github.com/rust-lang/rust/pull/103710) as they're not very useful. r? `@notriddle`
2022-11-01Rollup merge of #103793 - notriddle:notriddle/rustdoc-toggle-in-impl-items, ↵Yuki Okushi-6/+8
r=GuillaumeGomez rustdoc: add margins to all impl-item toggles, not just methods Fixes #103782 ## Before ![image](https://user-images.githubusercontent.com/1593513/198943087-8cab8b25-2092-49d6-89b4-caa2989dedf0.png) ## After ![image](https://user-images.githubusercontent.com/1593513/198943111-bc08c2d6-f058-4362-b999-0caf09eb93bf.png)
2022-10-31rustdoc: remove left border from `.src-line-numbers > a`Michael Howell-3/+5
2022-10-31rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`Michael Howell-21/+27
This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.
2022-10-31rustdoc: rename syntax highlighting CSS class `attribute` to `attr`Michael Howell-7/+7
Link classes use the abbreviation `attr`, so why shouldn't syntax highlighting?
2022-10-31rustdoc: remove unnecessary CSS `.search-results { clear: both }`Michael Howell-2/+0
Since the tabs use flexbox instead of float as of 44d9b8d07014d976c88f541dbe0af37e64e37bdd, clearing does nothing.
2022-10-31Don't generate tuple struct fields into the search indexGuillaume Gomez-15/+22
2022-10-30rustdoc: add margins to all impl-item toggles, not just methodsMichael Howell-6/+8
Fixes #103782
2022-10-30Rollup merge of #103746 - notriddle:notriddle/incoherent-dyn-trait, ↵Michael Howell-0/+15
r=GuillaumeGomez rustdoc: add support for incoherent impls on structs and traits Fixes #103170
2022-10-30Rollup merge of #101944 - notriddle:notriddle/toggle-all-docs, ↵Michael Howell-7/+14
r=jsha,GuillaumeGomez rustdoc: clean up `#toggle-all-docs` This change converts the element from an `<a>` link to a button. It's pretty much directly trading slightly more CSS for slightly less HTML, and it's also semantically correct (so you don't get a broken "bookmark" option when you right click on it). While doing this, I also got rid of the unnecessary `class="inner"` attribute on the inner span. There was a style targeting `.collapse-toggle > .inner`, but no CSS ever targeted the `#toggle-all-docs > .inner`. Preview: https://notriddle.com/notriddle-rustdoc-test/button-toggle-all-docs/index.html
2022-10-30Make rustdoc Item::visibility computed on-demandGuillaume Gomez-145/+144
2022-10-30rustdoc: Do not add external traits to the crate in `register_res`Vadim Petrochenkov-4/+0
It's not clear why it was done, and apparently it's no longer necessary now. Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits.
2022-10-30Auto merge of #103010 - petrochenkov:effvisdoc, r=GuillaumeGomezbors-112/+92
rustdoc: Simplify modifications of effective visibility table It is now obvious that rustdoc only calls `set_access_level` with foreign def ids and `AccessLevel::Public`. The second commit makes one more step and separates effective visibilities coming from rustc from similar data collected by rustdoc for extern `DefId`s. The original table is no longer modified and now only contains local def ids as populated by rustc. cc https://github.com/rust-lang/rust/pull/102026 `@Bryanskiy`
2022-10-30Rollup merge of #103740 - notriddle:notriddle/search-results-padding-bottom, ↵Dylan DPC-1/+0
r=Dylan-DPC rustdoc: remove unnecessary CSS `.search-results { padding-bottom }` There's nothing underneath it anyway. The conversation on #84462 never really spelled out why it was added.
2022-10-30Rollup merge of #103588 - weihanglo:rustdoc/url-redirect, r=notriddleDylan DPC-1/+1
rustdoc: add missing URL redirect https://github.com/rust-lang/rust/pull/94753 missed some redirect settings, and one of the missing URL shows up in an error message. This PR adds those redirects.
2022-10-29rustdoc: add support for incoherent impls on structs and traitsMichael Howell-0/+15
Fixes #103170
2022-10-30Rollup merge of #103737 - notriddle:notriddle/margin, r=GuillaumeGomezMatthias Krüger-10/+3
rustdoc: use CSS margin/padding shorthand when all are being set