about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
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-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
2019-02-07Rollup merge of #58028 - GuillaumeGomez:fix-settings-image-link, ↵Guillaume Gomez-1/+1
r=QuietMisdreavus Fix image link in the settings menu Fixes #57892. r? @QuietMisdreavus
2019-02-07Rollup merge of #57954 - euclio:rustdoc-stability, r=QuietMisdreavusGuillaume Gomez-0/+12
rustdoc: remove blank unstable spans Rustdoc generates blank unstable spans for unstable struct fields: ![screen shot 2019-01-28 at 1 05 04 pm](https://user-images.githubusercontent.com/1372438/51856295-5e8ed500-22fd-11e9-8074-025eddb4ef65.png) This PR removes them: ![screen shot 2019-01-28 at 1 07 22 pm](https://user-images.githubusercontent.com/1372438/51856424-aada1500-22fd-11e9-86f0-34e2aa78b8b1.png) r? @QuietMisdreavus
2019-02-06display sugared return types for async functionsAndy Russell-7/+28
2019-02-05allow shorthand syntax for deprecation reasonAndy Russell-0/+5
2019-02-01don't try to get a DefId for a Def that doesn't have oneQuietMisdreavus-0/+8
2019-02-01Fix image link in the settings menuGuillaume Gomez-1/+1
2019-01-31rustdoc: wrap stability tags in colored spansAndy Russell-7/+15
2019-01-28rustdoc: remove blank unstable spansAndy Russell-0/+12
2019-01-27Make 'generate-redirect-pages' option unstableGuillaume Gomez-2/+2
2019-01-27Add generate-old-style-files option to rustdocGuillaume Gomez-23/+39
2019-01-27Remove rustdoc old style files generationGuillaume Gomez-29/+23
2019-01-22add intra-doc link test to proc-macro testQuietMisdreavus-0/+5
2019-01-20Auto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavusbors-0/+27
rustdoc: overhaul code block lexing errors Fixes #53919. This PR moves the reporting of code block lexing errors from rendering time to an early pass, so we can use the compiler's error reporting mechanisms. This dramatically improves the diagnostics in this situation: we now de-emphasize the lexing errors as a note under a warning that has a span and suggestion instead of just emitting errors at the top level. Additionally, this PR generalizes the markdown -> source span calculation function, which should allow other rustdoc warnings to use better spans in the future. Last, the PR makes sure that the code block is always emitted in the docs, even if it fails to highlight correctly. Of note: - The new pass unfortunately adds another pass over the docs to gather the doc blocks for syntax-checking. I wonder if this could be combined with the pass that looks for testable blocks? I'm not familiar with that code, so I don't know how feasible that is. - `pulldown_cmark` doesn't make it easy to find the spans of the code blocks, so the code that calculates the spans is a little nasty. It works for all the test cases I threw at it, but I wouldn't be surprised if an edge case would break it. Should have a thorough review. - This PR worsens the state of #56885, since those certain fatal lexing errors are now emitted before docs get generated at all.
2019-01-19Auto merge of #56722 - Aaron1011:fix/blanket-eval-overflow, r=nikomatsakisbors-0/+34
Fix stack overflow when finding blanket impls Currently, SelectionContext tries to prevent stack overflow by keeping track of the current recursion depth. However, this depth tracking is only used when performing normal section (which includes confirmation). No such tracking is performed for evaluate_obligation_recursively, which can allow a stack overflow to occur. To fix this, this commit tracks the current predicate evaluation depth. This is done separately from the existing obligation depth tracking: an obligation overflow can occur across multiple calls to 'select' (e.g. when fulfilling a trait), while a predicate evaluation overflow can only happen as a result of a deep recursive call stack. Fixes #56701 I've re-used `tcx.sess.recursion_limit` when checking for predication evaluation overflows. This is such a weird corner case that I don't believe it's necessary to have a separate setting controlling the maximum depth.
2019-01-17Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrumbors-13/+0
Add lint for copyright headers to 'tidy' tool r? @Mark-Simulacrum CC @centril
2019-01-14rustdoc: check code block syntax in early passAndy Russell-0/+27
2019-01-13Rollup merge of #56874 - JohnHeitmann:docs-spacing, r=GuillaumeGomezMazdak Farrokhzad-27/+27
Simplify foreign type rendering. Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on the `std::iter::Iterator` page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too. Known visual changes (happy to tweak based on feedback): * The main `impl ...` headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it. * There's a hair less vertical spacing between the end of a where block and the start of the next fn. Now, all spacing is consistent. I think this looks a bit worse. I may tweak vertical spacing more here or in a follow-up that cleans up vertical spacing more broadly. * "[src]" links are all sized at 17px. A few were 19px in the original. I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing. TODO: - [x] Test on Chrome - [x] Test on Firefox - [ ] ~~Test on UC Android~~ - [x] Test on Edge - [x] Test on iOS safari - [x] Test on desktop safari - [x] Update automated tests - [x] Increase vertical margin - [x] Fix "Important traits for" hover overlap - [x] Wait for #55798 to land & merge it
2019-01-13Removed more copyright notices.Alexander Regueiro-10/+0
2019-01-13Cosmetic improvementsAlexander Regueiro-3/+0
2019-01-10add test for pub extern crateDebugSteven-0/+11
2019-01-07Rollup merge of #57358 - euclio:docck-unicode, r=QuietMisdreavusPietro Albini-1/+1
use utf-8 throughout htmldocck This commit improves compatibility with Python 3, which already uses Unicode throughout. It also fixes a subtle incompatibility stemming from the use of `entitydefs`, which contains replacement text _encoded in latin-1_ for HTML entities. When using Python 3, this would cause `0xa0` to be incorrectly added to the element tree. This meant that there was a rustdoc test that would pass under Python 2 but fail under Python 3, due to an incorrect regex match against the non-breaking space character. This commit triggers that failure in both versions, and also fixes it.
2019-01-06use utf-8 throughout htmldocckAndy Russell-1/+1
This commit improves compatibility with Python 3, which already uses Unicode throughout. It also fixes a subtle incompatibility stemming from the use of `entitydefs`, which contains replacement text _encoded in latin-1_ for HTML entities. When using Python 3, this would cause `0xa0` to be incorrectly added to the element tree. This meant that there was a rustdoc test that would pass under Python 2 but fail under Python 3, due to an incorrect regex match against the non-breaking space character. This commit triggers that failure in both versions, and also fixes it.
2019-01-04force binary filename for compiled doctestsQuietMisdreavus-0/+7
2019-01-03Fix stack overflow when finding blanket implsAaron Hill-0/+34
Currently, SelectionContext tries to prevent stack overflow by keeping track of the current recursion depth. However, this depth tracking is only used when performing normal section (which includes confirmation). No such tracking is performed for evaluate_obligation_recursively, which can allow a stack overflow to occur. To fix this, this commit tracks the current predicate evaluation depth. This is done separately from the existing obligation depth tracking: an obligation overflow can occur across multiple calls to 'select' (e.g. when fulfilling a trait), while a predicate evaluation overflow can only happen as a result of a deep recursive call stack. Fixes #56701
2019-01-01Auto merge of #57194 - matthiaskrgr:copyright_headers, r=Centrilbors-10/+0
remove more copyright headers r? @Mark-Simulacrum
2018-12-29Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavusbors-0/+16
Add no-crate filter option on rustdoc @onur asked me about it so here it is! r? @QuietMisdreavus