summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2020-01-22Auto merge of #68192 - GuillaumeGomez:remove-inlined-types, r=kinnisonbors-0/+6
Remove usage of global variable "inlined_types" r? @pietroalbini
2020-01-20Add aliases attribute checkGuillaume Gomez-0/+6
2020-01-20rustdoc: Correct order of `async` and `unsafe` in `async unsafe fn`sOliver Middleton-0/+7
2020-01-20Rollup merge of #68326 - ollie27:rustdoc_hightlight_fatal_errors, ↵Dylan DPC-0/+7
r=GuillaumeGomez rustdoc: Catch fatal errors when syntax highlighting For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`. Fixes #56885 r? @GuillaumeGomez
2020-01-18Rollup merge of #68224 - GuillaumeGomez:prevent-urls-in-headings, r=ollie27Mazdak Farrokhzad-0/+17
Prevent urls in headings Fixes #68215. cc @pietroalbini @ollie27 r? @kinnison
2020-01-17Rollup merge of #68093 - GuillaumeGomez:fix-deref-impl-typedef, r=oli-obkTyler Mandry-0/+33
Fix deref impl typedef Fixes #35295. r? @kinnison
2020-01-17rustdoc: Catch fatal errors when syntax highlightingOliver Middleton-0/+7
For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.
2020-01-17Extend url in heading test a bitGuillaume Gomez-1/+1
2020-01-16Rollup merge of #68263 - ollie27:rustdoc_invalid_syntax_highlight_escape, ↵Dylan DPC-0/+8
r=GuillaumeGomez rustdoc: HTML escape codeblocks which fail syntax highlighting r? @GuillaumeGomez
2020-01-16Extend url in titles testGuillaume Gomez-0/+5
2020-01-15rustdoc: HTML escape codeblocks which fail syntax highlightingOliver Middleton-0/+8
2020-01-15Fix rendering on sidebar and update testsGuillaume Gomez-7/+21
2020-01-15Add test for typedef derefGuillaume Gomez-0/+19
2020-01-14Prevent urls in headingsGuillaume Gomez-0/+12
2020-01-14Code review changes and fix rustdoc test.Ben Lewis-1/+1
2020-01-09Rollup merge of #67955 - ollie27:rustdoc_cfg_dupes, r=GuillaumeGomezYuki Okushi-3/+30
rustdoc: Remove more `#[doc(cfg(..))]` duplicates This is a follow up to #66959. r? @GuillaumeGomez
2020-01-09Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomezYuki Okushi-5/+30
Distinguish between private items and hidden items in rustdoc I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document. This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another. Fixes #67851. Closes #60884.
2020-01-07Rollup merge of #67908 - ollie27:rustdoc_const_html_escape, r=GuillaumeGomezYuki Okushi-0/+10
rustdoc: HTML escape const values r? @GuillaumeGomez
2020-01-07Rollup merge of #67877 - dtolnay:const-_, r=nagisaYuki Okushi-0/+7
Omit underscore constants from rustdoc Underscore constants from https://github.com/rust-lang/rfcs/pull/2526 / https://github.com/rust-lang/rust/issues/54912 do not correspond to a nameable item and so are never useful in documentation. <br> #### Before: > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://user-images.githubusercontent.com/1940490/71771409-0427cc80-2eef-11ea-8b7d-d9c74a873e7e.png" width="60%"> #### After: > Not that.
2020-01-06rustdoc: Remove more `#[doc(cfg(..))]` duplicatesOliver Middleton-3/+30
2020-01-05rustdoc: HTML escape const valuesOliver Middleton-0/+10
2020-01-04Omit underscore constants from rustdocDavid Tolnay-0/+7
2020-01-04Distinguish between private items and hidden items in rustdocDavid Tolnay-5/+30
I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document. This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another.
2020-01-04rustdoc: Avoid panic when parsing codeblocks for playground linksOliver Middleton-0/+21
`make_test` is also called when parsing codeblocks for the playground links so it should handle unwinds from the parser internally.
2019-12-24Show value for consts in the documentationOhad Ravid-7/+66
2019-12-23Rollup merge of #67507 - Mark-Simulacrum:purge-uninit, r=CentrilMazdak Farrokhzad-3/+2
Remove mem::uninitalized from tests This purges uses of uninitialized where possible from test cases. Some are merely moved over to the equally bad pattern of MaybeUninit::uninit().assume_init() but with an annotation that this is "the best we can do". Fixes #62397
2019-12-22Remove mem::uninitalized from testsMark Rousskov-3/+2
This purges uses of uninitialized where possible from test cases. Some are merely moved over to the equally bad pattern of MaybeUninit::uninit().assume_init() but with an annotation that this is "the best we can do".
2019-12-22Change bound order in rustfmt testMark Rousskov-2/+2
It is unclear why this changed, but since it seems like a harmless change, we're going to move forward with reformatting.
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-6/+6
2019-12-13Fix rustdoc testOliver Scherer-2/+4
2019-12-13Reuse the `staged_api` feature for `rustc_const_unstable`Oliver Scherer-1/+1
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-2/+1
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on #54020, and can be used in the future to replace and simplify some of the Makefile tests.
2019-12-09compiletest: add aux-crate directiveEric Huss-2/+1
2019-12-04Remove potential cfgs duplicatesGuillaume Gomez-0/+15
2019-11-27Rollup merge of #66798 - bwignall:typo, r=varkorTyler Mandry-1/+1
Fix spelling typos Should be non-semantic. Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
2019-11-27Add support for intra-doc link fields of enum variantGuillaume Gomez-0/+14
2019-11-27Auto merge of #66675 - GuillaumeGomez:support-anchors-intra-doc-links, ↵bors-0/+12
r=kinnison Support anchors intra doc links Fixes #62833 Part of #43466. cc @ollie27 r? @kinnison
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-23Add test for anchorsGuillaume Gomez-0/+12
2019-11-23rustdoc: Mark `--extern-private` as unstableOliver Middleton-0/+1
It's not even stable in rustc so it shouldn't be stable in rustdoc.
2019-11-18Auto merge of #66238 - ehuss:stabilize-rustdoc-edition, r=GuillaumeGomezbors-1/+1
rustdoc: Stabilize `edition` annotation. The rustdoc `edition` annotation is currently ignored on stable. This means that the tests will be ignored, unless there is a `rust` annotation, then it will use the global edition. I suspect this was just an oversight during the edition stabilization, but I don't know. Example: ```rust /// ```edition2018 /// // This code block was ignored on stable. /// ``` /// ```rust,edition2018 /// // This code block would use whatever edition is passed on the command line. /// ``` ``` AFAIK, it is not possible to write a test that verifies stable behavior, as all tests appear to set RUSTC_BOOTSTRAP which forces all tests to run as "nightly", even on a stable release. Closes #65980
2019-11-13Auto merge of #66211 - kinnison:kinnison/fix-66159, r=GuillaumeGomezbors-0/+12
Fix ICE when documentation includes intra-doc-link When collecting intra-doc-links we could trigger the loading of extra crates into the crate store due to name resolution finding crates referred to in documentation but not in code. This might be due to configuration differences or simply referring to something else. This would cause an ICE because the newly loaded crate metadata existed in a crate store associated with the rustdoc global context, but the resolver had its own crate store cloned just before the documentation processing began and as such it could try and look up crates in a store which lacked them. In this PR, I add support for `--extern-private` to the `rustdoc` tool so that it is supported for `compiletest` to then pass the crates in; and then I fix the issue by forcing the resolver to look over all the crates before we then lower the input ready for processing into documentation. The first commit (the `--extern-private`) could be replaced with a commit which adds support for `--extern` to `compiletest` if preferred, though I think that adding `--extern-private` to `rustdoc` is more useful anyway since it makes the CLI a little more like `rustc`'s which might help reduce surprise for someone running it by hand or in their own test code. The PR is meant to fix #66159 though it may also fix #65840. cc @GuillaumeGomez
2019-11-08rustdoc: Stabilize `edition` annotation.Eric Huss-1/+1
2019-11-08rustdoc: Deliberately load extern crates before processing docsDaniel Silverstone-0/+12
In order that we can successfully later resolve paths in crates which weren't loaded as a result of merely parsing the crate we're documenting, we force the resolution of the path to each crate before cloning the resolver to use later. Closes #66159 Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-11-07Add more --extern tests.Eric Huss-1/+1
2019-11-01Rollup merge of #65857 - kinnison:kinnison/issue-55364, ↵Tyler Mandry-0/+88
r=Manisheart,GuillaumeGomez rustdoc: Resolve module-level doc references more locally Module level docs should resolve intra-doc links as locally as possible. As such, this commit alters the heuristic for finding intra-doc links such that we attempt to resolve names mentioned in *inner* documentation comments within the (sub-)module rather that from the context of its parent. I'm hoping that this fixes #55364 though right now I'm not sure it's the right fix. r? @GuillaumeGomez
2019-10-31rustdoc: Resolve module-level doc references more locallyDaniel Silverstone-0/+88
Module level docs should resolve intra-doc links as locally as possible. As such, this commit alters the heuristic for finding intra-doc links such that we attempt to resolve names mentioned in *inner* documentation comments within the (sub-)module rather that from the context of its parent. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-29stabilize cfg(doctest)Guillaume Gomez-2/+0
2019-10-22Fix rustdoc const generics testvarkor-0/+1
2019-10-21Rollup merge of #65314 - tmiasko:rustdoc-z, r=ollie27Mazdak Farrokhzad-0/+17
rustdoc: forward -Z options to rustc Currently rustdoc does not forward `-Z` options to rustc when building test executables. This makes impossible to use rustdoc to run test samples when crate under test is instrumented with one of sanitizers `-Zsanitizer=...`, since the final linking step will not include sanitizer runtime library. Forward `-Z` options to rustc to solve the issue. Helps with #43031.