summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2019-06-06upgrade rustdoc's `pulldown-cmark` to 0.5.2Andy Russell-0/+9
Fixes #60482.
2019-05-20Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPCMazdak Farrokhzad-0/+3
Fix intra-doc link resolution failure on re-exporting libstd Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366). ```rust pub use std::*; ``` Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates. Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.) r? @QuietMisdreavus
2019-05-19Auto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27bors-4/+18
rustdoc: set the default edition when pre-parsing a doctest Fixes https://github.com/rust-lang/rust/issues/59313 (possibly more? i think we've had issues with parsing edition-specific syntax in doctests at some point) When handling a doctest, rustdoc needs to parse it beforehand, so that it can see whether it declares a `fn main` or `extern crate my_crate` explicitly. However, while doing this, rustdoc doesn't set the "default edition" used by the parser like the regular compilation runs do. This caused a problem when parsing a doctest with an `async move` block in it, since it was expecting the `move` keyword to start a closure, not a block. This PR changes the `rustdoc::test::make_test` function to set the parser's default edition while looking for a main function and `extern crate` statement. However, to do this, `make_test` needs to know what edition to set. Since this is also used during the HTML rendering process (to make playground URLs), now the HTML renderer needs to know about the default edition. Upshot: rendering standalone markdown files can now accept a "default edition" for their doctests with the `--edition` flag! (I'm pretty sure i waffled around how to set that a long time ago when we first added the `--edition` flag... `>_>`) I'm posting this before i stop for the night so that i can write this description while it's still in my head, but before this merges i want to make sure that (1) the `rustdoc-ui/failed-doctest-output` test still works (i expect it doesn't), and (2) i add a test with the sample from the linked issue.
2019-05-19Auto merge of #60760 - GuillaumeGomez:generic-display, r=varkor,badboybors-0/+30
Fix display of const generics in rustdoc <img width="745" alt="Screenshot 2019-05-18 at 15 45 22" src="https://user-images.githubusercontent.com/3050060/57970638-04854e80-7984-11e9-9f04-da6b51ec8bc7.png"> Part of #60737. cc @varkor r? @badboy
2019-05-18Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearthbors-2/+2
Fix attrs pos Fixes #60042. Screenshot: <img width="438" alt="Screenshot 2019-05-12 at 15 02 25" src="https://user-images.githubusercontent.com/3050060/57582606-1455ec00-74c7-11e9-9d4e-5ec4da4de7dd.png"> r? @rust-lang/rustdoc
2019-05-18Fix display of const generics in rustdocGuillaume Gomez-0/+30
2019-05-06add test for `async move` in a doctestQuietMisdreavus-0/+14
2019-05-06update playground url tests with new edition behaviorQuietMisdreavus-4/+4
2019-05-04Fix intra-doc link resolution failure on re-exporting libstdTaiki Endo-0/+3
2019-05-03use span instead of div for since versionAndy Russell-3/+2
2019-04-30rustdoc: remove def_ctor hack.Eduard-Mihai Burtescu-3/+2
2019-04-26Make "Implementations on Foreign Types" items in sidebar link to specific implsDmitry Murzin-0/+16
2019-04-26Rollup merge of #60134 - GuillaumeGomez:fix-index-page, r=ManishearthMazdak Farrokhzad-0/+3
Fix index-page generation Fixes #60096. The minifier was minifying crates name in `searchIndex` key position, which was a bit problematic for multiple reasons. r? @rust-lang/rustdoc
2019-04-24Remove useless code and update index page testGuillaume Gomez-0/+3
2019-04-23Stabilize futures_apiTaylor Cramer-1/+1
2019-04-23Remove unnecessary ignore-tidy-linelengthvarkor-6/+0
2019-04-22Remove double trailing newlinesvarkor-11/+0
2019-04-19Update testGuillaume Gomez-2/+2
2019-04-16Rollup merge of #59992 - QuietMisdreavus:static-settings-path, r=GuillaumeGomezMazdak Farrokhzad-0/+4
rustdoc: use --static-root-path for settings.js At the time i was writing https://github.com/rust-lang/docs.rs/pull/332, i noticed that the `settings.js` file that was being loaded was not being loaded from the `--static-root-path`. This PR fixes that so that users on docs.rs can effectively cache this file.
2019-04-15use --static-root-path for settings.jsQuietMisdreavus-0/+4
2019-04-14rustdoc: Remove default keyword from re-exported trait methodsOliver Middleton-15/+62
2019-04-11Auto merge of #58972 - QuietMisdreavus:intra-doc-link-imports, r=GuillaumeGomezbors-0/+18
rustdoc: don't process `Crate::external_traits` when collecting intra-doc links Part of https://github.com/rust-lang/rust/issues/58745, closes https://github.com/rust-lang/rust/pull/58917 The `collect-intra-doc-links` pass keeps track of the modules it recurses through as it processes items. This is used to know what module to give the resolver when looking up links. When looking through the regular items of the crate, this works fine, but the `DocFolder` trait as written doesn't just process the main crate hierarchy - it also processes the trait items in the `external_traits` map. This is useful for other passes (so they can strip out `#[doc(hidden)]` items, for example), but here it creates a situation where we're processing items "outside" the regular module hierarchy. Since everything in `external_traits` is defined outside the current crate, we can't fall back to finding its module scope like we do with local items. Skipping this collection saves us from emitting some spurious warnings. We don't even lose anything by skipping it, either - the docs loaded from here are only ever rendered through `html::render::document_short` which strips any links out, so the fact that the links haven't been loaded doesn't matter. Hopefully this removes most of the remaining spurious resolution warnings from intra-doc links. r? @GuillaumeGomez
2019-04-03Add test from #59033Guillaume Gomez-0/+6
2019-04-03Fix explicit_predicates_ofGuillaume Gomez-1/+1
2019-03-31Fix invalid bounds string generation in rustdocGuillaume Gomez-0/+7
2019-03-21Auto merge of #58927 - GuillaumeGomez:default-keyword, r=QuietMisdreavusbors-0/+15
Add default keyword handling in rustdoc Fixes #58898. r? @QuietMisdreavus
2019-03-15overhaul intra-doc-link ambiguity warningAndy Russell-1/+2
- Makes the warning part of the `intra_doc_link_resolution_failure` lint. - Tightens the span to just the ambiguous link. - Reports ambiguities across all three namespaces. - Uses structured suggestions for disambiguation. - Adds a test for the warnings.
2019-03-14Add default keyword handling in rustdocGuillaume Gomez-0/+15
2019-03-14Moved issue tests to subdirs and normalised names.Alexander Regueiro-4/+3
2019-03-06add test for spurious intra-doc link warningQuietMisdreavus-0/+18
2019-02-27Support defining C compatible variadic functionsDan Robertson-1/+1
Add support for defining C compatible variadic functions in unsafe rust with extern "C".
2019-02-23rustdoc: support methods on primitives in intra-doc linksTrevor Spiteri-0/+3
2019-02-20Rollup merge of #58409 - euclio:impl-trait-wrapping, r=QuietMisdreavuskennytm-0/+5
rustdoc: respect alternate flag when formatting impl trait Fixes #58226. Before: <img width="963" alt="screen shot 2019-02-12 at 3 23 30 pm" src="https://user-images.githubusercontent.com/1372438/52665732-4496ea00-2eda-11e9-9e29-efffe43b2abf.png"> After: <img width="964" alt="screen shot 2019-02-12 at 3 23 51 pm" src="https://user-images.githubusercontent.com/1372438/52665733-452f8080-2eda-11e9-999a-dd1fb28dee16.png">
2019-02-20Rollup merge of #56470 - llogiq:process-termination-doctest, r=GuillaumeGomezkennytm-0/+24
Modify doctest's auto-`fn main()` to allow `Result`s This lets the default `fn main()` ~~return `impl Termination`~~ unwrap Results, which allows the use of `?` in most tests without adding it manually. This fixes #56260 ~~Blocked on `std::process::Termination` stabilization.~~ Using `Termination` would have been cleaner, but this should work OK.
2019-02-17Modify doctest's auto-`fn main()` to allow `Result`sAndre Bogus-0/+24
This lets the default `fn main()` unwrap any `Result`s, which allows the use of `?` in most tests without adding it manually.
2019-02-17Rollup merge of #57929 - GuillaumeGomez:rustodc-remove-old-style-files, ↵kennytm-7/+17
r=ollie27 Rustdoc remove old style files Reopening of #56577 (which I can't seem to reopen...). I made the flag unstable so with this change, what was blocking the PR is now gone I assume.
2019-02-13Rollup merge of #58202 - varkor:deprecated-future-external, r=GuillaumeGomezMazdak Farrokhzad-1/+14
Ignore future deprecations in #[deprecated] The future deprecation warnings should only apply to `#[rustc_deprecated]` as they take into account rustc's version. Fixes #57952. I've also slightly modified rustdoc's display of future deprecation notices to make it more consistent, so I'm assigning a rustdoc team member for review to make sure this is okay. r? @GuillaumeGomez
2019-02-13Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkovMazdak Farrokhzad-0/+5
allow shorthand syntax for deprecation reason Fixes #48271. Created based on discussion in #56896.
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-2/+2
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12respect alternate flag when formatting impl traitAndy Russell-0/+5
2019-02-11Add rustdoc index page test for future deprecation attributesvarkor-0/+2
2019-02-11Add a rustdoc test for future rustc_deprecated attributesvarkor-0/+11
2019-02-11Update existing rustdoc testvarkor-1/+1
2019-02-10tests: doc commentsAlexander Regueiro-2/+2
2019-02-10Rollup merge of #58243 - GuillaumeGomez:trait-alias-docs, r=ManishearthGuillaume Gomez-0/+21
Add trait alias support in rustdoc Fixes #57595. r? @QuietMisdreavus
2019-02-10Rollup merge of #58203 - euclio:rustdoc-async, r=GuillaumeGomezGuillaume Gomez-7/+28
rustdoc: display sugared return types for async functions Fixes #58027.
2019-02-10Remove spotlight for trait aliases and fix nitsGuillaume Gomez-1/+1
2019-02-10Add trait alias support in rustdocGuillaume Gomez-0/+21
2019-02-09put back macro redirectGuillaume Gomez-1/+1
2019-02-07Rollup merge of #58033 - euclio:rustdoc-tags, r=QuietMisdreavusGuillaume Gomez-7/+15
rustdoc: wrap stability tags in colored spans A cosmetic change to make the stability tags stand out a bit against the docs. Opening for discussion. Before: ![screen shot 2019-01-31 at 3 29 36 pm](https://user-images.githubusercontent.com/1372438/52083406-54730d80-256d-11e9-8e61-b8caff569434.png) ![screen shot 2019-01-31 at 3 31 32 pm](https://user-images.githubusercontent.com/1372438/52083408-54730d80-256d-11e9-97b7-43e808448f65.png) After: ![screen shot 2019-01-31 at 3 29 18 pm](https://user-images.githubusercontent.com/1372438/52083405-54730d80-256d-11e9-9983-19d9519b2ed8.png) ![screen shot 2019-01-31 at 3 29 46 pm](https://user-images.githubusercontent.com/1372438/52083407-54730d80-256d-11e9-8c32-11a1ad7d3f34.png) r? @QuietMisdreavus