Commit Graph

29378 Commits

Author SHA1 Message Date
Alex Crichton
e1e8db7e4a rustdoc: Ensure external impls are inlined once
If the type associated with the impl is `pub use`'d or referenced twice in a
downstream crate, the impl will attempt to be inlined twice.

Closes #14584
2014-06-01 21:53:43 -07:00
Alex Crichton
890754794c mk: Less noisy rustdoc invocations 2014-06-01 21:53:43 -07:00
Alex Crichton
f71f97b7c2 rustdoc: Filter private methods from inlined impls
Closes #14583
2014-06-01 21:53:43 -07:00
Alex Crichton
0dbfa5f611 rustdoc: Fix some more broken links 2014-06-01 21:53:43 -07:00
bors
c605c2b57b auto merge of #14580 : utkarshkukreti/rust/fix-docs-for-result-map, r=alexcrichton
`reader.read_line()` includes trailing newline char, which makes
`from_str` always return `None`.
2014-06-01 04:36:38 -07:00
bors
dfaea70963 auto merge of #14578 : huonw/rust/as_slice-cheatsheet, r=sfackler
doc: add an `.as_slice` example to the cheatsheet.

A lot of questions about this on IRC and stackoverflow.
2014-06-01 02:36:39 -07:00
bors
064dbb9200 auto merge of #14571 : bnoordhuis/rust/libtest-check-isatty, r=alexcrichton
Fixes #14570.
2014-06-01 00:56:42 -07:00
Utkarsh Kukreti
cf4864a7a5 Fix docs for core::result::Result::map.
`reader.read_line()` includes trailing newline char, which makes
`from_str` always return `None`.
2014-06-01 12:18:39 +05:30
bors
4e0b936900 auto merge of #14513 : alexcrichton/rust/rustdoc-primitives, r=huonw
This is currently rebased on top of #14478, but that's just to preemptively avoid rebase conflicts and to provide a better preview. This can land independently of that PR.

This change crates a dedicated page in rustdoc for primitive types to outline everything you can do with them (at least in a basic way).

* Preview - http://people.mozilla.org/~acrichton/doc/
* Exhibit A - http://people.mozilla.org/~acrichton/doc/std/#primitives
* Exhibit B - http://people.mozilla.org/~acrichton/doc/std/primitive.str.html
* Exhibit C - http://people.mozilla.org/~acrichton/doc/std/primitive.slice.html

Please don't hesitate to be nitpickity, it's easy to overlook a thing here or there!
2014-05-31 23:16:42 -07:00
Alex Crichton
d58f27a82f syntax: Fix an accidental hyperlink in a comment 2014-05-31 22:00:26 -07:00
Alex Crichton
31f5de610f rustdoc: Don't inline tuple struct constructors
These don't actually point to anything, so there's no need to inline them.
2014-05-31 21:59:50 -07:00
Alex Crichton
7ec6df5f45 rustdoc: Fix cross-crate links to reexported items
Cross crate links can target items which are not rendered in the documentation.
If the item is reexported at a higher level, the destination of the link (a
concatenation of the fully qualified name) may actually lead to nowhere. This
fixes this problem by altering rustdoc to emit pages which redirect to the local
copy of the reexported structure.

cc #14515
Closes #14137
2014-05-31 21:59:50 -07:00
Alex Crichton
c5830a954e doc: Fix a number of broken links
cc #14515
2014-05-31 21:59:50 -07:00
Alex Crichton
8c669d7f74 rustdoc: Suck in all impls from external crates
There is currently no way to query all impls for a type from an external crate,
and with primitive types in play this is also quite difficult. Instead of
filtering, just suck in all impls from upstream crates into the local AST, and
have them get stripped later.

This will allow population of all implementations of traits for primitive types,
as well as filling in some corner cases with inlining documentation in other
cases.
2014-05-31 21:59:50 -07:00
Alex Crichton
c2564b8fd4 rustdoc: Filter inlining private external items
This prevents structures like RcBox from showing up in the documentation
2014-05-31 21:59:50 -07:00
Alex Crichton
c2e3aa37da rustdoc: Create anchor pages for primitive types
This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]`
attribute. This attribute indicates that the current module is the "owner" of
the primitive type `foo`. For rustdoc, this means that the doc-comment for the
module is the doc-comment for the primitive type, plus a signal to all
downstream crates that hyperlinks for primitive types will be directed at the
crate containing the `#[doc]` directive.

Additionally, rustdoc will favor crates closest to the one being documented
which "implements the primitive type". For example, documentation of libcore
links to libcore for primitive types, but documentation for libstd and beyond
all links to libstd for primitive types.

This change involves no compiler modifications, it is purely a rustdoc change.
The landing pages for the primitive types primarily serve to show a list of
implemented traits for the primitive type itself.

The primitive types documented includes both strings and slices in a semi-ad-hoc
way, but in a way that should provide at least somewhat meaningful
documentation.

Closes #14474
2014-05-31 21:59:50 -07:00
Alex Crichton
ba9be0a72b rustdoc: Fill in external type parameters correctly
Type parameters were filled in for some areas, but not all. This commit unifies
the two code paths to fill in type parameters everywhere.

Closes #14508
2014-05-31 21:59:50 -07:00
Alex Crichton
19fe4aad68 rustdoc: Stringify more named lifetimes
cc #14462
2014-05-31 21:59:50 -07:00
Alex Crichton
658924068e rustdoc: Show all implementors of traits
When inlining documentation across crates, primitive implementors of traits were
not shown. This commit tweaks the infrastructure to treat primitive and
Path-like impls the same way, displaying all implementors everywhere.

cc #14462
2014-05-31 21:59:50 -07:00
Alex Crichton
0777ce86e1 rustdoc: Freeze the cache ASAP
The cache is going to be used earlier in the HTML generation process, which
means that it needs to get into TLS as soon as possible.
2014-05-31 21:59:50 -07:00
Alex Crichton
356423d8f1 rustdoc: Refactor structure of html::run
Instead of one giant function, this breaks it up into several smaller functions
which have explicit dependencies among one another.

There are no code changes as a result of this commit.
2014-05-31 21:59:50 -07:00
bors
5527c5dc06 auto merge of #14561 : jakub-/rust/issue-11319, r=alexcrichton
Fixes #11319
2014-05-31 21:41:46 -07:00
Huon Wilson
aec7f46902 doc: add an .as_slice example to the cheatsheet.
A lot of questions about this on IRC and stackoverflow.
2014-06-01 14:13:10 +10:00
bors
ee97698f85 auto merge of #14567 : cburgdorf/rust/patch-2, r=brson
This rewrites the example to also be more aligned with
the same example given in the main tutorial.
2014-05-31 20:01:45 -07:00
bors
3712551bc4 auto merge of #14566 : cburgdorf/rust/patch-1, r=cmr
Renamed `owned_box` to `on_the_heap` to use a consistent
naming across the tutorial and the life time guide.
Also it makes the example easier to grasp.
2014-05-31 17:51:44 -07:00
Christoph Burgdorf
ade5a9d2fe Fix example in lifetime guide
This rewrites the example to also be more aligned with
the same example given in the main tutorial.
2014-05-31 23:41:50 +02:00
Christoph Burgdorf
b657af8946 Rename variable in tutorial
Renamed `owned_box` to `on_the_heap` to use a consistent
naming across the tutorial and the life time guide.
Also it makes the example easier to grasp.
2014-05-31 23:33:03 +02:00
Ben Noordhuis
87ecd4f75b libtest: Only colorize output if stdout is a tty
Fixes #14570.
2014-05-31 21:55:18 +02:00
Jakub Wieczorek
b64046a5b0 Make the match arm type mismatch message point to the arm's span
Fixes #11319
2014-05-31 21:10:02 +02:00
bors
60b4a97de7 auto merge of #14562 : jakub-/rust/issue-14541, r=alexcrichton
Fixes #14541
2014-05-31 11:21:38 -07:00
bors
b38712071e auto merge of #14565 : fhartwig/rust/master, r=sfackler 2014-05-31 09:36:39 -07:00
Florian Hartwig
096f80e770 Fix broken markup in query_to_str documentation 2014-05-31 17:46:35 +02:00
bors
2f221c766b auto merge of #14563 : dotdash/rust/clone_kill, r=huonw
By dropping the intermediate vector that holds the relevant candidates
including duplicates and directly building the vector that has the
duplicates removed we can eliminate quite a few allocations. This
reduces the times for type checking by 5-10% (measured with libstd,
libsyntax and librustc).
2014-05-31 07:56:39 -07:00
bors
0839e940a5 auto merge of #14557 : zwarich/rust/missing-comment, r=alexcrichton
For some reason, I had this comment in my local tree but not in the
branch I sent with the PR.
2014-05-31 06:16:40 -07:00
Björn Steinbrink
cd844c5fb5 Remove unnecessary allocations / clones during method lookup
By dropping the intermediate vector that holds the relevant candidates
including duplicates and directly building the vector that has the
duplicates removed we can eliminate quite a few allocations. This
reduces the times for type checking by 5-10% (measured with libstd,
libsyntax and librustc).
2014-05-31 14:58:12 +02:00
bors
bcf3464827 auto merge of #14556 : sfackler/rust/kill-workcache, r=alexcrichton
This was only ever used by rustpkg and is very unmaintained.

[breaking-change]
2014-05-31 04:26:40 -07:00
Jakub Wieczorek
80e84e0001 Use RHS's struct def ID for error messages in pattern matching
Fixes #14541
2014-05-31 12:50:14 +02:00
bors
2652ba1505 auto merge of #14555 : tomjakubowski/rust/fix-snappy-link, r=alexcrichton
Google have migrated snappy to GitHub.
2014-05-31 02:46:38 -07:00
bors
faa7ba75a7 auto merge of #14553 : reem/rust/nuke-owned-vectors, r=alexcrichton
I removed all remaining deprecated owned vectors from the docs. All example tests pass.
2014-05-31 01:06:40 -07:00
Steven Fackler
c56c286b10 Remove libworkcache
This was only ever used by rustpkg and is very unmaintained.

[breaking-change]
2014-05-30 23:44:05 -07:00
bors
92c43dba50 auto merge of #14544 : aturon/rust/issue-14352, r=alexcrichton
Adds a platform-specific function, `split_paths` to the `os` module. This
function can be used to parse PATH-like environment variables according to
local platform conventions.

Closes #14352.
2014-05-30 23:01:43 -07:00
Cameron Zwarich
3bc76d27ae Add a comment missing from 5aff0e7
For some reason, I had this comment in my local tree but not in the
branch I sent with the PR.
2014-05-30 22:31:05 -07:00
Jonathan Reem
1959925e51 Remove deprecated owned vector from tutorial. 2014-05-30 21:30:21 -07:00
Jonathan Reem
66ee71a517 Remove deprecated owned vector from rust.md 2014-05-30 21:30:21 -07:00
Jonathan Reem
f740e8dde1 Remove deprecated owned vector from macro guide. 2014-05-30 21:30:20 -07:00
Jonathan Reem
c3825cbb9d Remove deprecated owned vector from intro. 2014-05-30 21:30:20 -07:00
Jonathan Reem
0033a8b269 Remove deprecated owned vector from complement cheatsheet. 2014-05-30 21:30:18 -07:00
Tom Jakubowski
7cd4879126 Fix outgoing link to snappy in the FFI guide
Google have migrated snappy to GitHub.
2014-05-30 21:27:47 -07:00
bors
60a43f9bc5 auto merge of #14534 : alexcrichton/rust/snapshots, r=sfackler
This is part 2 of the saga of renaming the Partial/Total equality and comparison traits.
2014-05-30 21:21:39 -07:00
Aaron Turon
b1fbbf3e48 Add os::split_paths
Adds a platform-specific function, `split_paths` to the `os` module. This
function can be used to parse PATH-like environment variables according to
local platform conventions.

Closes #14352.
2014-05-30 21:10:48 -07:00