about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2022-01-10Add test for disambiguator mismatch with crateNoah Lev-1/+17
This currently calls `std` a "crate" in one part of the message and a "module" in another part. The next commits fix this so it says "crate" in both places.
2022-01-06Rollup merge of #92443 - mdibaiee:90703/resolve-traits-of-primitive-types, ↵Matthias Krüger-9/+2
r=Manishearth Rustdoc: resolve associated traits for non-generic primitive types Fixes #90703 This seems to work: <img width="457" alt="image" src="https://user-images.githubusercontent.com/2807772/147774059-9556ff96-4519-409e-8ed0-c33ecc436171.png"> I'm just afraid I might have missed some cases / broken previous functionality. I also have not written tests yet, I will have to take a look to see where tests are and how they are structured, but any help there is also appreciated.
2022-01-06Rollup merge of #92349 - avitex:fix-rustdoc-private-doc-tests, r=GuillaumeGomezMatthias Krüger-0/+45
Fix rustdoc::private_doc_tests lint for public re-exported items Closes #72081 This involves changing the lint to check the access level is exported, rather than public. The [exported access level](https://github.com/rust-lang/rust/blob/e91ad5fc62bdee4a29c18baa5fad2ca42fc91bf4/compiler/rustc_middle/src/middle/privacy.rs#L24) accounts for public items and items accessible to other crates with the help of `pub use` re-exports. The pattern of re-exporting public items from a private module is usage seen in a number of popular crates.
2022-01-05Rustdoc: resolve associated traits for primitive typesMahdi Dibaiee-9/+2
Fixes #90703
2021-12-28Add regression test for #59502Noah Lev-0/+11
This issue was fixed using a hacky recursion "fuel" argument, but the issue was never minimized nor was a regression test added. The underlying bug is still unfixed, so this test should help with fixing it and removing the `recurse` hack.
2021-12-29Improve rustdoc::private_doc_tests testsavitex-2/+33
- Ensure standard public items are accepted - Ensure public items not re-exported from private modules are denied
2021-12-28Fix rustdoc::private_doc_tests lint for public re-exported itemsavitex-0/+14
This involves changing the lint to check the access level is exported, rather than public. The exported access level accounts for public items and items accessible to other crates with the help of `pub use` re-exports. The pattern of re-exporting public items from a private module is usage seen in a number of popular crates.
2021-12-20Auto merge of #91900 - pitaj:fix-91714, r=jyn514bors-20/+12
rustdoc: make `--passes` and `--no-defaults` have no effect Fixes #91714 One potential issue is that currently there is no stable way to achieve `--document-hidden-items`. This affects test `issue-15347`. I also had to modify the tests `issue-42875` and `no-compiler-export`. Regardless of combinations of `--document-hidden-items` and `--document-private-items`, I was unable to get these to pass without the modifications. I left behind a comment noting the change.
2021-12-18Rollup merge of #89090 - cjgillot:bare-dyn, r=jackh726Matthias Krüger-14/+4
Lint bare traits in AstConv. Removing the lint from lowering allows to: - make lowering querification easier; - have the lint implementation in only one place. r? `@estebank`
2021-12-15rustdoc: remove `--passes` and `--no-defaults`Peter Jaszkowiak-20/+12
- flags no longer function, see #44136 - adjust tests to match new behavior - removed test issue-42875 (covered regression with --no-defaults) - moved input-format to removed flags - move all removed flags to bottom - note flag removal in command help - remove DefaultPassOption enum (now redundant with `show_coverage`)
2021-12-11Rollup merge of #91717 - inashivb:issue-91713, r=jyn514Matthias Krüger-0/+38
Add deprecation warning for --passes Issue https://github.com/rust-lang/rust/issues/91713 mentored by ```@jyn514```
2021-12-11Rollup merge of #91310 - hi-rustin:rustin-patch-rustdoc, r=jyn514Matthias Krüger-0/+3
Add --out-dir flag for rustdoc part of https://github.com/rust-lang/rust/issues/91260 Add --out-dir flag for rustdoc and change the `-o` option to point to out-dir. I'm not quite sure if it should be stable, also I'm not sure if this parameter priority is appropriate? Or should I just refuse to pass both parameters at the same time? r? `@jyn514`
2021-12-10Update src/test/rustdoc-ui/issue-91713.rsShivani Bhardwaj-0/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2021-12-09Add test for deprecation warning for --passesShivani Bhardwaj-0/+37
2021-12-05Do not warn in rustdoc test.Camille GILLOT-14/+4
2021-12-01Auto merge of #91433 - matthiaskrgr:rollup-118ql06, r=matthiaskrgrbors-0/+48
Rollup of 5 pull requests Successful merges: - #88502 (Add slice take methods) - #91313 (expand: Turn `ast::Crate` into a first class expansion target) - #91424 (Update LLVM with patches for better llvm-cov diagnostics) - #91425 (Include lint errors in error count for `-Ztreat-err-as-bug`) - #91430 (Add tests for `normalize-docs` overflow errors) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-01Use `try_normalize_erasing_regions` instead of a custom infer contextJoshua Nelson-0/+48
This unfortunately is still giving an unsilenceable overflow error :(
2021-12-01Auto merge of #91275 - camelid:deny-test-warnings, r=jyn514bors-0/+53
Deny warnings in rustdoc non-UI tests These warnings were silently ignored since they did not appear in a `.stderr` file and did not fail the test. With this change, warnings in tests are denied, causing the tests to fail if they have warnings. This change has already led me to find a bug in rustdoc (#91274) and a useless test (`src/test/rustdoc/primitive/primitive-generic-impl.rs`, though its uselessness is unrelated to its warnings). r? `@jyn514`
2021-11-30Add --out-dir flag for rustdochi-rustin-0/+3
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-28Fix warnings in rustdoc HTML testsNoah Lev-0/+53
Now that compiletest denies warnings in these tests, they need fixing!
2021-11-28Rollup merge of #91319 - fee1-dead:rustdoc-ice-fix, r=jyn514Matthias Krüger-1/+1
Change output path to {{build-base}} for rustdoc scrape_examples ui test See https://github.com/rust-lang/rust/pull/90611#issuecomment-981092909 r? `@jyn514` cc `@petrochenkov`
2021-11-28Change output path to {{build-base}}Deadbeef-1/+1
2021-11-26Rollup merge of #91259 - jyn514:doctest-warnings, r=GuillaumeGomezMatthias Krüger-7/+47
Remove `--display-doctest-warnings` `--display-doctest-warnings` can be replicated in full with other existing features, there's no need to have a separate option for it. This removes the option and documents the combination of other features to replicate it. This also fixes a bug where `--test-args=--show-output` had no effect. cc `@ollie27,` https://github.com/rust-lang/rust/pull/73314#issuecomment-668317262 Fixes https://github.com/rust-lang/rust/issues/41574 r? `@GuillaumeGomez`
2021-11-26Remove `--display-doctest-warnings`Joshua Nelson-7/+47
This can be replicated in full with other existing features, there's no need to have a separate option for it. This also fixes a bug where `--test-args=--show-output` had no effect, and updates the documentation.
2021-11-27Reduce the ICEDeadbeef-469/+1
2021-11-27Add ICE testDeadbeef-0/+472
2021-11-24Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelidGuillaume Gomez-3/+2
Create rustdoc_internals feature gate As suggested by ``@camelid`` [here](https://github.com/rust-lang/rust/pull/90398#issuecomment-955093851), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag. This is pretty much what it would look like (needs to update the tests too). The tracking issue is https://github.com/rust-lang/rust/issues/90418. What do you think ``@rust-lang/rustdoc`` ?
2021-11-24Create rustdoc_internals feature gateGuillaume Gomez-3/+2
2021-11-22Update issue-91134.stdoutMichael Howell-1/+1
2021-11-22fix(doctest): detect extern crate items in statement doctestsMichael Howell-0/+23
This partially reverts #91026, because rustdoc needs to detect the extern statements, even when they appear inside implicit `main()`. It does not entirely revert it, so the old bug is still fixed, by duplicating some of the logic from `parse_mod` instead of trying to use it directly. Fixes #91134
2021-11-18rustdoc doctest: detect `fn main` after an unexpected semicolonMichael Howell-0/+42
The basic problem with this is that rustdoc, when hunting for `fn main`, will stop parsing after it reaches a fatal error. This unexpected semicolon was a fatal error, so in `src/test/rustdoc-ui/failed-doctest-extra-semicolon-on-item.rs`, it would wrap the doctest in an implied main function, turning it into this: fn main() { struct S {}; fn main() { assert_eq!(0, 1); } } This, as it turns out, is totally valid, and it executes no assertions, so *it passes,* even though the user wanted it to execute the assertion. The Rust parser already has the ability to recover from these unexpected semicolons, but to do so, it needs to use the `parse_mod` function, so this commit changes it to do that.
2021-11-08Add more missing methods to `IntraLinkCrateLoader`Joshua Nelson-0/+30
This helps with (but does not fix) https://github.com/rust-lang/rust/issues/84738. I tested on https://github.com/jyn514/objr/commit/edcee7b8124abf0e4c63873e8422ff81beb11ebb and still hit ICEs.
2021-10-30Rollup merge of #90183 - GuillaumeGomez:recurse-deref, r=jyn514Guillaume Gomez-0/+19
Show all Deref implementations recursively Fixes #87783. This is a re-implementation of #80653, so taking the original PR comment: 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) cc `@camelid` r? `@jyn514`
2021-10-29Unify titles in rustdoc book doc attributes chapterGuillaume Gomez-2/+2
2021-10-29Add tests for recursive derefGuillaume Gomez-0/+19
2021-10-23Rollup merge of #85833 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+6
Scrape code examples from examples/ directory for Rustdoc Adds support for the functionality described in https://github.com/rust-lang/rfcs/pull/3123 Matching changes to Cargo are here: https://github.com/rust-lang/cargo/pull/9525 Live demo here: https://willcrichton.net/example-analyzer/warp/trait.Filter.html#method.and
2021-10-22Revert def_id addition from clean::Function, add test forWill Crichton-3/+6
scrape-examples options
2021-10-20Add test to ensure that the missing_doc_code_examples is not triggered on ↵Guillaume Gomez-1/+10
foreign trait implementations
2021-10-17Rollup merge of #89907 - GuillaumeGomez:correctly-emit-errors, r=camelidYuki Okushi-1/+0
Remove FIXME since there is nothing to be fixed Resolves #88593. The errors are deduplicated when displayed to users. They only appear multiple times in UI tests. cc ``@jyn514`` r? ``@camelid``
2021-10-16Remove FIXME since there is nothing to be fixed.Guillaume Gomez-1/+0
The errors are deduplicated when displayed to users. They only appear multiple times in UI tests.
2021-10-15Bless testsCameron Steffen-1/+1
2021-10-06Change serialized format to use DefPathHash instead of custom StringWill Crichton-0/+3
Move test to rustdoc-ui Fix test writing to wrong directory Formatting Fix test Add FIXME Remove raw multiline strings
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`