about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
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-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.
2021-05-17New rustdoc lint to respect -Dwarnings correctlyAlexis Bourget-4/+2
This adds a new lint to `rustc` that is used in rustdoc when a code block is empty or cannot be parsed as valid Rust code. Previously this was unconditionally a warning. As such some documentation comments were (unknowingly) abusing this to pass despite the `-Dwarnings` used when compiling `rustc`, this should not be the case anymore.
2021-05-16remove mode for run and ignore testsAliénore Bouttefeux-19/+19
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-1/+1
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-08Error on conflicting `#[doc(inline)]`/`#[doc(no_inline)]` attributesLeSeulArtichaut-1/+17
2021-05-08Emit `invalid_doc_attributes` warnings in more casesLeSeulArtichaut-37/+94
2021-05-08Rollup merge of #85052 - jyn514:disambiguator, r=camelidDylan DPC-0/+12
rustdoc: Link to the docs on namespaces when an unknown disambiguator is found This was reverted in https://github.com/rust-lang/rust/pull/84950; this re-lands the changes, but without different behavior depending on the channel. r? `@camelid` cc `@pietroalbini`
2021-05-07rustdoc: Link to the docs on namespaces when an unknown disambiguator is foundJoshua Nelson-0/+12
2021-05-07Rollup merge of #84442 - jyn514:doc-cfg, r=petrochenkovDylan DPC-0/+18
Unify rustc and rustdoc parsing of `cfg()` This extracts a new `parse_cfg` function that's used between both. - Treat `#[doc(cfg(x), cfg(y))]` the same as `#[doc(cfg(x)] #[doc(cfg(y))]`. Previously it would be completely ignored. - Treat `#[doc(inline, cfg(x))]` the same as `#[doc(inline)] #[doc(cfg(x))]`. Previously, the cfg would be ignored. - Pass the cfg predicate through to rustc_expand to be validated Technically this is a breaking change, but doc_cfg is still nightly so I don't think it matters. Fixes https://github.com/rust-lang/rust/issues/84437. r? `````````@petrochenkov`````````
2021-05-05Suggest lint groupsCameron Steffen-1/+1
2021-05-05Revert PR 83866Pietro Albini-12/+0
That PR caused multiple test failures when Rust's channel is changed from nightly to anything else. The commit will have to be landed again after the test suite is fixed.
2021-05-03change based on reviewAliénore Bouttefeux-30/+30
2021-05-03Unify rustc and rustdoc parsing of `cfg()`Joshua Nelson-0/+18
This extracts a new `parse_cfg` function that's used between both. - Treat `#[doc(cfg(x), cfg(y))]` the same as `#[doc(cfg(x)] #[doc(cfg(y))]`. Previously it would be completely ignored. - Treat `#[doc(inline, cfg(x))]` the same as `#[doc(inline)] #[doc(cfg(x))]`. Previously, the cfg would be ignored. - Pass the cfg predicate through to rustc_expand to be validated Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2021-05-03proof of concept add test type on printsAliénore Bouttefeux-25/+61
2021-05-01Auto merge of #83857 - ABouttefeux:master, r=jyn514bors-0/+58
added --no-run option for rustdoc resolve #59053 add `--no-run` option for `rustdoc` for compiling doc test but not running them. Intended for use with `--persist-doctests`.
2021-05-01Apply suggestions from code reviewAliénore Bouttefeux-1/+2
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-30error when --no-run is present without --testAliénore Bouttefeux-0/+7
2021-04-24Revert "rustdoc: Hide `#text` in doc-tests"David Hewitt-31/+0
This reverts commit af6c3201fc3d5ec2559836454ea4f43eec583fa2.
2021-04-22rustdoc: Hide `#text` in doc-testsJoshua Nelson-0/+31
Since `#![attr]` and `#[attr]` are the only valid syntax that start with `#`, we can just special case those two tokens.