Commit Graph

346 Commits

Author SHA1 Message Date
Alex Crichton
d505f70f6f rustdoc: Stop ignoring dox on fields/variants
This is progress towards #9611
2013-09-30 20:31:20 -07:00
Alex Crichton
fb259855dc rustdoc: Use a BufferedWriter when emitting source
This takes the rendering time of source files for libstd from 12.5s to 0.1s,
turns out write! calls the write function *a lot*
2013-09-30 20:31:20 -07:00
Alex Crichton
cc1791584f rustdoc: Detect repeated keys and fix width
When a key is pressed and held, this now does the OS-style repeating after a bit
of a pause. Also fixes the width of search results to be correct (was changed
beforehand and didn't catch this).
2013-09-30 20:31:19 -07:00
Alex Crichton
863555f4fd rustdoc: Update the man page
Closes #9622
2013-09-30 20:31:19 -07:00
Alex Crichton
e523f99fb9 rustdoc: Add the ability to input json
This modifies the command-line usage of rustdoc to intake its own JSON output as
well as a rust source file. This also alters the command line from
`rustdoc input file`  to `rustdoc file` with the input/output formats specified
as -r and -w, respectively.

When using a JSON input, no passes or plugins are re-run over the json, instead
the output is generated directly from the JSON that was provided. Passes and
plugins are still run on rust source input, however.
2013-09-30 20:31:19 -07:00
Alex Crichton
a3ccbdc904 rustdoc: Generate valid code for struct-variants
Closes #9587
2013-09-30 12:32:04 -07:00
Alex Crichton
7b18976f08 Remove all usage of @ast::Crate 2013-09-29 16:21:25 -07:00
bors
9cc11ca6a3 auto merge of #9577 : alexcrichton/rust/rustdoc, r=cmr
They're getting smaller each time though!

The highlight of this round is source files in documentation. Still trying to figure out the best syntax-highlighting solution.
2013-09-28 13:46:11 -07:00
Alex Crichton
88866a4c20 rustdoc: Show type parameters on external paths
This removes the internal type representation of an `External` type and instead
relies on passing around DefId structures and interpreting them accordingly.

Progress on #9539, but there's still the problem of a crate => url mapping.
2013-09-28 13:43:43 -07:00
blake2-ppc
3709aa78d8 std::vec: Remove functions concat, connect
std::vec::{concat, connect, concat_slices, connect_slices} are replaced
by the already existing trait methods .concat_vec() and .connect_vec().
2013-09-28 05:56:49 +02:00
Alex Crichton
dd8d565083 rustdoc: Include source files with documentation
All items have source links back to their actual code. Source files can be
omitted with the doc(html_no_source) attribute on the crate. Currently there is
no syntax highlighting, but that will come with syntax highlighting with all
other snippets.

Closes #2072
2013-09-27 16:54:19 -07:00
bors
67394f20eb auto merge of #9552 : brson/rust/0.9-pre, r=alexcrichton 2013-09-27 13:51:07 -07:00
Alex Crichton
b93678eca5 rustdoc: Fix search for something on the same page 2013-09-27 11:06:07 -07:00
Alex Crichton
a925762c3b rustdoc: Fix searching for default methods
Closes #9566
2013-09-27 10:45:09 -07:00
Alex Crichton
c5e03bec4d rustdoc: Don't emit redirect pages for variants/fields
It's just a waste of disk space and it can be done just as well in JS.
2013-09-27 10:40:41 -07:00
bors
78c3fac852 auto merge of #9535 : alexcrichton/rust/no-format-default, r=thestinger
As mentioned in #9456, the format! syntax extension would previously consider an
empty format as a 'Unknown' format which could then also get coerced into a
different style of format on another argument.

This is unusual behavior because `{}` is a very common format and if you have
`{0} {0:?}` you wouldn't expect them both to be coereced to the `Poly`
formatter. This commit removes this coercion, but still retains the requirement
that each argument has exactly one format specified for it (an empty format now
counts as well).

Perhaps at a later date we can add support for multiple formats of one argument,
but this puts us in at least a backwards-compatible situation if we decide to do
that.
2013-09-27 09:41:07 -07:00
Alex Crichton
b74663e027 Remove the notion of an "unknown format"
As mentioned in #9456, the format! syntax extension would previously consider an
empty format as a 'Unknown' format which could then also get coerced into a
different style of format on another argument.

This is unusual behavior because `{}` is a very common format and if you have
`{0} {0:?}` you wouldn't expect them both to be coereced to the `Poly`
formatter. This commit removes this coercion, but still retains the requirement
that each argument has exactly one format specified for it (an empty format now
counts as well).

Perhaps at a later date we can add support for multiple formats of one argument,
but this puts us in at least a backwards-compatible situation if we decide to do
that.
2013-09-27 09:39:05 -07:00
Brian Anderson
99c1fb8c66 Update version numbers to 0.9-pre 2013-09-26 18:18:42 -07:00
Alex Crichton
42bcf638b0 rustdoc: Render stability attributes
Closes #8965
2013-09-26 13:39:06 -07:00
Alex Crichton
6a277dc4ba rustdoc: Strip implementations of private traits
Closes #5416
2013-09-26 12:27:38 -07:00
Alex Crichton
ca697d3705 rustdoc: Generate documentation for foreign items
This slurps up everything inside of an 'extern' block into the enclosing module
in order to document them. The documentation must be on the items themselves,
and they'll show up next to everything else on the module index pages.

Closes #5953
2013-09-26 11:57:25 -07:00
Alex Crichton
c429c7c04b rustdoc: Fix broken struct field search links
Takes the same approach as variants, writes a redirect index page back to the
struct with an anchor to the field in question.

Closes #9524
2013-09-26 11:31:40 -07:00
Alex Crichton
3d5873fa42 rustdoc: Fix merge fallout 2013-09-25 14:28:20 -07:00
Alex Crichton
38eab97d16 rustdoc: Fix an unindentation bug when collapsing
Turns out eagerly trimming comes back to bite you :(
2013-09-25 14:27:43 -07:00
Alex Crichton
bcb8657842 rustdoc: Collapse before unindenting
Doesn't make much sense to unindent each line individually and *then* collapse
them all together.
2013-09-25 14:27:43 -07:00
Alex Crichton
e7fa081c18 rustdoc: Reduce ambiguity with clean::Type
The "Unresolved" variant could be completely removed becuase it turns out that
the interim state only very briefly lives.
2013-09-25 14:27:43 -07:00
Alex Crichton
f648690234 rustdoc: Strip hidden docs by default. 2013-09-25 14:27:43 -07:00
Alex Crichton
c4219a4783 rustdoc: Highlight function names
Closes #9460
2013-09-25 14:27:42 -07:00
Alex Crichton
5636ca625e rustdoc: Start rendering variants (redirect to enum)
This allows reasonable behavior when an enum is clicked in an import.
2013-09-25 14:27:42 -07:00
Alex Crichton
5c6f8a976f rustdoc: Linkify all reexports.
This way each component of a reexport path is click-able to the destination that
it's referencing.
2013-09-25 14:27:42 -07:00
Alex Crichton
c838351ba6 rustdoc: Implement stripping based on privacy
This will probably need to get tweaked once the privacy rules have been fully
agreed on, but for now this has all of the infrastructure necessary for
filtering out private items.

Closes #9410
2013-09-25 14:27:42 -07:00
Alex Crichton
acab4a8c8e rustdoc: Emit purity to function dox for traits
Closes #3804
2013-09-25 14:27:42 -07:00
Alex Crichton
eaaf2bd41f rustdoc: Add the ability to list all passes
In doing so, also remove the collapse-privacy pass because it's a little
over-zealous and may not be right 100% of the time (not used right now as well)
2013-09-25 14:27:42 -07:00
Alex Crichton
35c0cdff5a rustdoc: Enable various useful markdown extensions 2013-09-25 14:27:42 -07:00
Alex Crichton
db28c29980 rustdoc: Use sundown for markdown highlighting
This takes rendering times of documentation down from 30s to 0.5s. Kinda sad
that none of the parallelism is needed, but oh well!

Closes #7380
cc #3546
2013-09-25 14:27:42 -07:00
Brian Anderson
6d03897376 Don't use libc::exit. #9473
This can cause unexpected errors in the runtime when done while
scheduler threads are still initializing. Required some restructuring
of the main_args functions in our libraries.
2013-09-24 16:34:23 -07:00
Patrick Walton
d126be068b librustpkg: Fix diagnostic invocation syntax in librustdoc, librusti, and librustpkg. 2013-09-23 18:23:20 -07:00
Alex Crichton
83499d1a89 Place *all* rustdoc output in doc/{crate} 2013-09-22 20:09:42 -07:00
Alex Crichton
7b24efd6f3 rustdoc: Out with the old, in with the new
Removes old rustdoc, moves rustdoc_ng into its place instead (plus drops the _ng
suffix). Also shreds all reference to rustdoc_ng from the Makefile rules.
2013-09-22 09:51:15 -07:00
Brian Anderson
695cb9fc2b Update version numbers to 0.8 2013-09-21 16:25:08 -07:00
bors
e5fdc7dee5 auto merge of #9320 : chris-morgan/rust/unreachable-macro-part-two-of-two-containing-the-destruction-of-the-unreachable-function, r=alexcrichton
This is the second of two parts of #8991, now possible as a new snapshot
has been made. (The first part implemented the unreachable!() macro; it
was #8992, 6b7b8f2682.)

``std::util::unreachable()`` is removed summarily; any code which used
it should now use the ``unreachable!()`` macro.

Closes #9312.

Closes #8991.
2013-09-20 00:36:11 -07:00
Steven Fackler
ff85389344 Modernize extra::future API 2013-09-19 15:19:20 -07:00
Marvin Löbel
06d1dccf95 Turned extra::getopts functions into methods
Some minor api and doc adjustments
2013-09-19 12:32:18 +02:00
Chris Morgan
e2807a4565 Replace unreachable() calls with unreachable!().
This is the second of two parts of #8991, now possible as a new snapshot
has been made. (The first part implemented the unreachable!() macro; it
was #8992, 6b7b8f2682.)

``std::util::unreachable()`` is removed summarily; any code which used
it should now use the ``unreachable!()`` macro.

Closes #9312.

Closes #8991.
2013-09-19 15:04:03 +10:00
Daniel Micay
4e161a4d40 switch Drop to &mut self 2013-09-16 22:19:23 -04:00
Erick Tryzelaar
38f97ea103 std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else} 2013-09-12 18:54:13 -07:00
Erick Tryzelaar
45c62c08f9 std: rename Option::unwrap_or_default() to unwrap_or() 2013-09-12 18:54:11 -07:00
bors
753d8c226c auto merge of #9088 : nikomatsakis/rust/issue-6304-AST-tree-not-DAG, r=catamorphism
Ensures that each AST node has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two
representative tests.

Fixes #7971
Fixes #6304
Fixes #8367
Fixes #8754
Fixes #8852
Fixes #2543
Fixes #7654
2013-09-10 03:10:59 -07:00
Niko Matsakis
a5ad4c3794 Delay assignment of node ids until after expansion. Ensures that each AST node
has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two
representative tests.

Fixes #7971
Fixes #6304
Fixes #8367
Fixes #8754
Fixes #8852
Fixes #2543
Fixes #7654
2013-09-10 05:45:12 -04:00
blake2-ppc
6212729315 std::vec: Change fn unzip to take an iterator argument
Remove unzip_slice since it's redundant. Old unzip is equivalent to the
`|x| unzip(x.move_iter())`
2013-09-10 05:39:59 +02:00