about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2021-01-10Auto merge of #77862 - danielhenrymantilla:rustdoc/fix-macros_2_0-paths, ↵bors-0/+95
r=jyn514,petrochenkov Rustdoc: Fix macros 2.0 and built-in derives being shown at the wrong path Fixes #74355 - ~~waiting on author + draft PR since my code ought to be cleaned up _w.r.t._ the way I avoid the `.unwrap()`s:~~ - ~~dummy items may avoid the first `?`,~~ - ~~but within the module traversal some tests did fail (hence the second `?`), meaning the crate did not possess the exact path of the containing module (`extern` / `impl` blocks maybe? I'll look into that).~~ r? `@jyn514`
2021-01-08Auto merge of #80653 - jryans:doc-deref-recursive, r=jyn514,GuillaumeGomezbors-2/+72
Recursively document methods via `Deref` traits This changes `rustdoc` to recursively follow `Deref` targets so that methods from all levels are added to the rendered output. This implementation displays the methods from all levels in the expanded state with separate sections for each level. ![image](https://user-images.githubusercontent.com/279572/103482863-46723b00-4ddb-11eb-972b-c463351a425c.png) Fixes https://github.com/rust-lang/rust/issues/26207 Fixes https://github.com/rust-lang/rust/issues/53038 Fixes https://github.com/rust-lang/rust/issues/71640 r? `@jyn514`
2021-01-08Preserve non-local recursive `Deref` implsJ. Ryan Stinnett-0/+26
This adjusts the `rustdoc` trait impl collection path to preserve `Deref` impls from other crates. This adds a first pass to map all of the `Deref` type to target edges and then recursively preserves all targets.
2021-01-08Use target in `Deref` method section IDsJ. Ryan Stinnett-6/+10
There can now be multiple `Deref` method sections, so this adds the target type to the section ID to ensure they are unique.
2021-01-08Recursively document methods via `Deref` traitsJ. Ryan Stinnett-0/+40
2021-01-08Rollup merge of #80799 - jyn514:pretty-print, r=CraftSpiderYuki Okushi-0/+5
Get rid of custom pretty-printing in rustdoc and use rustc_hir_pretty directly instead. Closes https://github.com/rust-lang/rust/issues/79497. r? `@CraftSpider`
2021-01-07Get rid of custom pretty-printing in rustdocJoshua Nelson-0/+5
and use rustc_hir_pretty directly instead
2021-01-08Rollup merge of #80660 - max-heller:issue-80559-fix, r=jyn514Yuki Okushi-0/+4
Properly handle primitive disambiguators in rustdoc Fixes #80559 r? ``@jyn514`` Is there a way to test that the generated intra-doc link is what I expect?
2021-01-06Fix ICE on `pub macro`s defined within a non-module type namespace.Daniel Henry-Mantilla-0/+8
2021-01-06Enhance tests based on code reviewDaniel Henry-Mantilla-1/+2
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-06Update test assertions (showcases bug)Daniel Henry-Mantilla-7/+31
2021-01-06Fix type/value namespace clashes + test for thatDaniel Henry-Mantilla-2/+47
2021-01-06Implement suggestions from code review.Daniel Henry-Mantilla-4/+12
2021-01-06Rustdoc: Fix macros 2.0 and built-in derives being shown at the wrong path.Daniel Henry-Mantilla-0/+9
Fixes #74355 The issue with the built-in derives may be related to: https://github.com/rust-lang/rust/issues/55482#issuecomment-434035721
2021-01-05Add rustdoc test.Camille GILLOT-0/+14
2021-01-04fix incompatible disambiguator testmax-heller-2/+0
2021-01-04Auto merge of #80661 - jyn514:duplicate-types, r=GuillaumeGomezbors-3/+16
Cleanup rustdoc handling of associated types This is best reviewed a commit at a time. No particular reason for these changes, they just stood out as I was reviewing https://github.com/rust-lang/rust/pull/80653 and thinking about https://github.com/rust-lang/rust/issues/80379. The new test case worked before, it just wasn't tested. r? `@GuillaumeGomez`
2021-01-03primitive disambiguator testsmax-heller-4/+6
2021-01-03fix issue 80559max-heller-0/+4
2021-01-03Simplify rustdoc handling of type aliases for associated typesJoshua Nelson-3/+16
The logic was very hard to follow before.
2021-01-01Auto merge of #80565 - camelid:fix-not-has, r=GuillaumeGomezbors-3/+3
Fix tests that incorrectly used `!@has` instead of `@!has` The command is ``@!has`,` not `!`@has`.` I don't think these checks were doing anything before! Ideally we would accept `!`@has`` as well, or at least fail tests that use `!`@has`.` The current behavior seems to be silently ignoring the check, which is very confusing. r? `@GuillaumeGomez`
2020-12-31Rollup merge of #80368 - camelid:rustdoc-succinct-vis, r=jyn514Dylan DPC-32/+44
rustdoc: Render visibilities succinctly Fixes #79139. r? `@jyn514`
2020-12-31Fix tests that incorrectly used `!@has` instead of `@!has`Camelid-3/+3
The command is `@!has`, not `!@has`. I don't think these checks were doing anything before! Ideally we would accept `!@has` as well, or at least fail tests that use `!@has`. The current behavior seems to be silently ignoring the check, which is very confusing.
2020-12-31Add `@!has` checks to ensure private items don't have `pub`Camelid-0/+4
2020-12-31Auto merge of #80267 - 0urobor0s:ouro/61592, r=jyn514bors-0/+19
Rustdoc render public underscore_imports as Re-exports Fixes #61592
2020-12-31Rustdoc render public underscore_imports as Re-exportsbors-0/+19
Fixes #61592
2020-12-27Auto merge of #80181 - jyn514:intra-doc-primitives, r=Manishearthbors-0/+39
Fix intra-doc links for non-path primitives This does *not* currently work for associated items that are auto-implemented by the compiler (e.g. `never::eq`), because they aren't present in the source code. I plan to fix this in a follow-up PR. Fixes https://github.com/rust-lang/rust/issues/63351 using the approach mentioned in https://github.com/rust-lang/rust/issues/63351#issuecomment-683352130. r? `@Manishearth` cc `@petrochenkov` - this makes `rustc_resolve::Res` public, is that ok? I'd just add an identical type alias in rustdoc if not, which seems a waste.
2020-12-26update testsBastian Kauschke-6/+0
2020-12-25Merge `pub-restricted` and `visibility` testCamelid-39/+34
2020-12-25Prefer `pub(crate)` over no modifierCamelid-5/+5
2020-12-25Fix bugs; fix and add testsCamelid-17/+30
2020-12-25Rollup merge of #80319 - jyn514:async-lifetimes, r=tmandryDylan DPC-0/+44
Fix elided lifetimes shown as `'_` on async functions Closes https://github.com/rust-lang/rust/issues/63037. r? `@tmandry` on the implementation, `@Darksonn` on the test cases.
2020-12-24Don't process `[]` and `()` in intra-doc linksJoshua Nelson-27/+0
These caused several false positives when documenting rustc, which means there will likely be many more false positives in the rest of the ecosystem.
2020-12-24Auto merge of #79742 - GuillaumeGomez:move-tooltips-messages-out-of-html, ↵bors-6/+5
r=Nemo157 Move tooltips messages out of html First thing first: nothing in the output has changed. You still have the "i" on the left of code blocks examples when they have `ignore`, `compile_fail`, `should_panic` and `edition`. The behavior also remains the same: when you hover the "i", you have the corresponding message showing up. So now, why this PR then? I realized recently that we were actually generating those messages into the HTML every time whereas all messages are the same (except for the edition ones, I'll come back to it later). So instead of generating more content, I simply moved it inside the CSS thanks to pseudo elements (`::before` and `::after`). The message is now inside `::after` and we use the `::before` to have the small triangle on the left of the message. So now, we have less HTML generated which is seems pretty nice. So now, back to the `edition` change: the message is globally the same, but the "edition" itself can be different (2015 or 2018 currently, I expect 2021 to arrive not too far in the future). So the only difference for it is that I added a new attribute on the tooltip called `edition` which contains this information. Then, the `::after` uses it inside its `content` (you can get the content of an element's attribute by using `attr` and concat different strings by simply having them after the other). Don't hesitate if a part of my explanations isn't clear. r? `@jyn514`
2020-12-23Update HTML DOM attribute "edition" to "data-edition"Guillaume Gomez-1/+1
2020-12-23Add more testsJoshua Nelson-0/+15
2020-12-22Fix elided lifetimes shown as `'_` on async functionsJoshua Nelson-0/+29
2020-12-22Fix intra-doc links for non-path primitivesJoshua Nelson-0/+66
This does *not* currently work for associated items that are auto-implemented by the compiler (e.g. `never::eq`), because they aren't present in the source code. I plan to fix this in a follow-up PR.
2020-12-20Don't try to add nested predicate to Rustdoc auto-trait `ParamEnv`Aaron Hill-0/+37
Fixes #80233 We already have logic in `evaluate_predicates` that tries to add unimplemented predicates to our `ParamEnv`. Trying to add a predicate that already holds can lead to errors later on, since projection will prefer trait candidates from the `ParamEnv` to predicates from an impl.
2020-12-16Allow `since="TBD"` for rustc_deprecatedbstrie-2/+10
2020-12-14Add test case for Self:: linksDániel Buga-0/+14
2020-12-11Auto merge of #79349 - Nemo157:issue-79201, r=jyn514bors-1/+43
Apply `doc(cfg)` from parent items while collecting trait impls Because trait impls bypass the standard `clean` hierarchy they do not participate in the `propagate_doc_cfg` pass, so instead we need to pre-collect all possible `doc(cfg)` attributes that will apply to them when cleaning. fixes #79201
2020-12-09Accept arbitrary expressions in key-value attributes at parse timeVadim Petrochenkov-0/+16
2020-12-06Auto merge of #78609 - lcnr:rustdoc-const-eval, r=matthewjasperbors-0/+0
extend `WithOptConstParam` docs, move rustdoc test This should hopefully make things a bit clearer, feel free to comment on anything which can still be improved. cc `@ecstatic-morse` `@nikomatsakis` `@RalfJung`
2020-12-05Update testsGuillaume Gomez-6/+5
2020-12-04Rollup merge of #79638 - jyn514:intra-link-self-raw, r=ManishearthDylan DPC-0/+13
Use `item_name` instead of pretty printing for resolving `Self` on intra-doc links Pretty printing would add a `r#` prefix to raw identifiers, which was not correct. In general I think this change makes sense - pretty-printing is for showing to the *user*, `item_name` is suitable to pass to resolve. Fixes https://github.com/rust-lang/rust/issues/79633. r? `@Manishearth`
2020-12-03Render Markdown in search resultsCamelid-4/+5
Previously Markdown documentation was not rendered to HTML for search results, which led to the output not being very readable, particularly for inline code. This PR fixes that by rendering Markdown to HTML with the help of pulldown-cmark (the library rustdoc uses to parse Markdown for the main text of documentation). However, the text for the title attribute (the text shown when you hover over an element) still uses the plain-text rendering since it is displayed in browsers as plain-text. Only these styles will be rendered; everything else is stripped away: * *italics* * **bold** * `inline code`
2020-12-02Use `item_name` instead of pretty printingJoshua Nelson-0/+13
Pretty printing would add a `r#` prefix to raw identifiers, which was not correct. In general I think this change makes sense - pretty-printing is for showing to the *user*, `item_name` is suitable to pass to resolve.
2020-12-01rustdoc: move lazy norm tests into const-genericsBastian Kauschke-0/+0
2020-12-01Rollup merge of #79548 - CraftSpider:76998, r=jyn514Mara Bos-0/+10
Show since when a function is const in stdlib Fixes #76998 This makes it so that functions with the `#[rustc_const_stable()]` attribute now show from what version they were stably declared const, alongside what version they were declared stable. Example from `Result`: ![image](https://user-images.githubusercontent.com/13342132/100561194-1be60d00-3286-11eb-99ff-1e81201218a9.png) r? ``@jyn514``