about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2022-11-04Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomezMatthias Krüger-0/+14
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-02Properly render asyncness for traits without default bodyMichael Goulet-0/+14
2022-11-02Add regression test for doc of reexport of local itemsGuillaume Gomez-0/+16
2022-11-02Auto merge of #103649 - petrochenkov:docnotrait, r=GuillaumeGomezbors-0/+12
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-01Rollup merge of #103817 - notriddle:notriddle/attribute-css, r=GuillaumeGomezDylan DPC-4/+4
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 #103799 - GuillaumeGomez:search-index-tuple-struct-field, ↵Yuki Okushi-0/+18
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-10-31rustdoc: rename syntax highlighting CSS class `attribute` to `attr`Michael Howell-4/+4
Link classes use the abbreviation `attr`, so why shouldn't syntax highlighting?
2022-10-31Add test for tuple struct field generation in search indexGuillaume Gomez-0/+18
2022-10-30Rollup merge of #103746 - notriddle:notriddle/incoherent-dyn-trait, ↵Michael Howell-0/+35
r=GuillaumeGomez rustdoc: add support for incoherent impls on structs and traits Fixes #103170
2022-10-30rustdoc: Do not add external traits to the crate in `register_res`Vadim Petrochenkov-0/+12
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-29rustdoc: add support for incoherent impls on structs and traitsMichael Howell-0/+35
Fixes #103170
2022-10-30Rollup merge of #103253 - notriddle:notriddle/test-case-masked-blanket-impl, ↵Matthias Krüger-0/+5
r=Mark-Simulacrum rustdoc: add test case for masked blanket impl
2022-10-28Rollup merge of #103523 - GuillaumeGomez:inline-doc-comment-impl-block, ↵Matthias Krüger-0/+13
r=notriddle Fix unwanted merge of inline doc comments for impl blocks Fixes https://github.com/rust-lang/rust/issues/102909. We need this merge mechanism for inlined items but it's completely unwanted for impl blocks (at least the doc comments are, not the other attributes) since we want to keep what `cfg()` is put on the `pub use` or other attributes. r? ``@notriddle``
2022-10-27Rollup merge of #103408 - compiler-errors:rpitit-rustdoc, r=GuillaumeGomezMatthias Krüger-0/+25
Clean return-position `impl Trait` in traits correctly in rustdoc Fixes #103403
2022-10-27Rollup merge of #103432 - jsha:box-is-not-notable, r=GuillaumeGomezYuki Okushi-0/+38
rustdoc: don't mark Box<T> as Iterator, Read, etc Because Box<T> has pass-through implementations, rustdoc was giving it the "Notable Traits" treatment for Iterator, Read, Write, and Future, even when the type of T was unspecified. Pin had the same problem, but just for Future. Fixes #100320
2022-10-25Add regression test for inlined doc comment on impl blockGuillaume Gomez-0/+13
2022-10-23rustdoc: don't mark Box<T> as Iterator, Read, etcJacob Hoffman-Andrews-0/+38
Because Box<T> has pass-through implementations, rustdoc was giving it the "Notable Traits" treatment for Iterator, Read, Write, and Future, even when the type of T was unspecified. Pin had the same problem, but just for Future.
2022-10-23Rollup merge of #103254 - fmease:fix-24183, r=GuillaumeGomezMichael Howell-0/+33
rustdoc: do not filter out cross-crate `Self: Sized` bounds All type parameters **except `Self`** are implicitly `Sized` ([via](https://doc.rust-lang.org/nightly/std/marker/trait.Sized.html)). Previously, we disregarded the exception of `Self` and omitted cross-crate `Sized` bounds of *any* type parameter *including* `Self` when rendering. From now on, we *do* render cross-crate `Self: Sized` bounds. Most notably, in `std` we now finally properly render the `Sized` bound of the `Clone` trait as well as the `Self: Sized` bound on `Iterator::map`. Fixes #24183. ``@rustbot`` label T-rustdoc A-cross-crate-reexports r? rustdoc
2022-10-23Rollup merge of #103368 - compiler-errors:normalization-ambiguity-bug, r=oli-obkMatthias Krüger-0/+24
Delay ambiguity span bug in normalize query iff not rustdoc Oli and I decided that the compiler debt of adding another usage of `tcx.sess.opts.actually_rustdoc` is fine, because we don't really want to add more complexity to the normalize query, and moving rustdoc to use fulfill normalization (`fully_normalize`, i.e. not use the normalize query) is unnecessary overhead given that it's skipping binders and stuff. r? oli-obk Fixes #102827 Fixes #103181
2022-10-22Clean middle RPITITs correctly in rustdocMichael Goulet-0/+25
2022-10-21testsMichael Goulet-0/+24
2022-10-19rustdoc: render bounds of cross-crate GAT paramsLeón Orell Valerian Liehr-8/+11
2022-10-19rustdoc: add test case for masked blanket implMichael Howell-0/+5
2022-10-19rustdoc: Do not filter out `Self: Sized` boundsLeón Orell Valerian Liehr-0/+33
2022-10-17Rollup merge of #103091 - notriddle:notriddle/sidebar-title, r=GuillaumeGomezMatthias Krüger-22/+22
rustdoc: remove unused HTML class `sidebar-title` Since 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c, this class is no longer styled.
2022-10-17Rollup merge of #103129 - notriddle:notriddle/sub-logo-container, ↵Matthias Krüger-3/+3
r=GuillaumeGomez rustdoc: remove unused `.sub-logo-container` DOM on non-source pages
2022-10-17Auto merge of #103096 - petrochenkov:indresdoc, r=cjgillotbors-0/+12
resolve: Shadow erroneous glob imports with erroneous single imports If such shadowing doesn't happen we end up in a weird state that may cause ICEs. (In non-erroneous cases single imports always shadow glob imports too.) Fixes https://github.com/rust-lang/rust/issues/100047 Fixes https://github.com/rust-lang/rust/issues/100241
2022-10-16rustdoc: remove unused `.sub-logo-container` DOM on non-source pagesMichael Howell-3/+3
2022-10-16rustdoc: Do not expect `doc(primitive)` modules to always existVadim Petrochenkov-0/+15
2022-10-16resolve: Shadow erroneous glob imports with erroneous single importsVadim Petrochenkov-0/+12
2022-10-15rustdoc: update test cases for `.sidebar-title` -> `.sidebar-elems h3`Michael Howell-22/+22
2022-10-11Rollup merge of #102898 - notriddle:notriddle/sidebar-block, r=GuillaumeGomezYuki Okushi-2/+2
rustdoc: remove unneeded `<div>` wrapper from sidebar DOM When this was added, the sidebar had a bit more complex style. It can be removed, now. Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-block/std/index.html
2022-10-10rustdoc: remove unneeded `<div>` wrapper from sidebar DOMMichael Howell-2/+2
When this was added, the sidebar had a bit more complex style. It can be removed, now.
2022-10-10Update rustdoc testsGuillaume Gomez-1/+1
2022-10-09Don't use unnormalized type in Ty::fn_sigMichael Goulet-0/+13
2022-10-06rustdoc: remove unused HTML `class="item-list"`Michael Howell-6/+6
Since 50f662e99ec372a3c9558876d4164e8665859217, there is no CSS or JS targeting this class.
2022-10-06Auto merge of #102707 - ↵bors-5/+29
fmease:rustdoc-render-more-cross-crate-hrtbs-properly, r=GuillaumeGomez rustdoc: render more cross-crate HRTBs properly Follow-up to #102439. Render the `for<>` parameter lists of cross-crate higher-rank trait bounds (in where-clauses and in `impl Trait`). I've added a new field `bound_params` to `clean::WherePredicate::EqPredicate` (mirroring its sibling variant `BoundPredicate`). However, I had to box the existing fields since `EqPredicate` used to be the largest variant (128 bytes on 64-bit systems) and it would only have gotten bigger). Not sure if you like that approach. As an alternative, I could pass the uncleaned `ty::Predicate` alongside the cleaned `WherePredicate` to the various re-sugaring methods (similar to what `clean::AutoTraitFinder::param_env_to_generics` does). I haven't yet added the HTML & JSON rendering code for the newly added `bound_params` field since I am waiting for your opinion. Those two rendering code paths should actually be unreachable in practice given we re-sugar all(?) equality predicates to associated type bindings (and arbitrary equality predicates are not part of the Rust surface language at the time of this writing). If you agree with storing `bound_params` in `EqPredicate`, I think I can use it to greatly simplify the `clean::auto_trait` module (by also using `simplify::merge_bounds`). Maybe I can do that in any case though. `@rustbot` label T-rustdoc A-cross-crate-reexports r? `@GuillaumeGomez`
2022-10-05rustdoc: remove unused CSS class `in-band`Michael Howell-7/+7
Since a7c25b29575c17434406b69773f8c2961af343b3 removed `in-band` from code headers, the only remaining uses of the `in-band` class are: https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/write_shared.rs#L520-L521 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/templates/print_item.html#L2-L3 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/context.rs#L637-L638 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L368-L369 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/render/mod.rs#L401-L402 https://github.com/rust-lang/rust/blob/02cd79afb8080fce8c8ce35533c54d8ecf8f390e/src/librustdoc/html/static/js/main.js#L525 Since all of these uses are nested below `h1.fqn`, we can get rid of it, and the support code that was used for when `in-band` was part of item rendering.
2022-10-05rustdoc: render more cross-crate hrtbs properlyLeón Orell Valerian Liehr-5/+29
2022-10-03Rollup merge of #102439 - fmease:rustdoc-simplify-cross-crate-trait-bounds, ↵Matthias Krüger-0/+82
r=GuillaumeGomez rustdoc: re-sugar more cross-crate trait bounds Previously, we would only ever re-sugar cross-crate predicates like `Type: Trait, <Type as Trait>::Name == Rhs` to `Type: Trait<Name = Rhs>` if the `Type` was a generic parameter like `Self` or `T`. With this PR, `Type` can be any type. Most notably, this means that we now re-sugar predicates involving associated types (where `Type` is of the form `Self::Name`) which are then picked up by the pre-existing logic that re-sugars them into bounds. As a result of that, the associated type `IntoIter` of `std`'s `IntoIterator` trait (re-exported from `core`) is no longer rendered as: ```rust type IntoIter: Iterator where <Self::IntoIter as Iterator>::Item == Self::Item; ``` but as one would expect: `type IntoIter: Iterator<Item = Self::Item>;`. Cross-crate closure bounds like `F: Fn(i32) -> bool` are now also rendered properly (previously, the return type (`Self::Output`) would not be rendered and we would show the underlying equality predicate). Fixes #77763. Fixes #84579. Fixes #102142. `@rustbot` label T-rustdoc A-cross-crate-reexports r? rustdoc
2022-10-03rustdoc: re-sugar more cross-crate trait boundsLeón Orell Valerian Liehr-0/+82
2022-10-02Rollup merge of #102525 - notriddle:notriddle/array-link, r=GuillaumeGomez,jshaMatthias Krüger-0/+32
rustdoc: remove orphaned link on array bracket This is #98069, but for arrays instead. For non-generics, this retains links to the array page, but instead of trying to link it all, it only links the length part, which distinguishes arrays from slices. For generics, the entire thing becomes a link, just like slices. | Type | Before | After | |--|--|--| | u32 | <code>pub fn alpha() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a><a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">; 1]</a></code> | <code>pub fn alpha() -&gt; &amp;'static [<a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>; <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">1</a>]</code> | generic | <code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[</a>T<a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">; 1]</a></code> | <code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="http://doc.rust-lang.org/nightly/core/primitive.array.html">[T; 1]</a></code>
2022-09-30rustdoc: remove orphaned link on array bracketMichael Howell-0/+32
This is 682889fb06591c4245422b73b005c5d8ae2d0cad, but for arrays instead. For non-generics, this retains links to the array page, but instead of trying to link it all, it only links the length part, which distinguishes arrays from slices. For generics, the entire thing becomes a link, just like slices.
2022-09-30rustdoc: update test cases for `<section>` tags in traitsMichael Howell-8/+8
2022-09-28rustdoc: add method spacing to trait methodsMichael Howell-6/+6
More cleanup for 8846c0853d8687fda0e5f23f6687b03b243980ee, this time in trait layouts when things are collapsed.
2022-09-27attributes: Add #[rustc_safe_intrinsic] builtinArthur Cohen-0/+2
2022-09-25rustdoc: update test cases now that code-header is used without in-bandMichael Howell-143/+143
2022-09-22Rollup merge of #102107 - Urgau:rustdoc-missing-space-before-where-clause, ↵Dylan DPC-1/+18
r=GuillaumeGomez Add missing space between notable trait tooltip and where clause This PR add a missing space between the notable trait tooltip and the where clause. The issue can be seeing on the [BufRead](https://doc.rust-lang.org/nightly/std/io/trait.BufRead.html) page. Added a simple snapshot regression test in `src/test/rustdoc/where.rs`. Before: ![image](https://user-images.githubusercontent.com/3616612/191566999-2f80e138-29c9-4f66-8bed-07781cbd9783.png) After: ![image](https://user-images.githubusercontent.com/3616612/191567025-0ed3f7d4-7cec-4788-901f-5980fc241daa.png) r? `@GuillaumeGomez`
2022-09-22Rollup merge of #102054 - GuillaumeGomez:sidebar-all-page, r=notriddleYuki Okushi-0/+35
Unify "all items" page's sidebar with other pages Currently, the "all types" page's sidebar doesn't list the different categories of type available. This PR fixes it. Before: ![Screenshot from 2022-09-20 17-11-15](https://user-images.githubusercontent.com/3050060/191296348-95d8771d-a887-432e-96bd-d5284d87d743.png) After: ![Screenshot from 2022-09-20 17-11-09](https://user-images.githubusercontent.com/3050060/191296344-8e7318a3-eb51-4037-ae94-7ae2115363ce.png) r? `@notriddle`
2022-09-21Add missing space between notable trait tooltip and where clauseUrgau-1/+18