about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2021-10-06Simplify AttributesExt::cfg function and remove error emissions since they ↵Guillaume Gomez-0/+35
are not useful
2021-10-05Add test case for `doc_cfg_hide` feature gateJoshua Nelson-0/+21
2021-09-26Use the correct edition when syntax highlighting doctestsJoshua Nelson-0/+38
Previously it would unconditionally use edition 2015, which was incorrect.
2021-09-17Don't lint about missing code examples in derived traitsHans-0/+9
Fixes #81775
2021-09-14Auto merge of #73314 - GuillaumeGomez:display-warnings, r=jyn514bors-0/+33
Rename "--display-warnings" to "--display-doctest-warnings" Fixes #41574. cc `@ollie27` r? `@kinnison`
2021-09-14Add test for --display-doctest-warnings optionGuillaume Gomez-0/+33
2021-09-13Auto merge of #87915 - estebank:fancy-spans, r=oli-obkbors-5/+5
Use smaller spans for some structured suggestions Use more accurate suggestion spans for * argument parse error * fully qualified path * missing code block type * numeric casts
2021-09-13Auto merge of #88745 - hnj2:allow-trait-impl-missing-code, r=GuillaumeGomezbors-0/+7
Allow missing code examples in trait impls. Excludes Trait implementations from the items that need to have doc code examples when using the `rustdoc::missing_doc_code_examples` lint. For details see #88741 fixes #88741 r? `@jyn514`
2021-09-12Fix broken handling of primitive itemsJoshua Nelson-38/+7
- Fix broken handling of primitive associated items - Remove fragment hack Fixes 83083 - more logging - Update CrateNum hacks The CrateNum has no relation to where in the dependency tree the crate is, only when it's loaded. Explicitly special-case core instead of assuming it will be the first DefId. - Update and add tests - Cache calculation of primitive locations This could possibly be avoided by passing a Cache into collect_intra_doc_links; but that's a much larger change, and doesn't seem valuable other than for this.
2021-09-10Add test for enum tuple variants and tuple struct doc countGuillaume Gomez-2/+71
2021-09-09Allow missing code examples in trait impls.Hans Niklas Jacob-0/+7
2021-09-05Auto merge of #88604 - camelid:rustdoc-lifetime-bounds, r=GuillaumeGomezbors-0/+19
rustdoc: Clean up handling of lifetime bounds Previously, rustdoc recorded lifetime bounds by rendering them into the name of the lifetime parameter. Now, it leaves the name as the actual name and instead records lifetime bounds in an `outlives` list, similar to how type parameter bounds are recorded. Also, higher-ranked lifetimes cannot currently have bounds, so I simplified the code to reflect that. r? `@GuillaumeGomez`
2021-09-02rustdoc: Higher-ranked lifetimes can't have boundsNoah Lev-0/+19
This cleans up the other spot I found where rustdoc was rendering bounds into the lifetime name itself. However, in this case, I don't think it could have actually happened because higher-ranked lifetime definitions aren't currently allowed to have bounds.
2021-09-01rustdoc: Don't panic on ambiguous inherent associated typesNoah Lev-0/+32
Instead, return `Type::Infer` since compilation should fail anyway. That's how rustdoc handles `hir::TyKind::Err`s, so this just extends that behavior to `ty::Err`s when analyzing associated types. For some reason, the error is printed twice with rustdoc (though only once with rustc). I'm not sure why that is, but it's better than panicking. This commit also makes rustdoc fail early in the non-projection, non-error case, instead of returning a `Res::Err` that would likely cause rustdoc to panic later on. This change is originally from #88379.
2021-08-28Update testsinquisitivecrystal-1/+1
2021-08-26Rollup merge of #88215 - jyn514:lazy-loading, r=petrochenkovManish Goregaokar-0/+20
Reland #83738: "rustdoc: Don't load all extern crates unconditionally" I hopefully found all the bugs :crossed_fingers: time for a take two. See the last commit for details on what went wrong before. r? `@petrochenkov` (but feel free to reassign to Guillaume if you don't have time.) Closes https://github.com/rust-lang/rust/issues/68427. Includes a fix for https://github.com/rust-lang/rust/issues/84738.
2021-08-22Revert "Revert "Don't load all extern crates unconditionally""Joshua Nelson-0/+20
This reverts commit 5f0c54db4e595a6a77048f2b0605138ffa49a326.
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-16Move working checks into separate test filesGuillaume Gomez-2/+8
2021-08-16Add UI tests for doc(test(...)) attribute checksGuillaume Gomez-0/+50
2021-08-16feature gate doc(primitive)Joshua Nelson-0/+1
2021-08-12Use smaller spans for some structured suggestionsEsteban Kuber-5/+5
Use more accurate suggestion spans for * argument parse error * fully qualified path * missing code block type * numeric casts * E0212
2021-08-11Modify structured suggestion outputEsteban Küber-55/+62
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-05Ensure that --generate-link-to-definition is only used with HTML output and ↵Guillaume Gomez-0/+24
is unstable
2021-07-29Auto merge of #87285 - GuillaumeGomez:intra-doc-span, r=estebankbors-92/+166
Improve intra doc errors display #87169 `@jyn514` This is what I had in mind to avoid having duplicated backticks. I also gave a try to simply updating the span for the suggestion/help messages but I think this current one is better because less "noisy". Anyway, that allows you to see the result. ;)
2021-07-29Update rustdoc-ui tests for intra-doc links errorsGuillaume Gomez-92/+166
2021-07-29Rollup merge of #87451 - GuillaumeGomez:tuple-struct-field-doc, r=jyn514Yuki Okushi-2/+2
Add support for tuple struct field documentation Fixes #42615. This is #80320 updated to new codebase and with added tests. Part of https://github.com/rust-lang/rust/issues/83255. cc ```@camelid``` (since you were involved on the original PR). r? ```@jyn514```
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-3/+3
2021-07-26Add test for enum item tuple fields documentationGuillaume Gomez-2/+2
2021-07-20Auto merge of #84959 - camsteffen:lint-suggest-group, r=estebankbors-1/+1
Suggest lint groups Fixes rust-lang/rust-clippy#6986
2021-07-18Add invalid rust code for testGuillaume Gomez-0/+36
2021-07-18Add test for rustdoc --nocapture optionGuillaume Gomez-0/+18
2021-07-12suggest removing disambiguator if linking to fieldDeadbeef-0/+26
2021-07-03Warn when `rustdoc::` group is omitted from lint namesJoshua Nelson-15/+24
2021-07-01Revert "Don't load all extern crates unconditionally"Guillaume Gomez-20/+0
2021-06-15Auto merge of #84867 - pnkfelix:rustdoc-revert-deref-recur, r=jyn514bors-17/+0
rustdoc: revert deref recur to resume inclusion of impl ExtTrait<Local> for ExtType As discussed here: https://github.com/rust-lang/rust/issues/82465#issuecomment-829290384, Revert PR #80653 to resolve issue #82465. Issue #82465 was we had stopped including certain trait implementations, namely implementations on an imported type of an imported trait *instantiated on a local type*. That bug was injected by PR #80653. Reverting #80653 means we don't list all the methods that you have accessible via recursively applying `Deref`. [Discussion in last week's rustc triage meeting](https://zulip-archive.rust-lang.org/238009tcompilermeetings/19557weekly2021042954818.html#236680594) led us to conclude that the bug was worse than the enhancement, and there was not an obvious fix for the bug itself. So for the short term we remove the enhancement, while in the long term we will work on figuring out a way to have our imported trait implementation cake and eat it too.
2021-06-11Auto merge of #86204 - alexcrichton:wasm-simd-stable, r=Amanieubors-2/+0
std: Stabilize wasm simd intrinsics This commit performs two changes to stabilize Rust support for WebAssembly simd intrinsics: * The stdarch submodule is updated to pull in rust-lang/stdarch#1179. * The `wasm_target_feature` feature gate requirement for the `simd128` feature has been removed, stabilizing the name `simd128`. This should conclude the FCP started on #74372 and... Closes #74372
2021-06-10std: Stabilize wasm simd intrinsicsAlex Crichton-2/+0
This commit performs two changes to stabilize Rust support for WebAssembly simd intrinsics: * The stdarch submodule is updated to pull in rust-lang/stdarch#1179. * The `wasm_target_feature` feature gate requirement for the `simd128` feature has been removed, stabilizing the name `simd128`. This should conclude the FCP started on #74372 and... Closes #74372
2021-06-10Auto merge of #82639 - jyn514:stable-options, r=Mark-Simulacrumbors-2/+2
Don't pass -Z unstable-options by default for UI tests Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not. This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics. - https://github.com/rust-lang/rust/issues/82636 - https://github.com/rust-lang/rust/issues/82637 - https://github.com/rust-lang/rust/issues/82638
2021-06-10manually crafted revert of PR #80653, to address issue #82465.Felix S. Klock II-17/+0
(update: placated tidy) (update: rebased post PR #84707 ) merge me
2021-06-07Enable rustdoc to document safe wasm intrinsicsAlex Crichton-0/+7
This commit fixes an issue not found during #84988 where rustdoc is used to document cross-platform intrinsics but it was requiring that functions which use `#[target_feature]` are `unsafe` erroneously, even if they're WebAssembly specific. Rustdoc today, for example, already has a special case where it enables annotations like `#[target_feature(enable = "simd128")]` on platforms other than WebAssembly. The purpose of this commit is to relax the "require all `#[target_feature]` functions are `unsafe`" requirement for all targets whenever rustdoc is running, enabling all targets to fully document other targets, such as WebAssembly, where intrinsics functions aren't always `unsafe`.
2021-06-06Auto merge of #84863 - ABouttefeux:libtest, r=m-ou-sebors-9/+45
Show test type during prints Test output can sometimes be confusing. For example doctest with the no_run argument are displayed the same way than test that are run. During #83857 I got the feedback that test output can be confusing. For the moment test output is ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) ... ok test $DIR/test-type.rs - f (line 21) ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` I propose to change output by indicating the test type as ``` test $DIR/test-type.rs - f (line 12) ... ignored test $DIR/test-type.rs - f (line 15) - compile ... ok test $DIR/test-type.rs - f (line 21) - compile fail ... ok test $DIR/test-type.rs - f (line 6) ... ok ``` by indicating the test type after the test name (and in the case of doctest after the function name and line) and before the "...". ------------ Note: this is a proof of concept, the implementation is probably not optimal as the properties added in `TestDesc` are only use in the display and does not represent actual change of behavior, maybe `TestType::DocTest` could have fields
2021-06-06Don't pass -Z unstable-options by default for UI testsJoshua Nelson-2/+2
- Pass it explicitly where appropriate - Update stderr files and warnings; it turns that unstable-options has far-reaching effects on diagnostics.
2021-06-05Rollup merge of #85501 - jyn514:invalid-doc-attrs, r=varkorGuillaume Gomez-10/+13
Fix `deny(invalid_doc_attributes)` Fixes https://github.com/rust-lang/rust/issues/85497.
2021-06-05Auto merge of #85457 - jyn514:remove-doc-include, r=GuillaumeGomezbors-0/+22
Remove `doc(include)` This nightly feature is redundant now that `extended_key_value_attributes` is stable (https://github.com/rust-lang/rust/pull/83366). `@rust-lang/rustdoc` not sure if you think this needs FCP; there was already an FCP in #82539, but technically it was for deprecating, not removing the feature altogether. This should not be merged before #83366. cc `@petrochenkov`
2021-06-04Fix `deny(invalid_doc_attributes)`Joshua Nelson-10/+13
2021-06-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-26/+30
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
2021-06-04Remove `doc(include)`Joshua Nelson-0/+22
2021-05-17Rename INVALID_RUST_CODEBLOCK{,S}Joshua Nelson-2/+2
2021-05-17Add back missing help for ignore blocksJoshua Nelson-5/+13
This also gives a better error message when a span is missing.