Commit Graph

910 Commits

Author SHA1 Message Date
Guillaume Gomez
541ad45a83 Add default keyword handling in rustdoc 2019-03-14 13:18:36 +01:00
Alexander Regueiro
fe30743c79 Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
QuietMisdreavus
49cde40412 add test for spurious intra-doc link warning 2019-03-06 10:57:38 -06:00
Dan Robertson
58147d486b
Support defining C compatible variadic functions
Add support for defining C compatible variadic functions in unsafe rust
with extern "C".
2019-02-27 10:21:35 -05:00
Trevor Spiteri
bde4d1945c rustdoc: support methods on primitives in intra-doc links 2019-02-23 18:01:26 +01:00
kennytm
8d1e4323b3
Rollup merge of #58409 - euclio:impl-trait-wrapping, r=QuietMisdreavus
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-20 11:58:31 +08:00
kennytm
5a06eab1f5
Rollup merge of #56470 - llogiq:process-termination-doctest, r=GuillaumeGomez
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-20 01:13:12 +08:00
Andre Bogus
dad211ef9f Modify doctest's auto-fn main() to allow Results
This lets the default `fn main()` unwrap any `Result`s, which
allows the use of `?` in most tests without adding it manually.
2019-02-17 16:42:49 +01:00
kennytm
f8ccdeb0d4
Rollup merge of #57929 - GuillaumeGomez:rustodc-remove-old-style-files, 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-17 14:52:21 +08:00
Mazdak Farrokhzad
193c3773c2
Rollup merge of #58202 - varkor:deprecated-future-external, r=GuillaumeGomez
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-13 18:12:30 +01:00
Mazdak Farrokhzad
856e41142c
Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkov
allow shorthand syntax for deprecation reason

Fixes #48271.

Created based on discussion in #56896.
2019-02-13 04:37:02 +01:00
bors
b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
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-12 19:09:24 +00:00
Andy Russell
e827c9ab3c
respect alternate flag when formatting impl trait 2019-02-12 13:45:36 -05:00
varkor
c8752415dc Add rustdoc index page test for future deprecation attributes 2019-02-11 11:17:35 +00:00
varkor
01df8fe8ff Add a rustdoc test for future rustc_deprecated attributes 2019-02-11 11:17:35 +00:00
varkor
3dc660f1f5 Update existing rustdoc test 2019-02-11 11:17:35 +00:00
Alexander Regueiro
b87363e763 tests: doc comments 2019-02-10 23:42:32 +00:00
Guillaume Gomez
adf516b94e
Rollup merge of #58243 - GuillaumeGomez:trait-alias-docs, r=Manishearth
Add trait alias support in rustdoc

Fixes #57595.

r? @QuietMisdreavus
2019-02-10 21:45:13 +01:00
Guillaume Gomez
cdbd07cc40
Rollup merge of #58203 - euclio:rustdoc-async, r=GuillaumeGomez
rustdoc: display sugared return types for async functions

Fixes #58027.
2019-02-10 21:45:12 +01:00
Guillaume Gomez
b1d82ac6ed Remove spotlight for trait aliases and fix nits 2019-02-10 16:56:21 +01:00
Guillaume Gomez
74e97f3381 Add trait alias support in rustdoc 2019-02-10 14:49:20 +01:00
Guillaume Gomez
d26475505b put back macro redirect 2019-02-09 14:29:03 +01:00
Guillaume Gomez
f61a4f86db
Rollup merge of #58033 - euclio:rustdoc-tags, r=QuietMisdreavus
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-07 14:28:34 +01:00
Guillaume Gomez
1a99a32bd7
Rollup merge of #58028 - GuillaumeGomez:fix-settings-image-link, r=QuietMisdreavus
Fix image link in the settings menu

Fixes #57892.

r? @QuietMisdreavus
2019-02-07 14:28:33 +01:00
Guillaume Gomez
bb9d66d3ba
Rollup merge of #57954 - euclio:rustdoc-stability, r=QuietMisdreavus
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-07 14:28:32 +01:00
Andy Russell
4deb5959a3
display sugared return types for async functions 2019-02-06 09:24:03 -05:00
Andy Russell
113b7f7be1
allow shorthand syntax for deprecation reason 2019-02-05 15:26:26 -05:00
QuietMisdreavus
c955f172b2 don't try to get a DefId for a Def that doesn't have one 2019-02-01 11:17:33 -06:00
Guillaume Gomez
5cf20ca3c5 Fix image link in the settings menu 2019-02-01 11:27:59 +01:00
Andy Russell
ea2b1b035b
rustdoc: wrap stability tags in colored spans 2019-01-31 15:15:59 -05:00
Andy Russell
30b1c35f03
rustdoc: remove blank unstable spans 2019-01-28 13:04:05 -05:00
Guillaume Gomez
65440a3f4f Make 'generate-redirect-pages' option unstable 2019-01-27 12:46:18 +01:00
Guillaume Gomez
270151bffb Add generate-old-style-files option to rustdoc 2019-01-27 12:46:18 +01:00
Guillaume Gomez
1ac727772b Remove rustdoc old style files generation 2019-01-27 00:34:05 +01:00
QuietMisdreavus
b876694734 add intra-doc link test to proc-macro test 2019-01-22 15:44:19 -06:00
bors
846ea58cd5 Auto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavus
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-20 19:01:38 +00:00
bors
af73e64423 Auto merge of #56722 - Aaron1011:fix/blanket-eval-overflow, r=nikomatsakis
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-19 05:05:48 +00:00
bors
6599946272 Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrum
Add lint for copyright headers to 'tidy' tool

r? @Mark-Simulacrum

CC @centril
2019-01-17 07:36:37 +00:00
Andy Russell
8c93798e9f
rustdoc: check code block syntax in early pass 2019-01-14 21:21:21 -05:00
Mazdak Farrokhzad
6d00124b85
Rollup merge of #56874 - JohnHeitmann:docs-spacing, r=GuillaumeGomez
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-13 21:18:09 +01:00
Alexander Regueiro
2e30a3c4d8 Removed more copyright notices. 2019-01-13 19:47:02 +00:00
Alexander Regueiro
88336ea4c3 Cosmetic improvements 2019-01-13 19:47:02 +00:00
DebugSteven
ca47808479 add test for pub extern crate 2019-01-10 21:18:46 -05:00
Pietro Albini
14fb35fa4f
Rollup merge of #57358 - euclio:docck-unicode, r=QuietMisdreavus
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-07 16:25:36 +01:00
Andy Russell
6fefcee73a
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-06 01:27:33 -05:00
QuietMisdreavus
0b55c79072 force binary filename for compiled doctests 2019-01-04 09:57:17 -06:00
Aaron Hill
6d54672acf
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
2019-01-03 21:56:52 -05:00
bors
0432798fdb Auto merge of #57194 - matthiaskrgr:copyright_headers, r=Centril
remove more copyright headers

r? @Mark-Simulacrum
2019-01-01 06:34:11 +00:00
bors
43d26b1f35 Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus
Add no-crate filter option on rustdoc

@onur asked me about it so here it is!

r? @QuietMisdreavus
2018-12-29 01:22:04 +00:00
Matthias Krüger
68860989eb remove remaining copyright headers 2018-12-28 21:50:33 +01:00
John Heitmann
34bd2b845b 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 std::iter::Iterator by 30%.
2018-12-27 21:22:27 -08:00
bors
f2b92174e3 Auto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakis
Call poly_project_and_unify_type on types that contain inference types

Commit f57247c48c (Ensure that Rusdoc discovers all necessary auto
trait bounds) added a check to ensure that we only attempt to unify a
projection predicatre with inference variables. However, the check it
added was too strict - instead of checking that a type *contains* an
inference variable (e.g. '&_', 'MyType<_>'), it required the type to
*be* an inference variable (i.e. only '_' would match).

This commit relaxes the check to use 'ty.has_infer_types', ensuring that
we perform unification wherever possible.

Fixes #56822
2018-12-27 14:35:58 +00:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Guillaume Gomez
dbcf68951c Add no-crate filter option on rustdoc 2018-12-24 18:19:36 +01:00
Mazdak Farrokhzad
b42a3acaec stabilize min_const_unsafe_fn in 1.33. 2018-12-23 10:29:38 +01:00
kennytm
4446c65d9b
Rollup merge of #57011 - QuietMisdreavus:static-root-path, r=GuillaumeGomez
rustdoc: add new CLI flag to load static files from a different location

This PR adds a new CLI flag to rustdoc, `--static-root-path`, which controls how rustdoc links pages to the CSS/JS/font static files bundled with the output. By default, these files are linked with a series of `../` which is calculated per-page to link it to the documentation root - i.e. a relative link to the directory given by `-o`. This is causing problems for docs.rs, because even though docs.rs has saved one copy of these files and is dispatching them dynamically, browsers have no way of knowing that these are the same files and can cache them. This can allow it to link these files as, for example, `/rustdoc.css` instead of `../../rustdoc.css`, creating a single location that the files are loaded from.

I made sure to only change links for the *static* files, those that don't change between crates. Files like the search index, aliases, the source files listing, etc, are still linked with relative links.

r? @GuillaumeGomez

cc @onur
2018-12-23 02:12:16 +08:00
bors
24667aa19d Auto merge of #56824 - euclio:internal-apis, r=QuietMisdreavus
rustdoc: display rustc_private APIs as "Internal"

This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion.

The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces.

Before:

![screen shot 2018-12-14 at 11 45 28 am](https://user-images.githubusercontent.com/1372438/50015926-c9768d80-ff95-11e8-9649-5df29df6909b.png)

After:

![screen shot 2018-12-14 at 11 45 11 am](https://user-images.githubusercontent.com/1372438/50015934-cf6c6e80-ff95-11e8-912b-74b893f55425.png)
2018-12-22 04:21:30 +00:00
bors
6d34ec18c7 Auto merge of #55798 - GuillaumeGomez:version-display-associated-const, r=QuietMisdreavus
Add version display for associated consts

Fixes #54030.

<img width="1440" alt="screenshot 2018-11-08 at 23 57 29" src="https://user-images.githubusercontent.com/3050060/48232648-99decf00-e3b2-11e8-9f41-6bd12a161c7d.png">

r? @QuietMisdreavus
2018-12-21 01:58:16 +00:00
bors
09d6ab90e5 Auto merge of #56845 - GuillaumeGomez:const-docs, r=oli-obk
Don't render const keyword on stable

Fixes #55246.

Continuation of #55327.

r? @oli-obk
2018-12-20 19:26:12 +00:00
Andy Russell
8d393bf797
display rustc_private APIs as "Internal" 2018-12-20 13:47:39 -05:00
QuietMisdreavus
8dc8d7ac51 split extra_scripts to handle root_path shenanigans 2018-12-20 10:57:03 -06:00
QuietMisdreavus
0b0a00cc05 new --static-root-path flag for controlling static file locations 2018-12-20 10:18:45 -06:00
Guillaume Gomez
ca04c63930 Add test for associated const version display 2018-12-20 10:39:25 +01:00
Guillaume Gomez
a6943d9d66 Set constness correctly 2018-12-19 09:57:29 +01:00
Guillaume Gomez
170f068103 Don't render const keyword on stable 2018-12-18 20:36:15 +01:00
Guillaume Gomez
2968a5a398 Fix DOM errors 2018-12-18 01:04:23 +01:00
Mazdak Farrokhzad
32a6a95f41
Rollup merge of #56793 - QuietMisdreavus:better-doctests, r=GuillaumeGomez
rustdoc: look for comments when scraping attributes/crates from doctests

Fixes https://github.com/rust-lang/rust/issues/56727

When scraping out crate-level attributes and `extern crate` statements, we wouldn't look for comments, so any presence of comments would shunt it and everything after it into "everything else". This could cause parsing issues when looking for `fn main` and `extern crate my_crate` later on, which would in turn cause rustdoc to incorrectly wrap a test with `fn main` when it already had one declared.

I took the opportunity to clean up the logic a little bit, but it would still benefit from a libsyntax-based loop like the `fn main` detection.
2018-12-16 14:08:30 +01:00
Aaron Hill
a375410e1f
Call poly_project_and_unify_type on types that contain inference types
Commit f57247c48c (Ensure that Rusdoc discovers all necessary auto
trait bounds) added a check to ensure that we only attempt to unify a
projection predicatre with inference variables. However, the check it
added was too strict - instead of checking that a type *contains* an
inference variable (e.g. '&_', 'MyType<_>'), it required the type to
*be* an inference variable (i.e. only '_' would match).

This commit relaxes the check to use 'ty.has_infer_types', ensuring that
we perform unification wherever possible.

Fixes #56822
2018-12-14 21:33:25 -05:00
Andy Russell
5f3431691d
simplify deprecation and stability rendering 2018-12-14 11:15:25 -05:00
QuietMisdreavus
8faaef66c9 add test for parsing comments in doctest headers 2018-12-14 09:17:11 -06:00
Oliver Middleton
0bb075f5a5 rustdoc: Fix local reexports of proc macros
Filter out `ProcMacroStub`s to avoid an ICE during cleaning.

Also add proc macros to `cache().paths` so it can generate links.
2018-12-08 18:33:09 +00:00
bors
5182cc1ca6 Auto merge of #55318 - Aaron1011:fix/final-auto-trait-resolve, r=nikomatsakis
Ensure that Rustdoc discovers all necessary auto trait bounds

Fixes #50159

This commit makes several improvements to AutoTraitFinder:

* Call infcx.resolve_type_vars_if_possible before processing new
predicates. This ensures that we eliminate inference variables wherever
possible.
* Process all nested obligations we get from a vtable, not just ones
with depth=1.
  * The 'depth=1' check was a hack to work around issues processing
certain predicates. The other changes in this commit allow us to
properly process all predicates that we encounter, so the check is no
longer necessary,
* Ensure that we only display predicates *without* inference variables
to the user, and only attempt to unify predicates that *have* an
inference variable as their type.

Additionally, the internal helper method is_of_param now operates
directly on a type, rather than taking a Substs. This allows us to use
the 'self_ty' method, rather than directly dealing with Substs.
2018-12-06 22:23:24 +00:00
Pietro Albini
3073c7af5f
Rollup merge of #56315 - weiznich:rustdoc_inline_macro_reexport, r=QuietMisdreavus
Rustdoc inline macro reexport

Fixes #56173

I assume this needs to have tests? Any pointers where these need to be added?
2018-12-06 07:48:48 +01:00
Georg Semmler
956b03f7db
Add a test case for inlining the docs of a macro reexport 2018-12-04 10:24:17 +01:00
bors
596e10fd32 Auto merge of #55707 - GuillaumeGomez:file-sidebar, r=QuietMisdreavus
Add source file sidebar

This is just a start currently but that gives a good overview of what it'll look like:

<img width="1440" alt="screenshot 2018-11-06 at 01 39 15" src="https://user-images.githubusercontent.com/3050060/48035592-05336180-e165-11e8-82e1-5ead0c345eb9.png">

r? @QuietMisdreavus
2018-12-04 07:00:19 +00:00
bors
91d5d56c00 Auto merge of #55682 - GuillaumeGomez:primitive-sidebar-link-gen, r=QuietMisdreavus
Fixes primitive sidebar link generation

Fixes #50746.
Fixes #55656.

r? @QuietMisdreavus
2018-12-04 03:34:32 +00:00
Eduard-Mihai Burtescu
3369929ddb tests: use force-host and no-prefer-dynamic in all proc_macro tests. 2018-11-30 06:15:20 +02:00
Eduard-Mihai Burtescu
d3ab4a74ef tests: remove ignore-stage1 where possible in proc_macro tests. 2018-11-30 06:15:20 +02:00
Aaron Hill
9139374181
Fix Tidy error 2018-11-28 21:39:20 -05:00
Aaron Hill
5045e12bd7
Filter out self-referential projection predicates
If we end up with a projection predicate that equates a type with
itself (e.g. <T as MyType>::Value == <T as MyType>::Value), we can
run into issues if we try to add it to our ParamEnv.
2018-11-28 21:15:06 -05:00
Aaron Hill
f57247c48c
Ensure that Rusdoc discovers all necessary auto trait bounds
Fixes #50159

This commit makes several improvements to AutoTraitFinder:

* Call infcx.resolve_type_vars_if_possible before processing new
predicates. This ensures that we eliminate inference variables wherever
possible.
* Process all nested obligations we get from a vtable, not just ones
with depth=1.
  * The 'depth=1' check was a hack to work around issues processing
certain predicates. The other changes in this commit allow us to
properly process all predicates that we encounter, so the check is no
longer necessary,
* Ensure that we only display predicates *without* inference variables
to the user, and only attempt to unify predicates that *have* an
inference variable as their type.

Additionally, the internal helper method is_of_param now operates
directly on a type, rather than taking a Substs. This allows us to use
the 'self_ty' method, rather than directly dealing with Substs.
2018-11-28 12:27:11 -05:00
Guillaume Gomez
1b432a612f Add test for source files feature 2018-11-24 14:24:54 +01:00
Guillaume Gomez
c746ecfa01 Add test for sidebar link generation 2018-11-21 23:21:50 +01:00
bors
f1d61837d1 Auto merge of #55912 - kennytm:rollup, r=kennytm
Rollup of 20 pull requests

Successful merges:

 - #55136 (Remove short doc where it starts with a codeblock)
 - #55711 (Format BtreeMap::range_mut example)
 - #55722 (impl_stable_hash_for: support enums and tuple structs with generic parameters)
 - #55754 (Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err)
 - #55804 (rustdoc: don't inline `pub use some_crate` unless directly asked to)
 - #55805 (Move `static_assert!` into librustc_data_structures)
 - #55837 (Make PhantomData #[structural_match])
 - #55840 (Fix TLS errors when downloading stage0)
 - #55843 (add FromIterator<A> to Box<[A]>)
 - #55858 (Small fixes on code blocks in rustdoc)
 - #55863 (Fix a typo in std::panic)
 - #55870 (Fix typos.)
 - #55874 (string: Add documentation for `From` impls)
 - #55879 (save-analysis: Don't panic for macro-generated use globs)
 - #55882 (Reference count `crate_inherent_impls`s return value.)
 - #55888 (miri: for uniformity, also move memory_deallocated to AllocationExtra)
 - #55889 (global allocators: add a few comments)
 - #55896 (Document optimizations enabled by FusedIterator)
 - #55905 (Change `Lit::short_name` to `Lit::literal_name`.)
 - #55908 (Fix their/there grammar nit)
2018-11-13 22:17:46 +00:00
bors
9fefb67669 Auto merge of #55356 - Aaron1011:fix/rustdoc-negative-auto, r=nikomatsakis
Check for negative impls when finding auto traits

Fixes #55321

When AutoTraitFinder begins examining a type, it checks for an explicit
negative impl. However, it wasn't checking for negative impls found when
calling 'select' on predicates found from nested obligations.

This commit makes AutoTraitFinder check for negative impls whenever it
makes a call to 'select'. If a negative impl is found, it immediately
bails out.

Normal users of SelectioContext don't need to worry about this, since
they stop as soon as an Unimplemented error is encountered. However, we
add predicates to our ParamEnv when we encounter this error, so we need
to handle negative impls specially (so that we don't try adding them to
our ParamEnv).
2018-11-13 19:16:18 +00:00
kennytm
2173681647
Rollup merge of #55136 - GuillaumeGomez:short-doc, r=QuietMisdreavus
Remove short doc where it starts with a codeblock

Fixes #54975.
2018-11-13 19:21:09 +08:00
Guillaume Gomez
3030cbea95 Remove short doc where it starts with a codeblock 2018-11-10 19:03:58 +01:00
QuietMisdreavus
401cb6bb53 don't inline pub use some_crate unless directly asked to 2018-11-09 09:07:57 -06:00
kennytm
88f214cfd5
Rollup merge of #55453 - Aaron1011:fix/rustdoc-lifetime, r=pnkfelix
Choose predicates without inference variables over those with them

Fixes #54705

When constructing synthetic auto trait impls, we may come across
multiple predicates involving the same type, trait, and substitutions.
Since we can only display one of these, we pick the one with the 'most
strict' lifetime paramters. This ensures that the impl we render the
user is actually valid (that is, a struct matching that impl will
actually implement the auto trait in question).

This commit exapnds the definition of 'more strict' to take into account
inference variables. We always choose a predicate without inference
variables over a predicate with inference variables.
2018-11-07 18:01:48 +08:00
Guillaume Gomez
c674335ba3
Rollup merge of #55568 - durka:rustdoc-big-enum, r=nikomatsakis
test that rustdoc doesn't overflow on a big enum

Adds a test to close #25295. The test case depended on `enum_primitive` so I just basically pulled its source into an auxiliary file, is that the right way to do it?
2018-11-03 13:40:37 +01:00
Guillaume Gomez
336b02347f
Rollup merge of #54162 - GuillaumeGomez:hide-default-impls-items, r=QuietMisdreavus
Hide default impls items

Follow up of #51885.
Fixes #54025.

cc @Mark-Simulacrum

r? @QuietMisdreavus

And screenshots of course:

<img width="1440" alt="screen shot 2018-09-12 at 23 30 35" src="https://user-images.githubusercontent.com/3050060/45454424-1ff8d500-b6e4-11e8-9257-030322495d58.png">

<img width="1440" alt="screen shot 2018-09-12 at 23 30 42" src="https://user-images.githubusercontent.com/3050060/45454431-2424f280-b6e4-11e8-8d65-db0d85ac18f0.png">
2018-11-03 13:40:32 +01:00
Guillaume Gomez
ca65b4304e Don't show associated const items by default 2018-11-02 23:10:27 +01:00
bors
e53a5ffd6b Auto merge of #54543 - GuillaumeGomez:top-level-index, r=QuietMisdreavus
Add index page argument

@Mark-Simulacrum: I might need some help from you: in bootstrap, I want to add an argument (a new flag added into `rustdoc`) in order to generate the current index directly when `rustdoc` is documenting the `std` lib. However, my change in `bootstrap` didn't do it and I assume it must be moved inside the `Std` struct. But there, I don't see how to pass it to `rustdoc` through `cargo`. Did I miss anything?

r? @QuietMisdreavus
2018-11-02 15:39:25 +00:00
Guillaume Gomez
7f7d8fbb2f Add test for index-page 2018-11-02 00:01:53 +01:00
Alex Burka
273930e59f test that rustdoc doesn't overflow on a big enum 2018-11-01 04:02:43 +00:00
Aaron Hill
20aa751383
Choose predicates without inference variables over those with them
Fixes #54705

When constructing synthetic auto trait impls, we may come across
multiple predicates involving the same type, trait, and substitutions.
Since we can only display one of these, we pick the one with the 'most
strict' lifetime paramters. This ensures that the impl we render the
user is actually valid (that is, a struct matching that impl will
actually implement the auto trait in question).

This commit exapnds the definition of 'more strict' to take into account
inference variables. We always choose a predicate without inference
variables over a predicate with inference variables.
2018-10-28 15:33:27 -04:00
bors
3e6f30ec3e Auto merge of #55382 - kennytm:rollup, r=kennytm
Rollup of 21 pull requests

Successful merges:

 - #54816 (Don't try to promote already promoted out temporaries)
 - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`)
 - #54921 (Add line numbers option to rustdoc)
 - #55167 (Add a "cheap" mode for `compute_missing_ctors`.)
 - #55258 (Fix Rustdoc ICE when checking blanket impls)
 - #55264 (Compile the libstd we distribute with -Ccodegen-unit=1)
 - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators)
 - #55292 (Macro diagnostics tweaks)
 - #55298 (Point at macro definition when no rules expect token)
 - #55301 (List allowed tokens after macro fragments)
 - #55302 (Extend the impl_stable_hash_for! macro for miri.)
 - #55325 (Fix link to macros chapter)
 - #55343 (rustbuild: fix remap-debuginfo when building a release)
 - #55346 (Shrink `Statement`.)
 - #55358 (Remove redundant clone (2))
 - #55370 (Update mailmap for estebank)
 - #55375 (Typo fixes in configure_cmake comments)
 - #55378 (rustbuild: use configured linker to build boostrap)
 - #55379 (validity: assert that unions are non-empty)
 - #55383 (Use `SmallVec` for the queue in `coerce_unsized`.)
 - #55391 (bootstrap: clean up a few clippy findings)
2018-10-26 17:26:56 +00:00
bors
694cf75298 Auto merge of #53821 - oli-obk:sanity_query, r=RalfJung
Report const eval error inside the query

Functional changes: We no longer warn about bad constants embedded in unused types. This relied on being able to report just a warning, not a hard error on that case, which we cannot do any more now that error reporting is consistently centralized.

r? @RalfJung

fixes #53561
2018-10-26 11:05:00 +00:00
kennytm
46f504543d
Rollup merge of #55258 - Aaron1011:fix/rustdoc-blanket, r=GuillaumeGomez
Fix Rustdoc ICE when checking blanket impls

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-26 18:24:59 +08:00
kennytm
a57ce63a91
Rollup merge of #54824 - Munksgaard:fix-49713, r=QuietMisdreavus
Cleanup rustdoc tests with `@!has` and `@!matches`

Fixes #49713

Here's a _long_ list of all the places that include `@!has`. I have marked the ones I have looked at so far.

 - [x] search-index.rs:        fn priv_method() {} // @!has - priv_method
 - [x] search-index.rs:        fn trait_method(&self) {} // @!has - priv_method
 - [x] search-index.rs:    // @!has search-index.js Target
 - [x] short-dockblock.rs:// @!has foo/index.html '//*[@class="docblock-short"]/p/h1' 'fooo'
 - [x] short-dockblock.rs:// @!has foo/index.html '//*[@class="docblock-short"]/p/h2' 'mooood'
 - [x] keyword.rs:// @!has foo/index.html '//a/@href' 'foo/index.html'
 - [x] keyword.rs:// @!has foo/foo/index.html
 - [x] keyword.rs:// @!has-dir foo/foo
 - [x] issue-46380-2.rs:// @!has - '//*[@class="impl"]' 'impl PublicTrait<PrivateStruct> for PublicStruct'
 - [x] escape-rust-expr.rs:// @!has escape_rust_expr/constant.CONST_S.html '//pre[@class="rust const"]' '"<script>"'
 - [x] issue-33069.rs:// @!has - '//code' 'impl Bar for Foo'
 - [x] playground-empty.rs:// @!has foo/index.html '//a[@class="test-arrow"]' "Run"
 - [x] issue-34473.rs:// @!has - SomeTypeWithLongName
 - [x] issue-34473.rs:// @!has - SomeTypeWithLongName
 - [x] issue-34473.rs:// @!has foo/struct.SomeTypeWithLongName.html
 - [x] issue-29584.rs:// @!has - 'impl Bar for'
 - [x] hidden-line.rs:// @!has hidden_line/fn.foo.html invisible
 - [x] manual_impl.rs:// @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
 - [x] manual_impl.rs:// @!has - '//*[@class="docblock"]' 'There is another line'
 - [x] manual_impl.rs:// @!has - '//*[@class="docblock"]' 'Docs associated with the trait a_method definition.'
 - [x] manual_impl.rs:// @!has - '//*[@class="docblock"]' 'Docs associated with the trait c_method definition.'
 - [x] issue-19190-2.rs:// @!has - '//*[@id="method.new"]' 'fn new() -> String'
 - [x] unneeded-trait-implementations-title.rs:// @!has foo/struct.Bar.html '//*[@id="implementations"]'
 - [x] masked.rs:// @!has 'search-index.js' 'masked_method'
 - [x] masked.rs:// @!has 'foo/struct.String.html' 'MaskedTrait'
 - [x] masked.rs:// @!has 'foo/struct.String.html' 'masked_method'
 - [x] masked.rs:// @!has 'foo/trait.Clone.html' 'MaskedStruct'
 - [x] masked.rs:// @!has 'foo/struct.MyStruct.html' 'MaskedTrait'
 - [x] masked.rs:// @!has 'foo/struct.MyStruct.html' 'masked_method'
 - [x] masked.rs:// @!has 'foo/trait.MyTrait.html' 'MaskedStruct'
 - [x] redirect.rs:// @!has - '//code/a' 'Qux'
 - [x] issue-43701.rs:// @!has implementors/core/clone/trait.Clone.js
 - [x] union.rs:    // @!has - //pre "b: u16"
 - [x] prim-title.rs:// @!has - '//head/title' 'foo'
 - [x] empty-section.rs:// @!has - '//*[@class="synthetic-implementations"]' 'Auto Trait Implementations'
 - [x] traits-in-bodies-private.rs:// @!has - '//code' 'impl HiddenTrait for SomeStruct'
 - [x] playground-none.rs:// @!has foo/index.html '//a[@class="test-arrow"]' "Run"
 - [x] issue-34025.rs:// @!has 'foo/sys/index.html'
 - [x] issue-34025.rs:// @!has 'foo/sys/sidebar-items.js'
 - [x] issue-34025.rs:        // @!has 'foo/sys/fn.foo.html'
 - [x] issue-23812.rs:// @!has - '/// Outer comment'
 - [x] issue-23812.rs:// @!has - '//! Inner comment'
 - [x] issue-23812.rs:// @!has - '/** Outer block comment */'
 - [x] issue-23812.rs:// @!has - '/*! Inner block comment */'
 - [x] pub-use-extern-macros.rs:// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::bar;'
 - [x] pub-use-extern-macros.rs:// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::baz;'
 - [x] pub-use-extern-macros.rs:// @!has pub_use_extern_macros/macro.quux.html
 - [x] pub-use-extern-macros.rs:// @!has pub_use_extern_macros/index.html '//code' 'pub use macros::quux;'
 - [x] issue-26606.rs:// @!has - '//a/@href' '../src/'
 - [x] foreigntype-reexport.rs:// @!has foreigntype_reexport/foreigntype.X4.html
 - [x] foreigntype-reexport.rs:// @!has foreigntype_reexport/index.html '//a[@class="foreigntype"]' 'X4'
 - [x] issue-31899.rs:// @!has - 'rust rust-example-rendered'
 - [x] issue-31899.rs:// @!has - 'use ndarray::arr2'
 - [x] issue-31899.rs:// @!has - 'prohibited'
 - [x] hidden-trait-struct-impls.rs:// @!has foo/struct.Bar.html '//*[@id="impl-Foo"]' 'impl Foo for Bar'
 - [x] hidden-trait-struct-impls.rs:// @!has foo/struct.Bar.html '//*[@id="impl-Dark"]' 'impl Dark for Bar'
 - [x] hidden-trait-struct-impls.rs:// @!has foo/trait.Bam.html '//*[@id="implementors-list"]' 'impl Bam for Hidden'
 - [x] hidden-impls.rs:// @!has - 'Foo'
 - [x] hidden-impls.rs:// @!has - 'Foo'
 - [x] module-impls.rs:// @!has foo/index.html 'Implementations'
 - [x] issue-35169.rs:// @!has - '//*[@id="by_mut_ref.v"]' 'fn by_mut_ref(&mut self)'
 - [x] issue-35169.rs:// @!has - '//*[@id="method.by_mut_ref"]' 'fn by_mut_ref(&mut self)'
 - [x] issue-35169.rs:// @!has - '//*[@id="by_explicit_mut_ref.v"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
 - [x] issue-35169.rs:// @!has - '//*[@id="method.by_explicit_mut_ref"]' 'fn by_explicit_mut_ref(self: &mut Foo)'
 - [x] issue-35169.rs:// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
 - [x] issue-35169.rs:// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
 - [x] issue-35169.rs:// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
 - [x] issue-35169.rs:// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
 - [x] issue-35169.rs:// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
 - [x] issue-35169.rs:// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
 - [x] extern-links.rs:// @!has foo/index.html '//a' 'extern_links'
 - [x] extern-links.rs:// @!has foo/index.html '//a' 'Foo'
 - [x] extern-links.rs:    // @!has foo/hidden/extern_links/index.html
 - [x] extern-links.rs:    // @!has foo/hidden/extern_links/struct.Foo.html
 - [x] issue-33178-1.rs:// @!has - //a/@title empty
 - [x] issue-33178-1.rs:// @!has - //a/@title variant_struct
 - [x] issue-47038.rs:// @!has - '//*[@id="macros"]' 'Macros'
 - [x] issue-47038.rs:// @!has - '//a/@href' 'macro.vec.html'
 - [x] issue-47038.rs:// @!has 'foo/macro.vec.html'
 - [x] issue-46766.rs:// @!has foo/index.html '//a/@href' './Enum/index.html'
 - [x] issue-32395.rs:// @!has - 'pub qux'
 - [x] issue-32395.rs:// @!has - 'pub Bar'
 - [x] issue-32395.rs:// @!has - 'pub qux'
 - [x] issue-32395.rs:// @!has - 'pub Bar'
 - [x] hidden-methods.rs:// @!has - 'Methods'
 - [x] hidden-methods.rs:// @!has - 'impl Foo'
 - [x] hidden-methods.rs:// @!has - 'this_should_be_hidden'
 - [x] hidden-methods.rs:// @!has - 'Methods'
 - [x] hidden-methods.rs:// @!has - 'impl Bar'
 - [x] hidden-methods.rs:// @!has - 'this_should_be_hidden'
 - [x] structfields.rs:    // @!has - //pre "b: ()"
 - [x] structfields.rs:    // @!has - //pre "c: usize"
 - [x] structfields.rs:    // @!has - //pre "// some fields omitted"
 - [x] structfields.rs:        // @!has - //pre "b: ()"
 - [x] issue-46767.rs:// @!has foo/index.html '//a/@href' './private/index.html'
 - [x] assoc-consts.rs:    // @!has - FOO_HIDDEN
 - [x] assoc-consts.rs:    // @!has - FOO_HIDDEN
 - [x] assoc-consts.rs:    // @!has assoc_consts/struct.Bar.html 'BAR_PRIVATE'
 - [x] assoc-consts.rs:    // @!has assoc_consts/struct.Bar.html 'BAR_HIDDEN'
 - [x] issue-53689.rs:// @!has - 'MyStruct'
 - [x] search-index-summaries.rs:// @!has - 'www.example.com'
 - [x] search-index-summaries.rs:// @!has - 'More Foo.'
 - [x] impl-everywhere.rs:// @!has foo/fn.foo.html '//section[@id="main"]//pre' "x: &\'x impl Foo"
 - [x] impl-everywhere.rs:// @!has foo/fn.foo.html '//section[@id="main"]//pre' "-> &\'x impl Foo {"
 - [x] impl-everywhere.rs:// @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &\'x impl Foo"
 - [x] impl-everywhere.rs:// @!has foo/fn.foo2.html '//section[@id="main"]//pre' '-> impl Foo2 {'
 - [x] impl-everywhere.rs:// @!has foo/fn.foo_foo.html '//section[@id="main"]//pre' '-> impl Foo + Foo2 {'
 - [x] impl-everywhere.rs:// @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &'x (impl Foo + Foo2)"
 - [x] issue-19190.rs:// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
 - [x] issue-19190.rs:// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
 - [x] deprecated-impls.rs:    // @!has - 'fn_def_def_with_doc full'
 - [x] deprecated-impls.rs:    // @!has - 'fn_empty_with_doc full'
 - [x] deprecated-impls.rs:    // @!has - 'fn_def_with full'
 - [x] deprecated-impls.rs:    // @!has - 'fn_def_def_with_doc full'
 - [x] issue-19190-3.rs:// @!has - '//*[@id="method.new"]' 'fn new() -> String'
 - [x] issue-19190-3.rs:// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()'
 - [x] issue-19190-3.rs:// @!has - '//*[@id="method.static_baz"]' 'fn static_baz()'
 - [x] sidebar-items.rs:// @!has - '//*[@class="sidebar-links"]/a' 'waza'
 - [x] sidebar-items.rs:// @!has - '//*[@class="sidebar-links"]/a' 'waza'
 - [x] issue-27104.rs:// @!has - 'extern crate std'
 - [x] issue-27104.rs:// @!has - 'use std::prelude::'
 - [x] issue-13698.rs:// @!has issue_13698/struct.Foo.html '//*[@id="method.foo"]' 'fn foo'
 - [x] issue-13698.rs:// @!has issue_13698/struct.Foo.html '//*[@id="method.foo"]' 'fn bar'
 - [x] issue-41783.rs:// @!has - 'space'
 - [x] issue-41783.rs:// @!has - 'comment'
 - [x] trait-self-link.rs:// @!has trait_self_link/trait.Foo.html //a/@href ../trait_self_link/trait.Foo.html
 - [x] generic-impl.rs:// @!has foo/struct.Bar.html '//h3[@id="impl-ToString"]//code' 'impl<T> ToString for T'
 - [x] all.rs:// @!has foo/all.html 'private_module'
 - [x] issue-35169-2.rs:// @!has - '//*[@id="by_explicit_box.v"]' 'fn by_explicit_box(self: Box<Foo>)'
 - [x] issue-35169-2.rs:// @!has - '//*[@id="method.by_explicit_box"]' 'fn by_explicit_box(self: Box<Foo>)'
 - [x] issue-35169-2.rs:// @!has - '//*[@id="by_explicit_self_box.v"]' 'fn by_explicit_self_box(self: Box<Self>)'
 - [x] issue-35169-2.rs:// @!has - '//*[@id="method.by_explicit_self_box"]' 'fn by_explicit_self_box(self: Box<Self>)'
 - [x] issue-35169-2.rs:// @!has - '//*[@id="static_foo.v"]' 'fn static_foo()'
 - [x] issue-35169-2.rs:// @!has - '//*[@id="method.static_foo"]' 'fn static_foo()'
 - [x] doc-cfg.rs:// @!has - '//*[@id="main"]/*[@class="stability"]/*[@class="stab portability"]' ''
 - [x] inline_local/glob-private.rs:// @!has - "mod1"
 - [x] inline_local/glob-private.rs:// @!has - "Mod1Private"
 - [x] inline_local/glob-private.rs:// @!has - "mod2"
 - [x] inline_local/glob-private.rs:// @!has - "Mod2Private"
 - [x] inline_local/glob-private.rs:// @!has foo/struct.Mod1Private.html
 - [x] inline_local/glob-private.rs:// @!has foo/struct.Mod2Private.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod1/index.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod1/struct.Mod1Private.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod1/struct.Mod2Public.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod1/struct.Mod2Private.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod1/mod2/index.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod1/mod2/struct.Mod2Private.html
 - [x] inline_local/glob-private.rs:// @!has-dir foo/mod2
 - [x] inline_local/glob-private.rs:// @!has foo/mod2/index.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod2/struct.Mod2Public.html
 - [x] inline_local/glob-private.rs:// @!has foo/mod2/struct.Mod2Private.html
 - [x] inline_local/hidden-use.rs:// @!has - 'private'
 - [x] inline_local/hidden-use.rs:// @!has - 'Foo'
 - [x] inline_local/hidden-use.rs:// @!has hidden_use/struct.Foo.html
 - [x] inline_local/glob-extern-no-defaults.rs:// @!has - "private_fn"
 - [x] inline_local/glob-extern-no-defaults.rs:// @!has foo/fn.private_fn.html
 - [x] inline_local/issue-32343.rs:// @!has issue_32343/struct.Foo.html
 - [x] inline_local/issue-32343.rs:// @!has - '//code/a' 'Foo'
 - [x] inline_local/issue-32343.rs:// @!has issue_32343/struct.Bar.html
 - [x] inline_local/glob-private-no-defaults.rs:// @!has - "Mod1Private"
 - [x] inline_local/glob-private-no-defaults.rs:// @!has - "mod2"
 - [x] inline_local/glob-private-no-defaults.rs:// @!has - "Mod2Private"
 - [x] inline_local/glob-private-no-defaults.rs:// @!has foo/struct.Mod1Private.html
 - [x] inline_local/glob-private-no-defaults.rs:// @!has foo/struct.Mod2Private.html
 - [x] inline_local/glob-private-no-defaults.rs:// @!has - "Mod2Public"
 - [x] inline_local/glob-private-no-defaults.rs:// @!has - "Mod2Private"
 - [x] inline_local/glob-private-no-defaults.rs:// @!has foo/mod1/struct.Mod2Public.html
 - [x] inline_local/glob-private-no-defaults.rs:// @!has foo/mod1/struct.Mod2Private.html
 - [x] inline_local/glob-private-no-defaults.rs:// @!has foo/mod2/index.html
 - [x] inline_local/glob-private-no-defaults.rs:// @!has foo/mod2/struct.Mod2Public.html
 - [x] inline_local/glob-private-no-defaults.rs:// @!has foo/mod2/struct.Mod2Private.html
 - [x] inline_local/glob-extern.rs:// @!has - "mod1"
 - [x] inline_local/glob-extern.rs:// @!has - "private_fn"
 - [x] inline_local/glob-extern.rs:// @!has foo/fn.private_fn.html
 - [x] inline_local/glob-extern.rs:// @!has foo/mod1/index.html
 - [x] inline_local/glob-extern.rs:// @!has foo/mod1/fn.private_fn.html
 - [x] inline_local/please_inline.rs:    // @!has - 'pub use foo::'
 - [x] inline_local/please_inline.rs:    // @!has please_inline/b/struct.Foo.html
 - [x] inline_cross/hidden-use.rs:// @!has - 'rustdoc_hidden'
 - [x] inline_cross/hidden-use.rs:// @!has - 'Bar'
 - [x] inline_cross/hidden-use.rs:// @!has hidden_use/struct.Bar.html
 - [x] inline_cross/inline_hidden.rs:// @!has - '//a/@title' 'Foo'
 - [x] inline_cross/assoc-items.rs:// @!has - 'PrivateConst'
 - [x] inline_cross/assoc-items.rs:// @!has - 'private_method'
 - [x] inline_cross/cross-glob.rs:// @!has cross_glob/index.html '//code' 'pub use inner::*;'
 - [x] inline_cross/macro-vis.rs:// @!has - '//pre' 'some_macro'
 - [x] inline_cross/macro-vis.rs:// @!has macro_vis/macro.other_macro.html
 - [x] inline_cross/macro-vis.rs:// @!has macro_vis/index.html '//a/@href' 'macro.other_macro.html'
 - [x] inline_cross/macro-vis.rs:// @!has - '//code' 'pub use qwop::other_macro;'
 - [x] inline_cross/macro-vis.rs:// @!has macro_vis/macro.super_macro.html
 - [x] inline_cross/issue-31948.rs:// @!has - '//*[@class="impl"]//code' 'Bar for'
 - [x] inline_cross/issue-31948.rs:// @!has - '//*[@class="impl"]//code' 'Qux for'
 - [x] inline_cross/issue-31948.rs:// @!has - '//code' 'for Wibble'
 - [x] inline_cross/issue-31948.rs:// @!has - '//code' 'for Wobble'
 - [x] inline_cross/issue-31948.rs:// @!has - '//code' 'for Wibble'
 - [x] inline_cross/issue-31948.rs:// @!has - '//code' 'for Wobble'
 - [x] inline_cross/issue-31948.rs:// @!has issue_31948/trait.Bar.html
 - [x] inline_cross/issue-31948.rs:// @!has issue_31948/trait.Qux.html
 - [x] inline_cross/issue-31948.rs:// @!has issue_31948/struct.Wibble.html
 - [x] inline_cross/issue-31948.rs:// @!has issue_31948/struct.Wobble.html
 - [x] inline_cross/issue-31948-1.rs:// @!has - '//*[@class="impl"]//code' 'Bar for'
 - [x] inline_cross/issue-31948-1.rs:// @!has - '//*[@class="impl"]//code' 'Qux for'
 - [x] inline_cross/issue-31948-1.rs:// @!has - '//code' 'for Wibble'
 - [x] inline_cross/issue-31948-1.rs:// @!has - '//code' 'for Wibble'
 - [x] inline_cross/issue-31948-1.rs:// @!has issue_31948_1/trait.Bar.html
 - [x] inline_cross/issue-31948-1.rs:// @!has issue_31948_1/trait.Qux.html
 - [x] inline_cross/issue-28480.rs:// @!has -  '//a/@title' 'Hidden'
 - [x] inline_cross/issue-28480.rs:// @!has -  '//a/@title' 'Hidden'
 - [x] inline_cross/issue-31948-2.rs:// @!has - '//*[@class="impl"]//code' 'Bar for'
 - [x] inline_cross/issue-31948-2.rs:// @!has issue_31948_2/trait.Bar.html
 - [x] inline_cross/issue-31948-2.rs:// @!has issue_31948_2/trait.Woof.html
 - [x] inline_cross/issue-31948-2.rs:// @!has issue_31948_2/trait.Bark.html

It doesn't look like `@!matches` is used anywhere.
2018-10-26 18:24:55 +08:00
Aaron Hill
098c659276
Check for negative impls when finding auto traits
Fixes #55321

When AutoTraitFinder begins examining a type, it checks for an explicit
negative impl. However, it wasn't checking for negative impls found when
calling 'select' on predicates found from nested obligations.

This commit makes AutoTraitFinder check for negative impls whenever it
makes a call to 'select'. If a negative impl is found, it immediately
bails out.

Normal users of SelectioContext don't need to worry about this, since
they stop as soon as an Unimplemented error is encountered. However, we
add predicates to our ParamEnv when we encounter this error, so we need
to handle negative impls specially (so that we don't try adding them to
our ParamEnv).
2018-10-25 15:14:32 -04:00
Ralf Jung
7717a63182 fix a test comment 2018-10-25 16:47:35 +02:00
Alexander Regueiro
7c34f2da57 Addressed minor issues brought up in review. 2018-10-25 16:47:35 +02:00
Oliver Schneider
f4a3e50d78 Update rustdoc test 2018-10-25 16:47:35 +02:00
Felix S. Klock II
be2075c661 This is a regression test for #54478.
I confirmed that it fails on:
rustdoc 1.30.0-beta.12 (96a229824 2018-10-04)
and passes on:
rustdoc 1.31.0-nightly (f99911a4a 2018-10-23)
2018-10-24 12:19:47 +02:00
Aaron Hill
4f2624cac9
Fix Rustdoc ICE when checking blanket impls
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-22 19:40:43 -04:00
Guillaume Gomez
b2f80ddf34 Fix multiple errors 2018-10-22 00:43:23 +02:00
Guillaume Gomez
f729f4a75e Update failing test 2018-10-21 19:22:37 +02:00
Oliver Middleton
86d5a33c89 rustdoc: Use dyn keyword when rendering dynamic traits
The dyn keyword has been stable for a while now so rustdoc should start using it.
2018-10-15 00:48:57 +01:00
kennytm
d64c77a671
Rollup merge of #54989 - Munksgaard:fix-htmldocck-typos, r=tmandry
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-12 22:04:19 +08:00
Philip Munksgaard
1de8f51849 Include rustdoc tests that have been fixed by #33133
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-11 18:25:55 +02:00
Philip Munksgaard
a9217e316c Fix typo in issue-13698.rs 2018-10-10 22:30:15 +02:00
Philip Munksgaard
df79da9661 Fix typo in deprecated_impls
The function is called `fn_def_with_doc`, not `fn_def_with`.
2018-10-10 22:01:05 +02:00
Philip Munksgaard
9dbe902800 Fix issue-46767 test
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-10 21:20:00 +02:00
Philip Munksgaard
e8bc04e1c8 Use XPATH notation to match against flattened nodes
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-10 21:04:52 +02:00
Philip Munksgaard
28596ade71 Fix empty-section.rs test
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-05 23:28:08 +02:00
Philip Munksgaard
a9a26de8b3 Fix redirect.rs test
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-05 22:55:13 +02:00
Philip Munksgaard
5f8dc0ddf4 Fix unneeded-trait-implementations-title test
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-05 19:13:37 +02:00
Philip Munksgaard
46ccce0803 Remove duplicate test line 2018-10-05 18:24:25 +02:00
Oliver Schneider
ec74d3533a Stabilize min_const_fn 2018-10-05 10:36:14 +02:00
Philip Munksgaard
f97e094b19 Add compile flags to playground-empty test
"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-04 22:23:19 +02:00
Philip Munksgaard
7d3d835c58 replace escape-rust-expr test with dont-show-const-contents
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-10-04 22:22:19 +02:00
kennytm
def5f84fa6
Rollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomez
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-29 16:46:30 +08:00
QuietMisdreavus
d37f3696b1 check for proc-macros in "all items" 2018-09-27 10:22:29 -05:00
bors
e783d2be40 Auto merge of #54199 - nikomatsakis:predicate_may_hold-failure, r=eddyb
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-26 12:39:20 +00:00
QuietMisdreavus
8f69a82513 add test for proc-macro re-export 2018-09-25 16:30:19 -05:00
QuietMisdreavus
aea1bd0a59 handle proc-macros as macros instead of functions 2018-09-25 14:56:43 -05:00
Niko Matsakis
a3997f7255 add regression test 2018-09-25 13:54:51 -04:00
Pietro Albini
23636e3f99
Rollup merge of #54350 - Munksgaard:support-edition-in-doc-test, r=steveklabnik
Support specifying edition in doc test

Fixes #52623

r? @QuietMisdreavus
2018-09-22 09:56:30 +02:00
QuietMisdreavus
1106577116 fix intra-links for trait impls 2018-09-20 05:54:31 -05:00
QuietMisdreavus
e854d39929 don't index trait impls if the trait isn't also documented 2018-09-20 05:42:36 -05:00
QuietMisdreavus
7e70fee0c7 add more tests for traits-in-non-module-scope 2018-09-20 05:42:35 -05:00
QuietMisdreavus
e79780f18f don't check visibility when inlining local impls
those get handled properly in strip-hidden anyway
2018-09-20 05:42:33 -05:00
QuietMisdreavus
457efc111a ignore rustdoc/doc-proc-macro on stage1 2018-09-20 05:42:22 -05:00
QuietMisdreavus
02bea3c581 rustdoc: collect trait impls as an early pass 2018-09-20 05:42:20 -05:00
Philip Munksgaard
ac8d8d71fa Add test for doctest edition support 2018-09-20 08:36:07 +02:00
Guillaume Gomez
6aed133ebd
Rollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, r=QuietMisdreavus
rustdoc: Remove namespace for keywords

Fixes #54084.

r? @QuietMisdreavus
2018-09-18 10:21:35 +02:00
Kazuyoshi Kato
2fe4503703 Check the remaining nodes 2018-09-16 00:39:12 -07:00
Kazuyoshi Kato
bbcb6339aa Add a test to prevent regression
The way it defines implementations is unrealistic though.
2018-09-14 22:42:44 -07:00
bors
f2302daef3 Auto merge of #53409 - GuillaumeGomez:associated-const-value, r=QuietMisdreavus
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-12 21:20:05 +00:00
Guillaume Gomez
1a0e8f95f5 Remove namespace for keywords 2018-09-10 11:27:21 +02:00
Oliver Middleton
d3e56854e1 rustdoc: Remove generated blanket impls from trait pages 2018-09-09 18:27:05 +01:00
Guillaume Gomez
d65c8636d9 Fix hover on impls 2018-09-06 23:32:30 +02:00
bors
fea32f1b77 Auto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkor
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-09-01 11:26:24 +00:00
bors
aaa170bebe Auto merge of #51384 - QuietMisdreavus:extern-version, r=GuillaumeGomez
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-31 17:39:28 +00:00
Oliver Schneider
d125e904b5 Restrict most uses of const_fn to min_const_fn 2018-08-31 08:40:00 +02:00
Corey Farwell
e477a13d63 Replace usages of 'bad_style' with 'nonstandard_style'.
`bad_style` is being deprecated in favor of `nonstandard_style`:

- https://github.com/rust-lang/rust/issues/41646
2018-08-29 09:01:35 -05:00
Guillaume Gomez
86141797db Remove static and const initialization from documentation 2018-08-26 12:08:30 +02:00
Guillaume Gomez
b0ee5ded7a Update tests 2018-08-25 15:30:47 +02:00
Guillaume Gomez
3d8e760bf8
Rollup merge of #53541 - GuillaumeGomez:fix-impl-trait-ret-type, r=oli-obk
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-22 17:45:36 +02:00
bors
1cbf339626 Auto merge of #53439 - GuillaumeGomez:generate-blanket-impls-for-reexported-items, r=QuietMisdreavus
Generate blanket implementations for reexported items as well

Fixes #53374.

r? @QuietMisdreavus
2018-08-21 22:48:21 +00:00
Guillaume Gomez
e67bba8ebe Fix missing impl trait display as ret type 2018-08-21 22:40:55 +02:00
Matthias Krüger
71120ef1e5 Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
bors
c8c587fe4e Auto merge of #50911 - petrochenkov:macuse, r=alexcrichton
Stabilize `use_extern_macros`

Closes https://github.com/rust-lang/rust/issues/35896
2018-08-17 19:10:34 +00:00
Vadim Petrochenkov
a0958048b6 Stabilize use_extern_macros 2018-08-17 13:14:26 +03:00
Guillaume Gomez
985da801b0 Generate blanket implementations for reexported items as well 2018-08-16 15:14:11 +02:00
Eduard-Mihai Burtescu
2c4402638e syntax: also warn about edition "umbrella" features being implied by --edition. 2018-08-16 10:35:45 +03:00
QuietMisdreavus
0511b01506 set the syntax edition in the driver's phase 1 2018-08-09 11:46:39 -05:00
bors
b239743753 Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
Add errors for unknown, stable and duplicate feature attributes

- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.

```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`

#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0

#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```

Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).

There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.
2018-08-06 16:58:27 +00:00
bors
4b8089daf8 Auto merge of #52990 - Aaron1011:fix/rustdoc-auto-trait-static, r=eddyb
Fix ICE when rustdoc encounters certain usages of HRTBs

Fixes #51236

Under certain circumstances, `AutoTraitFinder` could end up computing a `ParamEnv` involving two trait predicates that differed only in the region parameters involved. One of these parameters would be a HRTB, while the other would be a normal region parameter.

When this `ParamEnv` was later passed to `SelectionContext`, an `Ambiguity` error would occur, since the erased versions of these predicates would be identical. To solve the issue, we de-duplicate our list of predicates as we build it up. Whenever we encounter two predicates that differ only in their assignment of region parameters (a HRTB vs a normal lifetime parameter), we pick the HRTB. This corresponds to selecting a 'stricter' bound to display in the generated documentation: we're requiring that a particular type works for all possible lifetime parameters if it's going to implement a particular auto trait.
2018-08-06 14:07:22 +00:00
bors
aa1e6db709 Auto merge of #53002 - QuietMisdreavus:brother-may-i-have-some-loops, r=pnkfelix
make `everybody_loops` preserve item declarations

First half of https://github.com/rust-lang/rust/issues/52545.

`everybody_loops` is used by rustdoc to ensure we don't contain erroneous references to platform APIs if one of its uses is pulled in by `#[doc(cfg)]`. However, you can also implement traits for public types inside of functions. This is used by Diesel (probably others, but they were the example that was reported) to get around a recent macro hygiene fix, which has caused their crate to fail to document. While this won't make the traits show up in documentation (that step comes later), it will at least allow files to be generated.
2018-08-06 01:53:58 +00:00
varkor
8cee487eb3 Fix rustdoc test 2018-08-05 15:54:49 +01:00
varkor
f22ccbe315 Fix run-pass-fulldeps tests 2018-08-05 15:54:49 +01:00
QuietMisdreavus
001445b235 add tests for new intra-doc-link behavior 2018-08-04 22:20:45 -05:00
Guillaume Gomez
e0f8f871f6 Strengthen tests 2018-08-04 11:02:00 +02:00
Guillaume Gomez
8301081c90 Fix primitive blanket impls not showing up 2018-08-04 11:02:00 +02:00
QuietMisdreavus
d6a7a3cab0 add rustdoc test for everybody_loops fix 2018-08-02 15:42:02 -05:00
Aaron Hill
a0943b6bba
Filter out duplicated trait predicates when generating auto traits
Fixes #51236
2018-08-02 13:59:16 -04:00
Aaron Hill
bff08f2731
Fix rustdoc crash when 'static bound appears in struct declaration 2018-08-02 09:58:44 -04:00
Guillaume Gomez
7a3c7b2097 Don't display full blanket implementation and put it into its own section 2018-07-28 15:18:38 +02:00
Guillaume Gomez
d64c2ac01a Improve code 2018-07-22 21:03:21 +02:00
Guillaume Gomez
6b830ec23e Add new tests and fix old ones 2018-07-22 21:02:44 +02:00
bors
d3b3bc5767 Auto merge of #52368 - GuillaumeGomez:intra_doc_link_resolution_failure-documented, r=QuietMisdreavus
Add "self" intra-link support

Fixes #49583.

r? @QuietMisdreavus
2018-07-22 10:48:15 +00:00
Guillaume Gomez
88f2643679 Add "self" intra-link support 2018-07-22 00:22:30 +02:00
kennytm
c0db1aafea
Rollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, r=QuietMisdreavus
Pass edition flags to compiler from rustdoc as expected

Fixes #52357.
2018-07-17 19:24:57 +08:00
Guillaume Gomez
65e6b2b4a8 Pass edition flags to compiler from rustdoc as expected 2018-07-14 20:45:44 +02:00
QuietMisdreavus
e78fb9bad0 add test for issue 52129 2018-07-13 21:46:47 -05:00
Oliver Middleton
6b1d584ed8 rustdoc: Hide struct and enum variant constructor imports 2018-07-10 00:16:18 +01:00
bors
a8403e1cda Auto merge of #51861 - GuillaumeGomez:prevent-some-markdown-short-doc, r=QuietMisdreavus
Prevent some markdown transformation on short docblocks

Before:

<img width="1440" alt="screen shot 2018-06-28 at 01 46 01" src="https://user-images.githubusercontent.com/3050060/42005762-7d533bbe-7a76-11e8-8361-027886803399.png">

After:

<img width="1440" alt="screen shot 2018-06-28 at 01 46 02" src="https://user-images.githubusercontent.com/3050060/42005768-81bd59a0-7a76-11e8-819b-9b4be72579d6.png">

This is only performed on short doc blocks, not on plain ones. Not all transformations are prevented (you still have a few like urls, code blocks, etc...).

cc @nical

r? @QuietMisdreavus
2018-07-06 00:36:34 +00:00
QuietMisdreavus
61dc03cd63 test for renaming re-exported macros 2018-07-03 10:40:11 -05:00
Guillaume Gomez
6a86ee7328 Prevent some markdown transformation on short docblocks 2018-06-28 01:55:43 +02:00
QuietMisdreavus
5e509502b4 fix test pub-use-extern-macros 2018-06-17 20:14:24 -05:00
QuietMisdreavus
54997972a7 fix cross-crate-links test
hey look, macros properly link to the right place now
2018-06-17 16:27:46 -05:00
QuietMisdreavus
d4387b3e4f rustdoc: import cross-crate macros alongside everything else 2018-06-17 14:59:49 -05:00
bors
594b05dd97 Auto merge of #51425 - QuietMisdreavus:thats-def-a-namespace-there, r=petrochenkov
refactor: create multiple HIR items for imports

When lowering `use` statements into HIR, they get a `Def` of the thing they're pointing at. This is great for things that need to know what was just pulled into scope. However, this is a bit misleading, because a `use` statement can pull things from multiple namespaces if their names collide. This is a problem for rustdoc, because if there are a module and a function with the same name (for example) then it will only document the module import, because that's that the lowered `use` statement points to.

The current version of this PR does the following:

* Whenever the resolver comes across a `use` statement, it loads the definitions into a new `import_map` instead of the existing `def_map`. This keeps the resolutions per-namespace so that all the target definitions are available.
* When lowering `use` statements, it looks up the resolutions in the `import_map` and creates multiple `Item`s if there is more than one resolution.
* To ensure the `NodeId`s are properly tracked in the lowered module, they need to be created in the AST, and pulled out as needed if multiple resolutions are available.

Fixes https://github.com/rust-lang/rust/issues/34843
2018-06-17 09:48:10 +00:00
bors
0f8f4903f7 Auto merge of #51382 - GuillaumeGomez:intra-link-lint, r=QuietMisdreavus
Add lint for intra link resolution failure

This PR is almost done, just remains this note:

```
note: requested on the command line with `-W intra-link-resolution-failure`
```

I have no idea why my lint is considered as being passed through command line and wasn't able to find where it was set. If anyone has an idea, it'd be very helpful!

cc @QuietMisdreavus
2018-06-17 02:57:40 +00:00
QuietMisdreavus
042f1df198 process cross-crate glob re-exports 2018-06-15 18:18:14 -05:00
QuietMisdreavus
02121f36e8 add test for issue 34843 2018-06-14 17:47:35 -05:00
Guillaume Gomez
6d5e6b4928 Fix rustdoc test failure 2018-06-13 21:18:56 +02:00
QuietMisdreavus
fcb54f674a add test for --extern-html-root-url 2018-06-12 16:38:30 -05:00
Oliver Middleton
e73941a06b rustdoc: Fix missing stability and src links for inlined external macros 2018-06-06 04:13:55 +01:00
Mark Simulacrum
ac32f8151b
Rollup merge of #51256 - GuillaumeGomez:fix-rustdoc-crate-name, r=QuietMisdreavus
Fix crate-name option in rustdoc

Fixes #51229.

r? @QuietMisdreavus
2018-06-05 08:33:47 -06:00
Guillaume Gomez
3cbcc5a22d Fix crate-name option in rustdoc 2018-06-04 23:05:14 +02:00
Guillaume Gomez
402aa0ff15 Add even more tests 2018-06-04 09:52:31 +02:00
Guillaume Gomez
ded5c5a9ee Put doc keyword behind feature flag 2018-06-04 09:52:31 +02:00
Guillaume Gomez
ebee483e24 Add doc keyword support 2018-06-04 09:51:41 +02:00
bors
251ec62a13 Auto merge of #50953 - GuillaumeGomez:attributes-in-other-places, r=QuietMisdreavus
Add attributes for trait and methods as well

Fixes #48485.

r? @QuietMisdreavus
2018-06-03 00:31:13 +00:00
Guillaume Gomez
26ad95c9d4 Add attributes for trait and methods as well 2018-06-02 23:26:46 +02:00
Mark Simulacrum
cf24a1df33 Rustdoc itself no longer requires proc macros to build
This avoids a full compiler build in order to build and/or run tests for
rustdoc.
2018-06-02 09:32:22 -06:00
kennytm
98606cfe12
Rollup merge of #51011 - QuietMisdreavus:duplicitous-macros, r=ollie27
rustdoc: hide macro export statements from docs

As mentioned in https://github.com/rust-lang/rust/issues/50647, rustdoc now prints both the import statement and the macro itself when re-exporting macros. This is a stopgap solution to clean up the std docs and get something small backported into beta.

What this does: When rustdoc finds an export statement for a macro, instead of printing the export and bailing, now it will instead hide the export and bail. Until we can solve https://github.com/rust-lang/rust/issues/34843 or have a better way to find the attributes on an export statement when inlining macros, this will at least match the current behavior and clean up the re-export statements from the docs.
2018-05-24 17:34:55 +08:00
QuietMisdreavus
4cf0c5fa32 fix @!has conditions in pub-use-extern-macros test 2018-05-23 20:53:45 -05:00
QuietMisdreavus
d19b5edfb0 update "pub-use-extern-macros" test to hide the regular import statement 2018-05-23 16:39:47 -05:00
bors
ba64edb3ed Auto merge of #50533 - GuillaumeGomez:rustdoc-prim-auto, r=QuietMisdreavus
add auto-impl for primitive type

Part of #50431.

I have no clue how to test this though with the rustdoc test suite...

r? @QuietMisdreavus
2018-05-18 14:52:12 +00:00
Shotaro Yamada
7eefe2b473 Fix rustdoc panic with impl Trait in type parameters 2018-05-16 11:03:02 +09:00
Guillaume Gomez
564511e58b add auto-impl for primitive type 2018-05-15 21:37:12 +02:00
Oliver Middleton
3daded02fa rustdoc: Add support for pub(restricted) 2018-05-12 18:25:09 +01:00
bors
715d6a98aa Auto merge of #50305 - GuillaumeGomez:fix-mod-stackoverflow, r=QuietMisdreavus
Prevent infinite recursion of modules

Fixes #50196.

r? @QuietMisdreavus
2018-05-07 23:18:12 +00:00
Guillaume Gomez
3ba7c00f94 Prevent infinite recursion of modules 2018-05-07 12:44:03 +02:00
Shotaro Yamada
14f32f64c8 rustdoc: Resolve nested impl Traits 2018-05-03 22:34:10 +09:00
Vadim Petrochenkov
730c7222ee Fix an error from "unused" lint + Fix rebase 2018-05-01 17:02:18 +03:00
Vadim Petrochenkov
300b6bb417 Remove macro_reexport
It's subsumed by `feature(use_extern_macros)` and `pub use`
2018-05-01 15:58:42 +03:00
Oliver Middleton
7232df7d5a rustdoc: Fix links to constants in external crates 2018-04-29 23:28:39 +01:00
Simon Sapin
f0705bf033 Replace StrExt with inherent str methods in libcore 2018-04-21 09:47:37 +02:00
Guillaume Gomez
92d29c1267
Rollup merge of #50032 - ollie27:rustdoc_all_private, r=GuillaumeGomez
rustdoc: Don't include private paths in all.html

For example the `std` [`all.html`](https://doc.rust-lang.org/nightly/std/all.html) includes references to the `coresimd` module which is a private implementation detail.

r? @GuillaumeGomez
2018-04-17 18:43:17 +02:00
QuietMisdreavus
1a0d7a8207 add -C parameter to rustdoc 2018-04-13 16:07:12 -05:00
Oliver Middleton
abded6111b rustdoc: Don't include private paths in all.html 2018-04-13 14:58:43 +01:00
QuietMisdreavus
3366032ab7 add test for using target features in doctests 2018-04-12 15:51:11 -05:00
bors
a1c21ed7e2 Auto merge of #49504 - GuillaumeGomez:doc-all-types, r=QuietMisdreavus
Add page to list all crate's items

r? @QuietMisdreavus
2018-04-10 06:23:52 +00:00
bors
2253216ec5 Auto merge of #49335 - GuillaumeGomez:remove-unneeded-trait-implementations-title, r=QuietMisdreavus
Remove unneeded trait implementations titles

r? @QuietMisdreavus
2018-04-06 12:03:16 +00:00
kennytm
52fd162603
Rollup merge of #49603 - GuillaumeGomez:fix-intra-link-trait-provided-method, r=QuietMisdreavus
Fix url for intra link provided method

Fixes #49582.

r? @QuietMisdreavus
2018-04-04 11:07:22 +02:00
kennytm
f4f13883e5
Rollup merge of #49532 - Phlosioneer:32556-rustdoc-regression-test, r=GuillaumeGomez
Add test for rustdoc ignore test

This will check for regression on issue #32556
2018-04-04 11:07:14 +02:00
kennytm
609e9f014f
Rollup merge of #49512 - GuillaumeGomez:intra-links-fields, r=QuietMisdreavus
Add support for variant and types fields for intra links

Part of #43466.

r? @QuietMisdreavus
2018-04-04 11:07:11 +02:00
kennytm
b7b2ae2b6f
Rollup merge of #49179 - varkor:future-deprecation, r=QuietMisdreavus,GuillaumeGomez
Handle future deprecation annotations

This adds special handling to the `since` parameter of the `deprecated` attribute: in particular, if the `since` version exceeds the version of the compiler, the deprecation notice will not be printed; but a note is added to the documentation stating that the item will be deprecated in a later version.

(I've used `since` for this, rather than adding a new attribute, because it's more seamless and, I feel, intuitive. Plus it involves less code churn.)

![image](https://user-images.githubusercontent.com/3943692/37611317-ef5cdf16-2b99-11e8-8251-e35e8f7b0137.png)
![image](https://user-images.githubusercontent.com/3943692/37611323-f748c2d0-2b99-11e8-966b-11408c73d416.png)

This is a prerequisite for doing things renaming methods in the standard library (e.g. #30459). Resolves #30785.
2018-04-04 11:07:10 +02:00
Guillaume Gomez
43815a508c Add test for all.html 2018-04-04 00:56:08 +02:00
Guillaume Gomez
f9cc0307fe Fix url for intra link provided method 2018-04-02 18:52:04 +02:00
varkor
44ad8fd136 Shorten deprecation note 2018-03-31 21:44:12 +01:00
Phlosioneer
cb3097567f Add ignore reason 2018-03-31 16:23:50 -04:00
Phlosioneer
42bc0712f1 Remove whitespace 2018-03-31 16:08:58 -04:00
Phlosioneer
48e3c961eb Fix tidy trailing newlines 2018-03-31 01:26:02 -04:00
Phlosioneer
fa1d125ae6 Add test for rustdoc ignore test
This will check for regression on issue #32556
2018-03-31 00:59:08 -04:00
bors
1c5283b472 Auto merge of #49459 - GuillaumeGomez:primitive-intra-links, r=QuietMisdreavus
Add primitive intra-links

Part of #43466.

r? @QuietMisdreavus
2018-03-31 01:34:15 +00:00
Guillaume Gomez
d0eeb291dd Add support for variant and types fields for intra links 2018-03-30 16:22:57 +02:00
Guillaume Gomez
d91a821ee8 Remove unneeded trait implementations titles 2018-03-29 14:33:16 +02:00
Guillaume Gomez
561e8efb7d Add primitive intra-links 2018-03-29 13:43:55 +02:00
kennytm
5dc80dc31f
Rollup merge of #49442 - GuillaumeGomez:text-overlap, r=QuietMisdreavus
Fix text overlap

Fixes #49006.

r? @QuietMisdreavus
2018-03-28 17:55:17 +02:00
kennytm
6ca14660af
Rollup merge of #49427 - Manishearth:rustdoc-impl-trait-extern, r=GuillaumeGomez
Correctly handle impl trait in external items in rustdoc

fixes #49373

r? @QuietMisdreavus
2018-03-28 17:55:12 +02:00
Guillaume Gomez
51f26acaea Fix text overlap 2018-03-28 13:25:43 +02:00
bors
e58df0d8c5 Auto merge of #49304 - sinkuu:impl_trait_rustdoc, r=QuietMisdreavus
Rustdoc support for universal_impl_trait

Hides type parameters synthesized by `impl Trait`-in-argument-position, and enables links to trait names.

<img alt="before" src="https://user-images.githubusercontent.com/7091080/37831646-a61413c6-2ee9-11e8-8ec2-a6137956d922.png" width="450"/>
↓
<img alt="after" src="https://user-images.githubusercontent.com/7091080/37831657-b2ff0ae6-2ee9-11e8-8797-fdad904782bf.png" width="450"/>

Fixes #49309
2018-03-28 05:29:57 +00:00
Manish Goregaokar
33dceaa244 rustdoc: Add test for foreign impl trait with bounds 2018-03-27 23:57:03 +02:00
kennytm
68a2e73d8c
Rollup merge of #49333 - GuillaumeGomez:link-assoc-const, r=QuietMisdreavus
Fix impl assoc constant link not working

Fixes #49323.

r? @QuietMisdreavus
2018-03-27 10:47:48 +02:00
varkor
101e17df96 Add tests for items deprecated in the future 2018-03-26 22:16:10 +01:00
Taylor Cramer
0f5b52e4a8 Stabilize conservative_impl_trait 2018-03-26 10:43:03 +02:00
Taylor Cramer
c393db67ba Stabilize universal_impl_trait 2018-03-26 07:39:38 +02:00
Guillaume Gomez
4083bdff0b Fix impl assoc constant link not working 2018-03-24 16:38:16 +01:00
Shotaro Yamada
dc7eb0eae6 Add test for impl Trait in argument position 2018-03-24 14:18:06 +09:00
kennytm
d7eda77692
Rollup merge of #49189 - GuillaumeGomez:fix-implied-shortcut-links, r=QuietMisdreavus
Fix automatic urls with backticks

Fixes #49164.

r? @QuietMisdreavus
2018-03-22 22:43:43 +08:00
QuietMisdreavus
b3fb0d10f0 add target_feature items to doc_cfg rustdoc test 2018-03-21 19:57:10 -05:00
Guillaume Gomez
bac6484a31 Fix automatic urls with backticks 2018-03-19 23:25:55 +01:00
kennytm
e30d89d7a5
Rollup merge of #48898 - GuillaumeGomez:remove-empty-section, r=QuietMisdreavus
Remove auto trait implementation section when empty

Fixes #48882.
2018-03-13 05:01:37 +08:00
Guillaume Gomez
7dc71ec009 Remove auto trait implementation section when empty 2018-03-09 22:18:08 +01:00
Guillaume Gomez
6235ef0422 Add missing items in the sidebar for functions 2018-03-09 17:45:44 +01:00
kennytm
cbd0a2c6fd
Rollup merge of #48473 - GuillaumeGomez:rustdoc-auto-trait-impl-fix, r=QuietMisdreavus
Fix auto trait impl rustdoc ice

Fixes #48463.

r? @QuietMisdreavus
2018-02-28 19:15:33 +08:00
Manish Goregaokar
43d1d6e885
Rollup merge of #48415 - QuietMisdreavus:traits-on-traits-on-traits, r=Manishearth
rustdoc: don't crash when an external trait's docs needs to import another trait

Fixes https://github.com/rust-lang/rust/issues/48414

When resolving intra-paths for an item, rustdoc needs to have information about their items on hand, for proper bookkeeping. When loading a path for an external item, it needs to load these items from their host crate, since their information isn't otherwise available. This includes resolving paths for those docs. which can cause this process to recurse. Rustdoc keeps a map of external traits in a `RefCell<HashMap<DefId, Trait>>`, and it keeps a borrow of this active when importing an external trait. In the linked crash, this led to a RefCell borrow error, panic, and ICE.

This PR manually releases the borrow while importing the trait, and also keeps a list of traits being imported at the given moment. The latter keeps rustdoc from infinitely recursing as it tries to import the same trait repeatedly.
2018-02-24 15:52:11 -08:00
Guillaume Gomez
23dc694c42 Fix auto trait impl rustdoc ice 2018-02-24 01:23:54 +01:00
QuietMisdreavus
8872e7b593 add test for issue 48414 ICE 2018-02-21 19:58:20 -06:00
Guillaume Gomez
c118d37ac4
Rollup merge of #48382 - GuillaumeGomez:fix-rustdoc-test-panic, r=estebank
Fix rustdoc test ICE

Fixes #48377.

r? @QuietMisdreavus
2018-02-21 16:29:56 +01:00
Guillaume Gomez
fe1293f8a9
Rollup merge of #48335 - Manishearth:shortcut-links, r=QuietMisdreavus
Implement implied shortcut links for intra-rustdoc-links

cc https://github.com/rust-lang/rust/issues/43466

Needs https://github.com/google/pulldown-cmark/pull/126

r? @QuietMisdreavus
2018-02-21 16:29:52 +01:00
Guillaume Gomez
5cbf9aedb8 Fix rustdoc test ICE 2018-02-20 20:30:29 +01:00
Aaron Hill
44d07df1cc
Sort synthetic impls bounds before rendering
This removes the implicit dependency on the iteration
order of FxHashMap
2018-02-19 20:27:28 -05:00
Manish Goregaokar
a04c124078 Add test 2018-02-18 17:57:06 -08:00
Aaron Hill
2aead598c8
Remove extra space in test 2018-02-18 16:29:26 -05:00
Aaron Hill
6728f21d85
Generate documentation for auto-trait impls
A new section is added to both both struct and trait doc pages.

On struct/enum pages, a new 'Auto Trait Implementations' section displays any
synthetic implementations for auto traits. Currently, this is only done
for Send and Sync.

On trait pages, a new 'Auto Implementors' section displays all types
which automatically implement the trait. Effectively, this is a list of
all public types in the standard library.

Synthesized impls for a particular auto trait ('synthetic impls') take
into account generic bounds. For example, a type 'struct Foo<T>(T)' will
have 'impl<T> Send for Foo<T> where T: Send' generated for it.

Manual implementations of auto traits are also taken into account. If we have
the following types:

'struct Foo<T>(T)'
'struct Wrapper<T>(Foo<T>)'
'unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes
this sound somehow

Then Wrapper will have the following impl generated:
'impl<T> Send for Wrapper<T>'
reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send'
to hold

Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are
taken into account by synthetic impls

However, if a type can *never* implement a particular auto trait
(e.g. 'struct MyStruct<T>(*const T)'), then a negative impl will be
generated (in this case, 'impl<T> !Send for MyStruct<T>')

All of this means that a user should be able to copy-paste a synthetic
impl into their code, without any observable changes in behavior
(assuming the rest of the program remains unchanged).
2018-02-18 16:29:24 -05:00
Guillaume Gomez
af140ecdbc
Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkor
fix more typos found by codespell.
2018-02-18 13:21:01 +01:00
Guillaume Gomez
b7791b0c7e
Rollup merge of #48274 - GuillaumeGomez:remove-hoedown, r=QuietMisdreavus
Remove hoedown from rustdoc

Finally the time has come!

r? @QuietMisdreavus
2018-02-18 13:20:59 +01:00
Matthias Krüger
4452446292 fix more typos found by codespell. 2018-02-17 17:38:49 +01:00
Guillaume Gomez
8aa2852399
Rollup merge of #48095 - QuietMisdreavus:doctest-assembly, r=GuillaumeGomez
add unit tests for rustdoc's processing of doctests

cc #42018

There's a lot of things that rustdoc will do to massage doctests into something that can be compiled, and a lot of options that can be toggled to affect this. Hopefully this list of tests can show off that functionality.

The first commit is slightly unrelated but doesn't touch public functionality, because i found that if you have a manual `fn main`, it adds an extra line break at the end, whereas it would trim this extra line break if it were putting a `fn main` in automatically. That first commit makes it trim out that whitespace ahead of time.
2018-02-17 14:45:20 +01:00
Guillaume Gomez
5bd5bc3f21 Remove hoedown from rustdoc
Is it really time? Have our months, no, *years* of suffering come to an end? Are we finally able to cast off the pall of Hoedown? The weight which has dragged us down for so long?

-----

So, timeline for those who need to catch up:

* Way back in December 2016, [we decided we wanted to switch out the markdown renderer](https://github.com/rust-lang/rust/issues/38400). However, this was put on hold because the build system at the time made it difficult to pull in dependencies from crates.io.
* A few months later, in March 2017, [the first PR was done, to switch out the renderers entirely](https://github.com/rust-lang/rust/pull/40338). The PR itself was fraught with CI and build system issues, but eventually landed.
* However, not all was well in the Rustdoc world. During the PR and shortly after, we noticed [some differences in the way the two parsers handled some things](https://github.com/rust-lang/rust/issues/40912), and some of these differences were major enough to break the docs for some crates.
* A couple weeks afterward, [Hoedown was put back in](https://github.com/rust-lang/rust/pull/41290), at this point just to catch tests that Pulldown was "spuriously" running. This would at least provide some warning about spurious tests, rather than just breaking spontaneously.
* However, the problems had created enough noise by this point that just a few days after that, [Hoedown was switched back to the default](https://github.com/rust-lang/rust/pull/41431) while we came up with a solution for properly warning about the differences.
* That solution came a few weeks later, [as a series of warnings when the HTML emitted by the two parsers was semantically different](https://github.com/rust-lang/rust/pull/41991). But that came at a cost, as now rustdoc needed proc-macro support (the new crate needed some custom derives farther down its dependency tree), and the build system was not equipped to handle it at the time. It was worked on for three months as the issue stumped more and more people.
  * In that time, [bootstrap was completely reworked](https://github.com/rust-lang/rust/pull/43059) to change how it ordered compilation, and [the method by which it built rustdoc would change](https://github.com/rust-lang/rust/pull/43482), as well. This allowed it to only be built after stage1, when proc-macros would be available, allowing the "rendering differences" PR to finally land.
  * The warnings were not perfect, and revealed a few [spurious](https://github.com/rust-lang/rust/pull/44368) [differences](https://github.com/rust-lang/rust/pull/45421) between how we handled the renderers.
  * Once these were handled, [we flipped the switch to turn on the "rendering difference" warnings all the time](https://github.com/rust-lang/rust/pull/45324), in October 2017. This began the "warning cycle" for this change, and landed in stable in 1.23, on 2018-01-04.
  * Once those warnings hit stable, and after a couple weeks of seeing whether we would get any more reports than what we got from sitting on nightly/beta, [we switched the renderers](https://github.com/rust-lang/rust/pull/47398), making Pulldown the default but still offering the option to use Hoedown.

And that brings us to the present. We haven't received more new issues from this in the meantime, and the "switch by default" is now on beta. Our reasoning is that, at this point, anyone who would have been affected by this has run into it already.
2018-02-16 23:17:15 +01:00
kennytm
4139c0ac74
Rollup merge of #48051 - ollie27:rustdoc_fn_unit_return, r=QuietMisdreavus
rustdoc: Hide `-> ()` in cross crate inlined Fn* bounds
2018-02-10 14:23:59 +08:00
QuietMisdreavus
72779936ec fix playground test for newly-trimmed doctests 2018-02-09 13:48:59 -06:00
Oliver Middleton
528d6b65b6 rustdoc: Hide -> () in cross crate inlined Fn* bounds 2018-02-07 13:14:37 +00:00
kennytm
daecd15271
Rollup merge of #47959 - Manishearth:rustdoc-ice, r=Mark-Simulacrum
Fix rustdoc ICE on macros defined within functions

fixes #47639
2018-02-06 02:13:52 +08:00
Guillaume Gomez
6b35d81382 Fix const evaluation ICE in rustdoc 2018-02-03 12:30:37 +01:00
Manish Goregaokar
ee737c73a2 Add regression test 2018-02-02 13:36:26 +05:30
Oliver Middleton
ae98f4cac5 rustdoc: Fix link title rendering with hoedown
The link title needs to be HTML escaped.
2018-01-29 19:26:31 +00:00
Alex Crichton
1dc85768d2 Merge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollup 2018-01-26 06:51:58 -08:00
Manish Goregaokar
08ca4fd135 Add tests 2018-01-25 10:11:25 +05:30
bors
4e3901d35f Auto merge of #47678 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

- Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672
- Failed merges:
2018-01-23 16:13:18 +00:00
Oliver Middleton
2e81ce7dfa rustdoc: Hide methods from #[doc(masked)] crates from the search index 2018-01-23 04:22:20 +00:00
Oliver Middleton
04a884726a rustdoc: Show when traits are auto traits 2018-01-23 01:04:24 +00:00
QuietMisdreavus
afe3e27085 value-namespace items require a marker, so emit an error 2018-01-22 15:24:31 +05:30
QuietMisdreavus
eca3c55881 add ambiguity markers to the intra-links test 2018-01-22 15:24:30 +05:30
QuietMisdreavus
a3d71d7405 add a macro to the intra-links test 2018-01-22 15:24:30 +05:30
QuietMisdreavus
30fca0919c add basic test for rustdoc intra links 2018-01-22 15:24:28 +05:30
Guillaume Gomez
c0ae371a41 Rollup merge of #47313 - ollie27:rustdoc_record_extern_trait, r=QuietMisdreavus
rustdoc: Populate external_traits with traits only seen in impls

This means default methods can always be found and "Important traits" will include all spotlight traits.
2018-01-17 23:43:27 +01:00
Carol (Nichols || Goulding)
e168aa385b
Reexport -> re-export in prose and documentation comments 2018-01-15 13:36:53 -05:00
leonardo.yvens
02b5fee732 Adjust tests for removal of impl Foo for .. {} 2018-01-13 18:48:00 +03:00
Oliver Middleton
45cad0456f rustdoc: Populate external_traits with traits only seen in impls
This means default methods can always be found and "Important traits" will include all spotlight traits.
2018-01-10 07:05:30 +00:00
kennytm
de4e1a9773
Rollup merge of #47263 - ollie27:rustdoc_private_macro_import, r=GuillaumeGomez
rustdoc: Don't import macros from private imports

Fixes #47038
2018-01-09 03:37:19 +08:00
kennytm
4a6f440920 Rollup merge of #47210 - zackmdavis:the_3rd_of_2_hardest_problems_in_computer_science, r=QuietMisdreavus
fix the doc-comment-decoration-trimming edge-case rustdoc ICE

This `horizontal_trim` function strips the leading whitespace from
doc-comments that have a left-asterisk-margin:

```
  /**
   * You know what I mean—
   *
   * comments like this!
   */
```

The index of the column of asterisks is `i`, and if trimming is deemed
possible, we slice each line from `i+1` to the end of the line. But if, in
particular, `i` was 0 _and_ there was an empty line (as in the example
given in the reporting issue), we ended up panicking trying to slice an
empty string from 0+1 (== 1).

Let's tighten our check to say that we can't trim when `i` is even the same
as the length of the line, not just when it's greater. (Any such cases
would panic trying to slice `line` from `line.len()+1`.)

Resolves #47197.
2018-01-09 01:58:45 +08:00
Oliver Middleton
8302044a52 rustdoc: Don't import macros from private imports 2018-01-08 03:39:25 +00:00
bors
8724337c23 Auto merge of #47039 - ollie27:rustdoc_trait_impl_src, r=GuillaumeGomez
rustdoc: Add missing src links for generic impls on trait pages

`implementor2item` would return `None` for generic impls so instead this clones the entire `clean::Item` into the `implementors` map which simplifies some code.
2018-01-07 13:12:15 +00:00
Zack M. Davis
3cfea33432 wherein careful doc-decoration arithmetic proves quite the ICE-breaker
This `horizontal_trim` function strips the leading whitespace from
doc-comments that have a left-asterisk-margin:

  /**
   * You know what I mean—
   *
   * comments like this!
   */

The index of the column of asterisks is `i`, and if trimming is deemed
possible, we slice each line from `i+1` to the end of the line. But if, in
particular, `i` was 0 _and_ there was an empty line (as in the example
given in the reporting issue), we ended up panicking trying to slice an
empty string from 0+1 (== 1).

Let's tighten our check to say that we can't trim when `i` is even the same
as the length of the line, not just when it's greater. (Any such cases
would panic trying to slice `line` from `line.len()+1`.)

Resolves #47197.
2018-01-06 11:17:29 -08:00
bors
90e019bacd Auto merge of #47083 - CAD97:issue-46976, r=nikomatsakis
Issue 46976

ICE is due to an empty path segments, so I set the path to be the same as the in band ty params symbol. (I think this is how regular generics end up being handled?)

Pinging @cramertj, this is your code I'm editing here.
2018-01-06 09:22:16 +00:00
Christopher Durham
d4077ad621 Hard break for rust-lang/rust#46976 2017-12-30 21:41:58 -05:00
kennytm
4daaee900f
Add trailing newlines to files which have no trailing newlines. 2017-12-30 15:50:52 +08:00
Oliver Middleton
95f9491bc7 rustdoc: Don't try to generate links for modules in import paths
The modules may be private or may even be enums so it would generate dead links.
2017-12-28 17:51:31 +00:00
Oliver Middleton
3d11d201d9 rustdoc: Add missing src links for generic impls on trait pages
`implementor2item` would return `None` for generic impls so instead this clones the entire `clean::Item` into the `implementors` map which simplifies some code.
2017-12-27 23:39:25 +00:00
bors
304717bd86 Auto merge of #46894 - detrumi:fix-const-eval-trait, r=eddyb
Const-eval array lengths in rustdoc.

Fixes #46727
r? @eddyb

Big thanks to @eddyb for helping me figure this out.
2017-12-24 12:48:57 +00:00
Wilco Kusee
d10d389225 Testcase for const-eval array lengths 2017-12-23 11:16:03 +01:00
kennytm
696e951fe9 Rollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebank
tweaks and fixes for doc(include)

This PR makes a handful of changes around `#[doc(include="file.md")]` (https://github.com/rust-lang/rust/issues/44732):

* Turns errors when loading files into full errors. This matches the original RFC text.
* Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes.
* Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends.
* Adds or modifies tests to check for all of these.
2017-12-22 02:50:53 +08:00
kennytm
256bf2be62 Rollup merge of #46847 - GuillaumeGomez:more-sidebar-escape, r=QuietMisdreavus
Escape more items in the sidebar when needed

Fixes #46724.

r? @QuietMisdreavus
2017-12-22 02:50:52 +08:00
Guillaume Gomez
d4424d84fb Escape more items in the sidebar when needed 2017-12-21 13:17:15 +01:00
kennytm
cc3f4357d3 Rollup merge of #46787 - varkor:contrib-6, r=QuietMisdreavus
Add an option to allow rustdoc to list modules by appearance

The `--sort-modules-by-appearance` option will list modules in the
order that they appear in the source, rather than sorting them
alphabetically (as is the default). This resolves #8552.
2017-12-20 21:21:56 +08:00
kennytm
8de81966cd Rollup merge of #46359 - GuillaumeGomez:remove-dead-linkage, r=QuietMisdreavus
Do not display hidden types, fixes issue 23912

Fixes #23912.

r? @QuietMisdreavus

(It's the one I was talking about a few days ago, just close it if it's useless.)
2017-12-20 21:21:50 +08:00
QuietMisdreavus
f873c55709 test for missing_doc in the external_doc test 2017-12-19 16:43:46 -06:00
varkor
b3c6102be3 Add a test for --sort-modules-by-appearance 2017-12-19 01:05:06 +00:00
Guillaume Gomez
03530ee1a7 Add tests for hidden types 2017-12-18 23:07:19 +01:00
Guillaume Gomez
0df39bfff7 Fix ?Sized where bound not being displayed at the correct place 2017-12-18 10:44:26 +01:00
bors
16ba4591d7 Auto merge of #46384 - ollie27:rustdoc_inline_assoc, r=QuietMisdreavus
rustdoc: Fix issues with cross-crate inlined associated items

* Visibility was missing from impl items.
* Attributes and docs were missing from consts and types in impls.
* Const default values were missing from traits.

This unifies the code that handles associated items from impls and traits.
2017-12-03 00:54:52 +00:00
bors
8bcbf91a86 Auto merge of #46326 - GuillaumeGomez:sidebar-text, r=QuietMisdreavus
Fix invalid HTML escape

Fixes #46289.

r? @QuietMisdreavus
2017-12-02 07:49:32 +00:00
kennytm
662f902746 Rollup merge of #46412 - chrisduerr:issue-46380, r=QuietMisdreavus
Hide private trait type params and show hidden items with document-private

As discussed in #46380, this PR removes the `strip-hidden` pass from `--document-private-items` which allows showing `#[doc(hidden)]` with rustdoc.

The second commit removes the trait implementation from the docs if the trait's parameter is private.
2017-12-02 01:39:03 +08:00
kennytm
3f99b7c993 Rollup merge of #46405 - alexcrichton:fix-rustdoc, r=estebank
rustc: Filter out bogus extern crate warnings

Rustdoc has for some time now used the "everybody loops" pass in the compiler to
avoid typechecking and otherwise avoid looking at implementation details.
In #46115 the placement of this pass was pushed back in the compiler to after
macro expansion to ensure that it works with macro-expanded code as well. This
in turn caused the regression in #46271.

The bug here was that the resolver was producing `def_id` instances for
"possibly unused extern crates" which would then later get processed during
typeck to actually issue lint warnings. The problem was that *after* resolution
these `def_id` nodes were actually removed from the AST by the "everybody loops"
pass. This later, when we tried to take a look at `def_id`, caused the compiler
to panic.

The fix applied here is a bit of a heavy hammer which is to just, in this one
case, ignore the `extern crate` lints if the `def_id` looks "bogus" in any way
(basically if it looks like the node was removed after resolution). The real
underlying bug here is probably that the "everybody loops" AST pass is being
stressed to much beyond what it was originally intended to do, but this should
at least fix the ICE for now...

Closes #46271
2017-12-02 01:39:02 +08:00
Christian Duerr
5f47c7f531
Fix htmldocck naming
After renaming the structs and enums the htmldocck strings still
contained the old names. This lead to test failure.

These htmldocck tests have been updated to use the proper names of the
rust structs and traits.
2017-11-30 21:43:21 +01:00
Christian Duerr
1df13c057a
Hide trait impl with private trait type parameter
Trait's implementations with private type parameters were displayed in
the implementing struct's documentation until now.

With this change any trait implementation that uses a private type
parameter is now hidden in the docs.
2017-11-30 21:18:36 +01:00
Christian Duerr
ec337b613e
Show hidden items with rustdoc's document-private
When using `#[doc(hidden)]` elements are hidden from docs even when the
rustdoc flag `--document-private-items` is set.

This behavior has been changed to display all hidden items when the flag
is active.
2017-11-30 21:18:00 +01:00
Alex Crichton
4e74eb5ba0 rustc: Filter out bogus extern crate warnings
Rustdoc has for some time now used the "everybody loops" pass in the compiler to
avoid typechecking and otherwise avoid looking at implementation details.
In #46115 the placement of this pass was pushed back in the compiler to after
macro expansion to ensure that it works with macro-expanded code as well. This
in turn caused the regression in #46271.

The bug here was that the resolver was producing `def_id` instances for
"possibly unused extern crates" which would then later get processed during
typeck to actually issue lint warnings. The problem was that *after* resolution
these `def_id` nodes were actually removed from the AST by the "everybody loops"
pass. This later, when we tried to take a look at `def_id`, caused the compiler
to panic.

The fix applied here is a bit of a heavy hammer which is to just, in this one
case, ignore the `extern crate` lints if the `def_id` looks "bogus" in any way
(basically if it looks like the node was removed after resolution). The real
underlying bug here is probably that the "everybody loops" AST pass is being
stressed to much beyond what it was originally intended to do, but this should
at least fix the ICE for now...

Closes #46271
2017-11-30 08:03:04 -08:00
Christian Duerr
91a4106911
Fix rustoc item summaries that are headers
Rustoc item summaries that are headers were not displayed at all because
they started with whitespace.

This PR fixes this and now removes the whitespace and then displays the
block.
2017-11-30 00:28:59 +01:00
Oliver Middleton
b4448435f9 rustdoc: Fix issues with cross-crate inlined associated items
* Visibility was missing from impl items.
* Attributes and docs were missing from consts and types in impls.
* Const default values were missing from traits.

This unifies the code that handles associated items from impls and traits.
2017-11-29 22:05:38 +00:00
Guillaume Gomez
35f5be6646 Fix invalid HTML escape 2017-11-29 19:33:04 +01:00
bors
cc6b88ccb2 Auto merge of #46129 - kennytm:fix-46098-rustdoc-reexport-extern-type, r=GuillaumeGomez
Properly handle reexport of foreign items.

Handles `pub use` of `extern { fn, static, type }`. Also plug in some more `match` arms where handling `extern type` is reasonable.

Fixed #46098.
2017-11-25 08:38:42 +00:00
bors
3755fe9555 Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomez
rustdoc: include external files in documentation (RFC 1990)

Part of https://github.com/rust-lang/rfcs/pull/1990 (needs work on the error reporting, which i'm deferring to after this initial PR)

cc #44732

Also fixes #42760, because the prep work for the error reporting made it easy to fix that at the same time.
2017-11-22 09:58:07 +00:00
QuietMisdreavus
f9f3611f5c allow loading external files in documentation
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990
(needs error reporting work)

cc #44732
2017-11-21 15:46:49 -06:00
kennytm
3bf1328005 Rollup merge of #46134 - GuillaumeGomez:negative-traits, r=QuietMisdreavus
Display negative traits implementation

Fixes #45816.

r? @QuietMisdreavus
2017-11-22 01:13:02 +08:00
bors
421a2113a8 Auto merge of #45039 - QuietMisdreavus:doc-spotlight, r=GuillaumeGomez,QuietMisdreavus
show in docs whether the return type of a function impls Iterator/Read/Write

Closes #25928

This PR makes it so that when rustdoc documents a function, it checks the return type to see whether it implements a handful of specific traits. If so, it will print the impl and any associated types. Rather than doing this via a whitelist within rustdoc, i chose to do this by a new `#[doc]` attribute parameter, so things like `Future` could tap into this if desired.

### Known shortcomings

~~The printing of impls currently uses the `where` class over the whole thing to shrink the font size relative to the function definition itself. Naturally, when the impl has a where clause of its own, it gets shrunken even further:~~ (This is no longer a problem because the design changed and rendered this concern moot.)

The lookup currently just looks at the top-level type, not looking inside things like Result or Option, which renders the spotlights on Read/Write a little less useful:

<details><summary>`File::{open, create}` don't have spotlight info (pic of old design)</summary>

![image](https://user-images.githubusercontent.com/5217170/31209495-e59d027e-a950-11e7-9998-ceefceb71c07.png)

</details>

All three of the initially spotlighted traits are generically implemented on `&mut` references. Rustdoc currently treats a `&mut T` reference-to-a-generic as an impl on the reference primitive itself. `&mut Self` counts as a generic in the eyes of rustdoc. All this combines to create this lovely scene on `Iterator::by_ref`:

<details><summary>`Iterator::by_ref` spotlights Iterator, Read, and Write (pic of old design)</summary>

![image](https://user-images.githubusercontent.com/5217170/31209554-50b271ca-a951-11e7-928b-4f83416c8681.png)

</details>
2017-11-21 03:03:28 +00:00
Guillaume Gomez
09dcc5f361 Display negative traits implementation 2017-11-20 21:53:19 +01:00
kennytm
f0fcdbc021
Properly handle reexport of foreign items.
Handles `pub use` of `extern { fn, static, type }`. Also plug in some more
`match` arms where handling `extern type` is reasonable.

Fixed #46098.
2017-11-21 02:51:05 +08:00
Florian Hartwig
32af136fb0 Make rustdoc not include self-by-value methods from Deref target 2017-11-20 00:15:26 +01:00
Guillaume Gomez
6047a03659 Add tooltip for important traits display 2017-11-18 14:37:10 +01:00
bors
130eaaeaba Auto merge of #46000 - kennytm:fix-45640-extern-type-ice-in-rustdoc, r=QuietMisdreavus
Support `extern type` in rustdoc.

Fixes #45640.

(cc #43467)
2017-11-18 09:18:13 +00:00
QuietMisdreavus
831fd78341 add doc_highlight feature flag and tests 2017-11-17 22:50:15 +01:00
Christopher Vittal
337dee4c80 Remove Fn trait + impl Trait rustdoc tests 2017-11-15 15:46:01 -05:00
Christopher Vittal
06dff80061 Add/Modify tests for argument position impl Trait 2017-11-15 15:46:01 -05:00
kennytm
2792b56a92
Support extern type in rustdoc.
Fixes #45640.
2017-11-15 18:20:28 +08:00
Guillaume Gomez
013cd5af86 Rollup merge of #45815 - QuietMisdreavus:happy-little-notices, r=GuillaumeGomez
rustdoc: tweak notes on ignore/compile_fail examples

Part of https://github.com/rust-lang/rust/issues/44927

This is a softening of these notices to mention *why* a given example has a given callout, rather then telling viewers to be careful with an example. It also changes the character used for these samples from a warning logo to a circle-i/information logo.

![image](https://user-images.githubusercontent.com/5217170/32464361-5fbb5d9e-c305-11e7-8482-ce71b97a54df.png)
2017-11-14 16:52:07 +01:00
QuietMisdreavus
02b3785f84 update codeblock-title test with new notice text 2017-11-13 11:44:19 -06:00
Guillaume Gomez
ac398a33a9 Add more elements in the sidebar 2017-11-07 23:45:06 +01:00
kennytm
4b2a5da8c9
Rollup merge of #45764 - QuietMisdreavus:rustdoc-doctest-lints, r=GuillaumeGomez
rustdoc: add #[allow(unused)] to every doctest

More information in #45750 - this is behavior that was documented but not actually implemented.

I also reordered how outer attributes are applied to doctests. Previously, attributes from `#![doc(test(attr(...)))]` would be applied *after* attributes from within the test itself, meaning if a doctest tried to override lints that would be set crate-wide, it wouldn't work at all. This gives a better scope of how lints can be applied.

Closes #45750
2017-11-07 22:40:16 +08:00
bors
3e7f501991 Auto merge of #45620 - ollie27:rustdoc_impl_generic_dupe, r=QuietMisdreavus
rustdoc: Fix duplicated impls with generics

The same type can appear multiple times in impls so we need to use a set
to avoid adding it multiple times.

Fixes: #45584
2017-11-07 07:24:13 +00:00
QuietMisdreavus
ce2768ab95 add #![allow(unused)] to the playground link rustdoc tests 2017-11-05 10:24:05 -06:00
kennytm
e3b25a5942 Rollup merge of #45746 - GuillaumeGomez:methods-doc-test, r=steveklabnik
Add tests for methods listing in rust docs

r? @rust-lang/docs
2017-11-04 13:49:33 +08:00
leonardo.yvens
8b586e68b5 auto trait future compatibility lint 2017-11-03 16:13:21 -02:00
Guillaume Gomez
765153e6a4 Add tests for methods listing in rust docs 2017-11-03 18:39:00 +01:00
Oliver Middleton
676b4bbdc4 rustdoc: Fix duplicated impls with generics
The same type can appear multiple times in impls so we need to use a set
to avoid adding it multiple times.
2017-10-29 18:21:20 +00:00
steveklabnik
045ce183cc modify tests to use new flag 2017-10-17 15:38:52 -04:00
kennytm
445bbde784
Rollup merge of #44989 - QuietMisdreavus:what-is-your-quest, r=GuillaumeGomez
let rustdoc print the crate version into docs

This PR adds a new unstable flag to rustdoc, `--crate-version`, which when present will add a new entry to the sidebar of the root module, printing the given version number:

![Screenshot of a test crate, showing "Version 1.3.37" under the crate name](https://user-images.githubusercontent.com/5217170/31104096-805e3f4c-a7a0-11e7-96fc-368b6fe063d6.png)

Closes #24336

(The WIP status is because i don't want to merge this until i can get the std docs to use it, which i need help from rustbuild people to make sure i get right.)
2017-10-13 01:58:36 +08:00
QuietMisdreavus
fcee950660 let rustdoc print the crate version into docs 2017-10-09 09:56:17 -05:00
bors
05f8ddc46a Auto merge of #44892 - GuillaumeGomez:fnty-args-rustdoc, r=eddyb
Fnty args rustdoc

Fixes #44570.

cc @QuietMisdreavus
cc @rust-lang/dev-tools

Considering the impact on the `hir` libs, I'll put @eddyb as reviewer.

r? @eddyb
2017-10-07 19:39:31 +00:00
Guillaume Gomez
fe24e815a2 Fix invalid rustdoc rendering for FnTy args 2017-10-07 17:23:06 +02:00
bors
d2f71bf23f Auto merge of #44860 - kennytm:fix-44731, r=alexcrichton
Fix issue #44731.

Also excludes `impl Trait` from everybody_loops if it appears in the path.

Fixes #44731.
2017-10-07 09:36:12 +00:00
bors
4502e2aa9c Auto merge of #44949 - QuietMisdreavus:rustdoctest-dirs, r=nikomatsakis
let htmldocck.py check for directories

Since i messed this up during https://github.com/rust-lang/rust/pull/44613, i wanted to codify this into the rustdoc tests to make sure that doesn't happen again.
2017-10-03 19:38:33 +00:00