about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2018-10-22Fix Rustdoc ICE when checking blanket implsAaron Hill-0/+31
Fixes #55001, #54744 Previously, SelectionContext would unconditionally cache the selection result for an obligation. This worked fine for most users of SelectionContext, but it caused an issue when used by Rustdoc's blanket impl finder. The issue occured when SelectionContext chose a ParamCandidate which contained inference variables. Since inference variables can change between calls to select(), it's not safe to cache the selection result - the chosen candidate might not be applicable for future results, leading to an ICE when we try to run confirmation. This commit prevents SelectionContext from caching any ParamCandidate that contains inference variables. This should always be completely safe, as trait selection should never depend on a particular result being cached. I've also added some extra debug!() statements, which I found helpful in tracking down this bug.
2018-10-22Fix multiple errorsGuillaume Gomez-2/+2
2018-10-21Update failing testGuillaume Gomez-3/+3
2018-10-15rustdoc: Use dyn keyword when rendering dynamic traitsOliver Middleton-4/+4
The dyn keyword has been stable for a while now so rustdoc should start using it.
2018-10-12Rollup merge of #54989 - Munksgaard:fix-htmldocck-typos, r=tmandrykennytm-3/+3
Fix spelling in the documentation to htmldocck.py I was reading through htmldocck.py, and decided to attempt to clean it up a little bit. Let me know if you disagree with my edits.
2018-10-11Include rustdoc tests that have been fixed by #33133Philip Munksgaard-3/+3
There was an issue (#33025) which caused these tests to not work. The issue has since been fixed in #33133, and so we can now include them.
2018-10-10Fix typo in issue-13698.rsPhilip Munksgaard-1/+1
2018-10-10Fix typo in deprecated_implsPhilip Munksgaard-1/+1
The function is called `fn_def_with_doc`, not `fn_def_with`.
2018-10-10Fix issue-46767 testPhilip Munksgaard-1/+2
The link that is matched against is not the same as would be generated by rustdoc. We should also check that the `foo/private` directory is not generated at all.
2018-10-10Use XPATH notation to match against flattened nodesPhilip Munksgaard-2/+2
The generated code would look like `<code>impl <a href="...">Foo</a></code>` which the plain text matcher doesn't match. But by using the XPATH notation, the nodes are flattened and we can correctly assert that `impl Foo` does not occur in the generated docs.
2018-10-05Fix empty-section.rs testPhilip Munksgaard-1/+1
The Auto Trait Implementation section is not wrapped in a `synthetic-implementations` class. In fact, it is wrapped in a `synthetic-implementations` id. However, we can generalize and completely remove the `synthetic-implementations` requirement. We just have to verify that there's no mention of "Auto Trait Implementations" anywhere.
2018-10-05Fix redirect.rs testPhilip Munksgaard-1/+2
Struct names are no longer encapsulated in `<code>` tags, which meant that the test was not correctly verifying that it wasn't being show. I've also added a check to make sure the documentation page for the redirect::Qux struct is not generated at all.
2018-10-05Fix unneeded-trait-implementations-title testPhilip Munksgaard-1/+1
The `@!has` command does not support specifying just a PATH and an XPATH. That means that the previous test searched for the literal string `//h2[@id="implementations"]` within the generated output, which obviously didn't exist. Even after adding a trait implementation, the test still passed. The correct way to check for the existence of a DOM element with the id `implementations` is to use the `@count` keyword.
2018-10-05Remove duplicate test linePhilip Munksgaard-1/+0
2018-10-05Stabilize `min_const_fn`Oliver Schneider-5/+0
2018-10-04Add compile flags to playground-empty testPhilip Munksgaard-0/+2
"Run" links to the playground are not added to the generated documentation if the unstable `--playground-url` argument is not passed to rustdoc. Therefore, without specifying `--playground-url` as a compile-flag, the test doesn't correctly assert that `#![doc(html_playground_url = "")]` removes playground links.
2018-10-04replace escape-rust-expr test with dont-show-const-contentsPhilip Munksgaard-4/+4
The old test was supposed to check for proper html escaping when showing the contents of constants. This was changed as part of #53409. The revised test asserts that the contents of the constant is not shown as part of the generated documentation.
2018-09-29Rollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomezkennytm-0/+126
rustdoc: give proc-macros their own pages related to https://github.com/rust-lang/rust/issues/49553 but i don't think it'll fix it Currently, rustdoc doesn't expose proc-macros all that well. In the source crate, only their definition function is exposed, but when re-exported, they're treated as a macro! This is an awkward situation in all accounts. This PR checks functions to see whether they have any of `#[proc_macro]`, `#[proc_macro_attribute]`, or `#[proc_macro_derive]`, and exposes them as macros instead. In addition, attributes and derives are exposed differently than other macros, getting their own item-type, CSS class, and module heading. ![image](https://user-images.githubusercontent.com/5217170/46044803-6df8da00-c0e1-11e8-8c3b-25d2c3beb55c.png) Function-like proc-macros are lumped in with `macro_rules!` macros, but they get a different declaration block (i'm open to tweaking this, it's just what i thought of given how function-proc-macros operate): ![image](https://user-images.githubusercontent.com/5217170/46044828-84069a80-c0e1-11e8-9cc4-127e5477c395.png) Proc-macro attributes and derives get their own pages, with a representative declaration block. Derive macros also show off their helper attributes: ![image](https://user-images.githubusercontent.com/5217170/46094583-ef9f4500-c17f-11e8-8f71-fa0a7895c9f6.png) ![image](https://user-images.githubusercontent.com/5217170/46101529-cab3cd80-c191-11e8-857a-946897750da1.png) There's one wrinkle which this PR doesn't address, which is why i didn't mark this as fixing the linked issue. Currently, proc-macros don't expose their attributes or source span across crates, so while rustdoc knows they exist, that's about all the information it gets. This leads to an "inlined" macro that has absolutely no docs on it, and no `[src]` link to show you where it was declared. The way i got around it was to keep proc-macro re-export disabled, since we do get enough information across crates to properly link to the source page: ![image](https://user-images.githubusercontent.com/5217170/46045074-2cb4fa00-c0e2-11e8-81bc-33a8205fbd03.png) Until we can get a proc-macro's docs (and ideally also its source span) across crates, i believe this is the best way forward.
2018-09-27check for proc-macros in "all items"QuietMisdreavus-0/+8
2018-09-26Auto merge of #54199 - nikomatsakis:predicate_may_hold-failure, r=eddybbors-0/+171
overlook overflows in rustdoc trait solving Context: The new rustdoc "auto trait" feature walks across impls and tries to run trait solving on them with a lot of unconstrained variables. This is prone to overflows. These overflows used to cause an ICE because of a caching bug (fixed in this PR). But even once that is fixed, it means that rustdoc causes an overflow rather than generating docs. This PR therefore adds a new helper that propagates the overflow error out. This requires rustdoc to then decide what to do when it encounters such an overflow: technically, an overflow represents neither "yes" nor "no", but rather a failure to make a decision. I've decided to opt on the side of treating this as "yes, implemented", since rustdoc already takes an optimistic view. This may prove to include too many items, but I *suspect* not. We could probably reduce the rate of overflows by unifying more of the parameters from the impl -- right now we only seem to consider the self type. Moreover, in the future, as we transition to Chalk, overflow errors are expected to just "go away" (in some cases, though, queries might return an ambiguous result). Fixes #52873 cc @QuietMisdreavus -- this is the stuff we were talking about earlier cc @GuillaumeGomez -- this supersedes #53687
2018-09-25add test for proc-macro re-exportQuietMisdreavus-0/+64
2018-09-25handle proc-macros as macros instead of functionsQuietMisdreavus-0/+54
2018-09-25add regression testNiko Matsakis-0/+171
2018-09-22Rollup merge of #54350 - Munksgaard:support-edition-in-doc-test, r=steveklabnikPietro Albini-0/+54
Support specifying edition in doc test Fixes #52623 r? @QuietMisdreavus
2018-09-20fix intra-links for trait implsQuietMisdreavus-0/+40
2018-09-20don't index trait impls if the trait isn't also documentedQuietMisdreavus-0/+23
2018-09-20add more tests for traits-in-non-module-scopeQuietMisdreavus-4/+62
2018-09-20don't check visibility when inlining local implsQuietMisdreavus-0/+28
those get handled properly in strip-hidden anyway
2018-09-20ignore rustdoc/doc-proc-macro on stage1QuietMisdreavus-0/+2
2018-09-20rustdoc: collect trait impls as an early passQuietMisdreavus-3/+15
2018-09-20Add test for doctest edition supportPhilip Munksgaard-0/+54
2018-09-18Rollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, ↵Guillaume Gomez-0/+1
r=QuietMisdreavus rustdoc: Remove namespace for keywords Fixes #54084. r? @QuietMisdreavus
2018-09-16Check the remaining nodesKazuyoshi Kato-0/+4
2018-09-14Add a test to prevent regressionKazuyoshi Kato-0/+26
The way it defines implementations is unrealistic though.
2018-09-12Auto merge of #53409 - GuillaumeGomez:associated-const-value, r=QuietMisdreavusbors-29/+4
Don't show associated const value anymore Part of #44348. Before: <img width="1440" alt="screen shot 2018-08-16 at 00 48 30" src="https://user-images.githubusercontent.com/3050060/44177414-20ef1480-a0ee-11e8-80d4-7caf082cf0de.png"> After: <img width="1440" alt="screen shot 2018-08-16 at 00 48 23" src="https://user-images.githubusercontent.com/3050060/44177417-251b3200-a0ee-11e8-956a-4229275e3342.png"> cc @nox r? @QuietMisdreavus
2018-09-10Remove namespace for keywordsGuillaume Gomez-0/+1
2018-09-09rustdoc: Remove generated blanket impls from trait pagesOliver Middleton-0/+37
2018-09-06Fix hover on implsGuillaume Gomez-2/+4
2018-09-01Auto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkorbors-3/+3
Implement the `min_const_fn` feature gate cc @RalfJung @eddyb r? @Centril implements the feature gate for #53555 I added a hack so the `const_fn` feature gate also enables the `min_const_fn` feature gate. This ensures that nightly users of `const_fn` don't have to touch their code at all. The `min_const_fn` checks are run first, and if they succeeded, the `const_fn` checks are run additionally to ensure we didn't miss anything.
2018-08-31Auto merge of #51384 - QuietMisdreavus:extern-version, r=GuillaumeGomezbors-0/+18
rustdoc: add flag to control the html_root_url of dependencies The `--extern-html-root-url` flag in this PR allows one to override links to crates whose docs are not already available locally in the doc bundle. Docs.rs currently uses a version of this to make sure links to other crates go into that crate's docs.rs page. See the included test for intended use, but the idea is as follows: Calling rustdoc with `--extern-html-root-url crate=https://some-url.com` will cause rustdoc to override links that point to that crate to instead be replaced with a link rooted at `https://some-url.com/`. (e.g. for docs.rs this would be `https://docs.rs/crate/0.1.0` or the like.) Cheekily, rustup could use these options to redirect links to std/core/etc to instead point to locally-downloaded docs, if it so desired. Fixes https://github.com/rust-lang/rust/issues/19603
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-3/+3
2018-08-29Replace usages of 'bad_style' with 'nonstandard_style'.Corey Farwell-1/+1
`bad_style` is being deprecated in favor of `nonstandard_style`: - https://github.com/rust-lang/rust/issues/41646
2018-08-26Remove static and const initialization from documentationGuillaume Gomez-3/+3
2018-08-25Update testsGuillaume Gomez-26/+1
2018-08-22Rollup merge of #53541 - GuillaumeGomez:fix-impl-trait-ret-type, r=oli-obkGuillaume Gomez-0/+40
Fix missing impl trait display as ret type I need to convert a `TraitPredicate` into a `TraitBound` to get the returned impl trait. So far, didn't find how or even if it was the good way to do it. cc @eddyb @oli-obk (since you're the one behind the change apparently 😉)
2018-08-21Auto merge of #53439 - ↵bors-0/+18
GuillaumeGomez:generate-blanket-impls-for-reexported-items, r=QuietMisdreavus Generate blanket implementations for reexported items as well Fixes #53374. r? @QuietMisdreavus
2018-08-21Fix missing impl trait display as ret typeGuillaume Gomez-0/+40
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-17Auto merge of #50911 - petrochenkov:macuse, r=alexcrichtonbors-7/+0
Stabilize `use_extern_macros` Closes https://github.com/rust-lang/rust/issues/35896
2018-08-17Stabilize `use_extern_macros`Vadim Petrochenkov-7/+0