summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2021-02-13Do not ICE on range patterns in function argumentsLeSeulArtichaut-1/+1
2021-02-13Add regression test for #81289LeSeulArtichaut-0/+18
2021-01-27rustdoc: Render HRTB correctly for bare functionsCamelid-0/+29
The angle brackets were not rendered, so code like this: some_func: for<'a> fn(val: &'a i32) -> i32 would be rendered as: some_func: fn'a(val: &'a i32) -> i32 However, rendering with angle brackets is still invalid syntax: some_func: fn<'a>(val: &'a i32) -> i32 so now it renders correctly as: some_func: for<'a> fn(val: &'a i32) -> i32 ----- However, note that this code: some_trait: dyn for<'a> Trait<'a> will still render as: some_trait: dyn Trait<'a> which is not invalid syntax, but is still unclear. Unfortunately I think it's hard to fix that case because there isn't enough information in the `rustdoc::clean::Type` that this code operates on. Perhaps that case can be fixed in a later PR.
2021-01-24Rollup merge of #81302 - LeSeulArtichaut:80777-trait-render, r=jyn514Jonas Schievink-0/+19
Fix rendering of stabilization version for trait implementors Rustdoc compares an item's stabilization version with its parent's to not render it if they are the same. Here, the implementor was compared with itself, resulting in the stabilization version never getting shown. This probably needs a test. Fixes #80777. r? `@jyn514`
2021-01-23Fix rendering of stabilization version for trait implementorsLeSeulArtichaut-0/+19
2021-01-22rustdoc: Fix visibility of trait and impl itemsCamelid-0/+32
2021-01-21Auto merge of #80958 - bstrie:deptbdnums, r=KodrAusbors-1/+1
Deprecate-in-future the constants superceded by RFC 2700 Successor to #78335, re-opened after addressing the issues tracked in #68490. This PR makes use of the new ability to explicitly annotate an item as triggering the deprecated-in-future lint (via `rustc_deprecated(since="TBD"`, see #78381). We might call this *soft deprecation*; unlike with deprecation, users will *not* receive warnings when compiling code that uses these items *unless* they opt-in via `#[warn(deprecated_in_future)]`. Like deprecation, soft deprecation causes documentation to formally acknowledge that an item is marked for eventual deprecation (at a non-specific point in the future). With this new ability, we can sidestep all debate about when or on what timeframe something ought to be deprecated; as long as we can agree that something ought to be deprecated, we can receive much of the benefits of deprecation with none of the drawbacks. For these items specifically, the libs team has already agreed that they should be deprecated (see https://github.com/rust-lang/rust/issues/68490#issuecomment-747022696).
2021-01-20Deprecate-in-future the constants superceded by RFC 2700bstrie-1/+1
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