summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2020-11-11add error-in-impl-trait const generics testBastian Kauschke-0/+24
2020-11-05Rename lint to non_autolinksGuillaume Gomez-11/+11
2020-11-05Improve lint even moreGuillaume Gomez-0/+2
2020-11-05Don't check for URLs inside codeblocksGuillaume Gomez-20/+24
2020-11-05Rename automatic_links to url_improvementsGuillaume Gomez-4/+4
2020-11-05Improve automatic_links globallyGuillaume Gomez-3/+137
2020-11-05Extend automatic_links lint to take into account URLs without link syntaxGuillaume Gomez-9/+17
2020-11-05Add tests for automatic_links lintGuillaume Gomez-0/+40
2020-10-15Rollup merge of #77753 - GuillaumeGomez:check-html-comments, r=jyn514Yuki Okushi-1/+21
Check html comments Part of #67799. cc @ollie27 r? @jyn514
2020-10-15Rollup merge of #77570 - GuillaumeGomez:whitespace-doc-alias, r=jyn514,ollie27Yuki Okushi-8/+15
Allow ascii whitespace char for doc aliases Fixes issue from https://github.com/rust-lang/rust/issues/76705#issuecomment-703123847 cc @lopopolo @ollie27 r? @jyn514
2020-10-14Handle multi-line HTML commentsGuillaume Gomez-2/+6
2020-10-13Add check for HTML commentsGuillaume Gomez-1/+17
2020-10-13Auto merge of #76196 - r-52:r-coverage-allow-missing-docs, r=jyn514bors-0/+68
rustdoc: skip #[allow(missing docs)] for docs in coverage report During the document coverage reporting with: ```bash rustdoc something.rs -Z unstable-options --show-coverage ``` the coverage report counts code that is marked with `#[allow(missing_docs)]` for the calculation, which outputs lower numbers in the coverage report even though these parts should be ignored for the calculation. Right now I'm not sure how this can be tested (CI)? (I verified it by hand and ran the unit tests) r? `@jyn514` **Reference:** Fixes #76121
2020-10-12Extend test to ensure that items inherit lint level from the parentGuillaume Gomez-0/+2
2020-10-12Apply same treatment to MISSING_DOC_CODE_EXAMPLESGuillaume Gomez-0/+20
2020-10-12Inherit lint level from parentsGuillaume Gomez-2/+10
2020-10-12rustdoc: skip allow missing doc in cover. reportRoman-0/+38
During the document coverage reporting with ```bash rustdoc something.rs -Z unstable-options --show-coverage ``` the coverage report also includes parts of the code that are marked with `#[allow(missing_docs)]`, which outputs lower numbers in the coverage report even though these parts should be ignored for the calculation. Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-10Apply suggestions from code reviewDániel Buga-1/+20
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-10Auto merge of #76934 - camelid:rustdoc-allow-generic-params, r=jyn514bors-1/+122
Allow generic parameters in intra-doc links Fixes #62834. --- The contents of the generics will be mostly ignored (except for warning if fully-qualified syntax is used, which is currently unsupported in intra-doc links - see issue #74563). * Allow links like `Vec<T>`, `Result<T, E>`, and `Option<Box<T>>` * Allow links like `Vec::<T>::new()` * Warn on * Unbalanced angle brackets (e.g. `Vec<T` or `Vec<T>>`) * Missing type to apply generics to (`<T>` or `<Box<T>>`) * Use of fully-qualified syntax (`<Vec as IntoIterator>::into_iter`) * Invalid path separator (`Vec:<T>:new`) * Too many angle brackets (`Vec<<T>>`) * Empty angle brackets (`Vec<>`) Note that this implementation *does* allow some constructs that aren't valid in the actual Rust syntax, for example `Box::<T>new()`. That may not be supported in rustdoc in the future; it is an implementation detail.
2020-10-09Remove unneeded ImportItem on glob onesGuillaume Gomez-13/+2
2020-10-09Add test to ensure that external items aren't lint-checkedGuillaume Gomez-2/+14
2020-10-09Add test for reexported items lintsGuillaume Gomez-0/+31
2020-10-08Allow generic parameters in intra-doc linksCamelid-1/+122
The contents of the generics will be mostly ignored (except for warning if fully-qualified syntax is used, which is currently unsupported in intra-doc links - see issue #74563). * Allow links like `Vec<T>`, `Result<T, E>`, and `Option<Box<T>>` * Allow links like `Vec::<T>::new()` * Warn on * Unbalanced angle brackets (e.g. `Vec<T` or `Vec<T>>`) * Missing type to apply generics to (`<T>` or `<Box<T>>`) * Use of fully-qualified syntax (`<Vec as IntoIterator>::into_iter`) * Invalid path separator (`Vec:<T>:new`) * Too many angle brackets (`Vec<<T>>`) * Empty angle brackets (`Vec<>`) Note that this implementation *does* allow some constructs that aren't valid in the actual Rust syntax, for example `Box::<T>new()`. That may not be supported in rustdoc in the future; it is an implementation detail.
2020-10-07Auto merge of #77119 - GuillaumeGomez:unclosed-html-tag-lint, r=jyn514bors-1/+180
Unclosed html tag lint Part of #67799. I think `@ollie27` will be interested (`@Manishearth` too since they opened the issue ;) ). r? `@jyn514`
2020-10-06Enforce whitespace ascii character check for doc aliasGuillaume Gomez-1/+15
2020-10-05Allow ascii whitespace char for doc aliasesGuillaume Gomez-9/+2
2020-10-05Rollup merge of #76329 - GuillaumeGomez:doc-alias-crate-level, r=matthewjasperDylan DPC-0/+20
Add check for doc alias attribute at crate level Fixes #76298, #64734, #69365. r? @ollie27
2020-10-04Enforce crate level attributes checksGuillaume Gomez-4/+13
2020-10-04Rollup merge of #77469 - camelid:rustdoc-better-failed-res-error, r=jyn514Yuki Okushi-35/+35
Improve rustdoc error for failed intra-doc link resolution The previous error was confusing since it made it sound like you can't link to items that are defined outside the current module. Also suggested importing the item. r? @jyn514
2020-10-03Add test for #[doc(alias = "...")] at crate levelGuillaume Gomez-0/+11
2020-10-03Enforce closing HTML tags to have a ">" characterGuillaume Gomez-2/+14
2020-10-03Use char_indices() instead of chars() to prevent more than one-byte ↵Guillaume Gomez-32/+38
characters issue
2020-10-03Correctly handle unicode characters and tags being open just before the end ↵Guillaume Gomez-13/+30
of the doc comment
2020-10-03Don't warn if the tag is nested inside a <script> or inside a <style>Guillaume Gomez-0/+22
2020-10-03Add test for invalid_html_tag lint in deny(rustdoc)Guillaume Gomez-1/+25
2020-10-03Improve codeGuillaume Gomez-6/+43
2020-10-03Improve invalid_html_tags lint spanGuillaume Gomez-41/+28
2020-10-03Add test for unclosed_html_tag lintGuillaume Gomez-65/+89
2020-10-03Add `unclosed_html_tags` lintGuillaume Gomez-5/+55
2020-10-02Improve error messagesCamelid-35/+35
2020-10-02Use old error when there's partial resolutionCamelid-4/+4
The new error was confusing when there was partial resolution (something like `std::io::nonexistent`); the old one is better for those cases.
2020-10-02Remove unhelpful help messageCamelid-63/+19
2020-10-02Improve rustdoc error for failed intra-doc link resolutionCamelid-54/+98
The previous error was confusing since it made it sound like you can't link to items that are defined outside the current module. Also suggested importing the item.
2020-10-02Rollup merge of #76811 - GuillaumeGomez:doc-alias-name-restriction, ↵Jonas Schievink-1/+39
r=oli-obk,ollie27 Doc alias name restriction Fixes #76705.
2020-10-02Update testsGuillaume Gomez-1/+39
2020-09-27Separate `private_intra_doc_links` and `broken_intra_doc_links` into ↵Joshua Nelson-4/+4
separate lints This is not ideal because it means `deny(broken_intra_doc_links)` will no longer `deny(private_intra_doc_links)`. However, it can't be fixed with a new lint group, because `broken` is already in the `rustdoc` lint group; there would need to be a way to nest groups somehow. This also removes the early `return` so that the link will be generated even though it gives a warning.
2020-09-27Auto merge of #76955 - jyn514:refactor-diagnostics, r=eucliobors-48/+92
Refactor and fix intra-doc link diagnostics, and fix links to primitives Closes https://github.com/rust-lang/rust/issues/76925, closes https://github.com/rust-lang/rust/issues/76693, closes https://github.com/rust-lang/rust/issues/76692. Originally I only meant to fix #76925. But the hack with `has_primitive` was so bad it was easier to fix the primitive issues than to try and work around it. Note that this still has one bug: `std::primitive::i32::MAX` does not resolve. However, this fixes the ICE so I'm fine with fixing the link in a later PR. This is part of a series of refactors to make #76467 possible. This is best reviewed commit-by-commit; it has detailed commit messages. r? `@euclio`
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-1/+1
2020-09-23Unify primitive errors with other intra-link errorsJoshua Nelson-8/+32
Now that `PrimTy::name()` exists, there's no need to carry around the name of the primitive that failed to resolve. This removes the variants special-casing primitives in favor of `NotResolved`. - Remove `NoPrimitiveImpl` and `NoPrimitiveAssocItem` - Remove hacky `has_primitive` check in `resolution_failure()` - Fixup a couple tests that I forgot to `--bless` before
2020-09-23Fix intra-doc links for primitivesJoshua Nelson-4/+1
- Add `PrimTy::name` and `PrimTy::name_str` - Use those new functions to distinguish between the name in scope and the canonical name - Fix diagnostics for primitive types - Add tests for primitives