about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2021-01-20Remove flaky testJoshua Nelson-6/+0
See https://github.com/rust-lang/rust/pull/81197 for what's going on here; this is a temporary stopgap until someone has time to review the proper fix.
2021-01-17Feature-gate `pointer` and `reference` in intra-doc linksJoshua Nelson-0/+1
- Only feature gate associated items - Add docs to unstable book
2021-01-15Rollup merge of #80254 - Aaron1011:rustdoc-auto-param-env, r=estebankYuki Okushi-0/+37
Don't try to add nested predicate to Rustdoc auto-trait `ParamEnv` 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.
2021-01-13Update tests for extern block lintingMark Rousskov-15/+15
2021-01-12Simplify regression testTristan Dannenberg-4/+3
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-12Update help message and add regression testTristan Dannenberg-0/+7
2021-01-12Rollup merge of #80885 - camelid:intra-doc-str-ref, r=jyn514Yuki Okushi-0/+9
rustdoc: Resolve `&str` as `str` People almost always are referring to `&str`, not `str`, so this will save a manual link resolve in many cases. Note that we already accept `&` (resolves to `reference`) in intra-doc links, so this shouldn't cause breakage. r? `@jyn514`
2021-01-11Rollup merge of #80892 - camelid:intra-doc-remove-star, r=jyn514Yuki Okushi-2/+0
rustdoc: Remove `*` intra-doc alias for `pointer` It's not valid Rust code and it can easily be confused with a wildcard glob pattern or something else. People can always use `pointer` instead, so it's just removing an alias. It hasn't hit stable yet (I think it's still on nightly), so it's okay to remove it. (We can always add it back later if we change our mind too.) r? `@jyn514` cc https://github.com/rust-lang/rust/pull/80885#discussion_r554622737
2021-01-11Rollup merge of #80881 - jyn514:intra-doc-self, r=GuillaumeGomezYuki Okushi-0/+6
Fix intra-doc links to `Self` and `crate` Closes https://github.com/rust-lang/rust/issues/77732.
2021-01-10rustdoc: Remove `*` intra-doc alias for `pointer`Camelid-2/+0
It's not valid Rust code and it can easily be confused with a wildcard glob pattern or something else. People can always use `pointer` instead, so it's just removing an alias. It hasn't hit stable yet (I think it's still on nightly), so it's okay to remove it. (We can always add it back later if we change our mind too.)
2021-01-10rustdoc: Resolve `&str` as `str`Camelid-0/+9
People almost always are referring to `&str`, not `str`, so this will save a manual link resolve in many cases. Note that we already accept `&` (resolves to `reference`) in intra-doc links, so this shouldn't cause breakage.
2021-01-10Fix intra-doc links to `Self` and `crate`Joshua Nelson-0/+6
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.