Commit Graph

41074 Commits

Author SHA1 Message Date
Alex Crichton
179719d450 rustdoc: Allowing specifying attrs for doctests
This adds support in rustdoc to blanket apply crate attributes to all doc tests
for a crate at once. The syntax for doing this is:

    #![doc(test(attr(...)))]

Each meta item in `...` will be applied to each doctest as a crate attribute.

cc #18199
2015-04-07 17:54:34 -07:00
Alex Crichton
641bca06c8 rustdoc: Link "Trait Implementations" to sources
All methods listed in "Trait Implementations" now hyperlink to the source trait
instead of themselves, allowing easy browsing of the documentation of a trait
method.

Closes #17476
2015-04-07 17:54:34 -07:00
Alex Crichton
fcc89ea500 rustdoc: Only hide possibly private modules
If an empty public module has no documentation, it shouldn't emit a page that's
just a redirect loop to itself!

Closes #16265
2015-04-07 17:54:34 -07:00
Alex Crichton
c47bb7cd50 rustdoc: Add a test for fixed issue #16019
Closes #16019
2015-04-07 17:54:34 -07:00
Alex Crichton
a30f28edad rustdoc: Add a test for fixed issue #15347
Closes #15347
2015-04-07 17:54:34 -07:00
Alex Crichton
9ad133b4a1 rustdoc: Add a primitive page for raw pointers
Closes #15318
2015-04-07 17:54:33 -07:00
Alex Crichton
c9c7be78db mk: Pass the same flags to rustdoc as rustc
This ensures that def ids don't drift too much over time.

Closes #15309
2015-04-07 17:54:33 -07:00
Alex Crichton
29299d56c9 rustdoc: Add a test for #15169 2015-04-07 17:54:33 -07:00
Alex Crichton
458102eefa rustdoc: Run external traits through filters
This ensures that all external traits are run through the same filters that the
rest of the AST goes through, stripping hidden function as necessary.

Closes #13698
2015-04-07 17:54:33 -07:00
Alex Crichton
d3647fe815 test: Move all run-make rustdoc tests to test/rustdoc 2015-04-07 17:54:33 -07:00
Alex Crichton
10359de405 compiletest: Add support for running rustdoc tests
Add a new test directory called 'rustdoc' where all files inside are documented
and run against the `htmldocck` script to have assertions about the output.
2015-04-07 17:54:33 -07:00
bors
dd6c4a8f15 Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichton
Previously it could not be implemented for types outside `libcore/iter.rs` due
to coherence issues.
2015-04-08 00:42:10 +00:00
Dave Huseby
5c3aa01045 disabling a test that is failing on bitrig. 2015-04-07 17:07:20 -07:00
Steve Klabnik
f354c8a580 New TOC 2015-04-07 19:44:49 -04:00
Aaron Turon
dddcbcfeac Fix range performance regression
A recent change to the implementation of range iterators meant that,
even when stepping by 1, the iterators *always* involved checked
arithmetic.

This commit reverts to the earlier behavior (while retaining the
refactoring into traits).

Fixes #24095
cc #24014
2015-04-07 16:20:55 -07:00
Tobias Bucher
97f24a8596 Make sum and product inherent methods on Iterator
In addition to being nicer, this also allows you to use `sum` and `product` for
iterators yielding custom types aside from the standard integers.

Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this
is a breaking change.

[breaking-change]
2015-04-08 00:26:35 +02:00
Ralph Giles
9a51c63a2f rustup: let RUSTUP_PREFIX env override default prefix.
The idea here is if you don't want rust in /usr/local
you can put something like this is your .profile:

export RUSTUP_PREFIX=$HOME/.local/rust
export PATH=$PATH:${RUSTUP_PREFIX}/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${RUSTUP_PREFIX}/lib

Then when you run rustup, it will update the install
in ${RUSTUP_PREFIX} without having to remember to pass
an explicit --prefix argument every time.
2015-04-07 14:05:02 -07:00
Hajime Morrita
334422184e Fix a typo 2015-04-07 13:19:17 -07:00
bors
d9146bf8ba Auto merge of #24169 - Manishearth:rollup, r=Manishearth
- Successful merges: #24132, #24139, #24147, #24148, #24150, #24166
- Failed merges:
2015-04-07 19:49:59 +00:00
Manish Goregaokar
4e067f5273 Rollup merge of #24166 - lgvz:email, r=steveklabnik 2015-04-08 01:19:38 +05:30
Manish Goregaokar
c4bd1c2bb2 Rollup merge of #24150 - wg:master, r=alexcrichton
This fix allows the gdb debuginfo tests to pass on FreeBSD when using the newer 7.8 package.
2015-04-08 01:19:38 +05:30
Manish Goregaokar
fe2cff74f4 Rollup merge of #24148 - xfq:patch-2, r=steveklabnik
People use programming language *implementations* like Ruby MRI, CPython, and SpiderMonkey for executing programs.
2015-04-08 01:19:38 +05:30
Manish Goregaokar
2b34643638 Rollup merge of #24147 - lstat:needstest-22560, r=alexcrichton
Closes #22560
2015-04-08 01:19:38 +05:30
Manish Goregaokar
6295406d9f Rollup merge of #24139 - xfq:patch-1, r=steveklabnik
Use HTTPS where possible to avoid plaintext HTTP connections.
2015-04-08 01:19:37 +05:30
Manish Goregaokar
7b2e11844a Rollup merge of #24132 - kwantam:master, r=alexcrichton
@mahkoh points out in #15628 that unicode.py does not use
normative data for Grapheme classes. This pr fixes that issue,
and does some minor cleanup of the unicode.py script.

In addition, GC_RegionalIndicator is renamed GC_Regional_Indicator
in order to stay in line with the Unicode class name definitions.
I have updated refs in u_str.rs, and verified that there are no
refs elsewhere in the codebase. However, in principle someone
using the unicode tables for their own purposes might see breakage
from this.
2015-04-08 01:19:37 +05:30
Łukasz Niemier
4695bf0705 Remove another invalid example 2015-04-07 21:46:14 +02:00
Kevin Ballard
df95719391 Add Clone impls for extern "C" and unsafe fns
We only implemented Clone on `extern "Rust" fn`s (for up to 8
parameters). This didn't cover `extern "C"` or `unsafe` (or `unsafe
extern "C"`) `fn`s, but there's no reason why they shouldn't be
cloneable as well.

The new impls are marked unstable because the existing impl for `extern
"Rust" fn`s is.

Fixes #24161.
2015-04-07 12:39:25 -07:00
Łukasz Niemier
4cf59304c1 Remove incorrect example from docs 2015-04-07 20:35:54 +02:00
Tero Hänninen
f728e39572 Change my email 2015-04-07 21:21:46 +03:00
Michael Sproul
039a553998 Add more extended error messages for match exprs. 2015-04-07 11:16:32 -07:00
bors
1fd89b625b Auto merge of #24156 - Manishearth:rollup, r=Manishearth 2015-04-07 16:44:11 +00:00
Manish Goregaokar
ae64d8e415 doc ignore (fixup #24059) 2015-04-07 22:10:55 +05:30
Seo Sanghyeon
d18b405faf Check casts from fat pointer 2015-04-08 00:45:57 +09:00
Christopher Chambers
19343860aa Improves handling of statement macros.
Statement macros are now treated somewhat like item macros, in that a
statement macro can now expand into a series of statements, rather than
just a single statement.

This allows statement macros to be nested inside other kinds of macros and
expand properly, where previously the expansion would only work when no
nesting was present.

See: src/test/run-pass/macro-stmt_macro_in_expr_macro.rs
     src/test/run-pass/macro-nested_stmt_macro.rs

This changes the interface of the MacResult trait.  make_stmt has become
make_stmts and now returns a vector, rather than a single item.  Plugin
writers who were implementing MacResult will have breakage, as well as
anyone using MacEager::stmt.

See: src/libsyntax/ext/base.rs

This also causes a minor difference in behavior to the diagnostics
produced by certain malformed macros.

See: src/test/compile-fail/macro-incomplete-parse.rs
2015-04-07 09:29:05 -05:00
Seo Sanghyeon
f4c2228be0 Check casts from float 2015-04-07 22:49:43 +09:00
Manish Goregaokar
b3bcbb1a22 Rollup merge of #24113 - mbrubeck:doc-edit, r=steveklabnik
* Fix broken \"module-level documentation\" link on the [`trait Any` docs](http://doc.rust-lang.org/std/any/trait.Any.html) and related broken markup on the [`std::any` docs](http://doc.rust-lang.org/std/any/index.html).

* Remove an outdated or incorrect notice in the `BufRead::lines` docs. There is no such `read_string` function, and `lines` never returns an error.

r? @steveklabnik
2015-04-07 18:13:24 +05:30
Manish Goregaokar
322e4a18e3 Rollup merge of #24112 - joshtriplett:patch-1, r=steveklabnik
traits.md said:

If we add a `use` line right above `main` and make the right things public,
everything is fine:

However, the use line was actually placed at the top of the file instead.  Move
the use line to right above main.  That also makes the example more evocative
of cases where the module is defined in a separate file.
2015-04-07 18:13:12 +05:30
Manish Goregaokar
6efb8352e8 Rollup merge of #24110 - tbu-:pr_doc_fix_add, r=alexcrichton 2015-04-07 18:13:04 +05:30
Manish Goregaokar
50cb31f0e7 Rollup merge of #24088 - GuillaumeGomez:patch-1, r=alexcrichton
Fixes #24060.
2015-04-07 18:12:55 +05:30
Manish Goregaokar
6f852f5620 Rollup merge of #24059 - nikomatsakis:issue-22914-phantomdata-docs, r=huon
This probably needs a bit more work, but I wanted to try and capture some common use cases and be a bit more helpful.

r? @huonw
cc @steveklabnik
2015-04-07 18:12:47 +05:30
Manish Goregaokar
daf2e365cf Rollup merge of #24057 - nikomatsakis:lifetime-shadowing-hard-error, r=huon 2015-04-07 18:12:40 +05:30
Manish Goregaokar
4faf0befaa Rollup merge of #24042 - callahad:bug_24030, r=steveklabnik
Fixes #24030

Of the four code samples with modules in TRPL:

    - 2 use `mod test`
    - 2 use `mod tests`

We should be consistent here, but which is right? The stdlib is split:

    $ grep -r 'mod tests {' src/lib* | wc -l
          63
    $ grep -r 'mod test {'  src/lib* | wc -l
          58

Subjectively, I like the plural, but both the language reference and the
style guide recommend the singular. So we'll go with that here, for now.

r? @steveklabnik
2015-04-07 18:12:32 +05:30
Manish Goregaokar
4dd6edda9c Rollup merge of #23277 - aochagavia:intro, r=steveklabnik
cc @steveklabnik
2015-04-07 18:12:22 +05:30
Seo Sanghyeon
da7529afa6 Split check_cast to a separate file 2015-04-07 21:05:22 +09:00
Luke Gallagher
6f9ec0615c Add ignore-tidy-linelength and fix formatting 2015-04-07 21:43:12 +10:00
Will
fc2494b80c Fix charset of debuginfo test on FreeBSD 2015-04-07 20:41:34 +09:00
bors
b41f2df4ca Auto merge of #23277 - aochagavia:intro, r=steveklabnik
cc @steveklabnik
2015-04-07 11:34:38 +00:00
Xue Fuqiao
6eea4266ec Update hello-world.md
People use programming language *implementations* like Ruby MRI, CPython, and SpiderMonkey for executing programs.
2015-04-07 18:07:10 +08:00
Luke Gallagher
7eb723d794 Add test for #22560
Closes #22560
2015-04-07 18:00:39 +10:00
bors
de51bbec15 Auto merge of #24116 - zaeleus:rustdoc-codespan, r=alexcrichton
Because the current style for `code` in rustdoc is to prewrap whitespace, code spans that are hard wrapped in the source documentation are prematurely wrapped when rendered in HTML. [For example][2],

```
/// ...
/// type can be borrowed as multiple different types. In particular, `Vec<T>:
/// Borrow<Vec<T>>` and `Vec<T>: Borrow<[T]>`.
```

renders as

![screen shot 2015-04-06 at 12 11 21](https://cloud.githubusercontent.com/assets/191331/7008216/2706b3b0-dc56-11e4-941e-1b0154fcbc5c.png)

because "`Vec<T>: Borrow<Vec<T>>`" wraps to the next line in the source.

CommonMark 0.18 [[1]] specifies "interior spaces and line endings are collapsed into single spaces" for code spans, which would actually prevent this issue, but hoedown does not currently conform to the
CommonMark spec.

The added span-level callback attempts to adhere to how whitespace is handled as described by CommonMark, fixing the issue of early, unintentional wrapping of code spans in rendered HTML.

[1]: http://spec.commonmark.org/0.18/
[2]: https://doc.rust-lang.org/std/borrow/trait.Borrow.html
2015-04-07 07:41:32 +00:00