Commit Graph

54818 Commits

Author SHA1 Message Date
bors
3cc3ad11e6 Auto merge of #34819 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #34456, #34733, #34777, #34794, #34799, #34804, #34818
- Failed merges: #33951
2016-07-15 03:06:58 -07:00
Guillaume Gomez
8959374154 Rollup merge of #34818 - frewsxcv:vecdoc, r=GuillaumeGomez
Mention where `std::vec` structs originate from.

None
2016-07-15 10:56:43 +02:00
Guillaume Gomez
1544ebee28 Rollup merge of #34804 - GuillaumeGomez:fix_ret, r=steveklabnik
Add examples for FpCategory

Fixes #29364.

r? @steveklabnik
2016-07-15 10:56:43 +02:00
Guillaume Gomez
ca67437ec9 Rollup merge of #34799 - wuranbo:patch-3, r=steveklabnik
doc: ffi referenced rust-snappy can not compile

r? @steveklabnik

The referenced code https://github.com/thestinger/rust-snappy can not work. Maybe it's the old rust version? I do not know.
So I try to rewrite these test cases. If it is not what you originally meaning, just ignored it.
2016-07-15 10:56:43 +02:00
Guillaume Gomez
367f942ce4 Rollup merge of #34794 - frewsxcv:exitstatus-success, r=GuillaumeGomez
Add doc example for `std::process::ExitStatus::success`.

None
2016-07-15 10:56:43 +02:00
Guillaume Gomez
d607e284c8 Rollup merge of #34777 - glandium:issue34697, r=GuillaumeGomez
doc: Mention that writeln! and println! always use LF

Fixes #34697

I'm not really satisfied with the wording, but I didn't have a better idea. Suggestions welcome.
2016-07-15 10:56:42 +02:00
Guillaume Gomez
257b351ad1 Rollup merge of #34733 - izgzhen:alloc-arc-doc-improve, r=steveklabnik
Improve arc doc, fixing #32905

As issue #32905 detailed, I moved part of the module doc to the struct doc, and fixed some small places in the `alloc::arc`.
2016-07-15 10:56:42 +02:00
Guillaume Gomez
6f07b6ca4b Rollup merge of #34456 - tbu-:pr_ptr_null, r=aturon
Use `ptr::{null, null_mut}` instead of `0 as *{const, mut}`
2016-07-15 10:56:42 +02:00
bors
b6c1ef3745 Auto merge of #34801 - TimNN:rustbuild-doc-fixes, r=alexcrichton
rustbuild: doc fixes

This fixes two issues rustbuild currently has when building documentation:

1. It fixes standalone builds of `doc-test` and `doc-rustc`.
2. It actually builds the compiler docs if requested in the config.

Closes #34275.
2016-07-14 20:29:54 -07:00
Corey Farwell
cf21a7b52d Mention where std::vec structs originate from. 2016-07-14 20:32:09 -04:00
bors
3e15fcc55e Auto merge of #34599 - cuviper:unicode-9.0, r=alexcrichton
Update Unicode tables to 9.0

I just updated `unicode.py`'s generated copyright year, then ran it.
2016-07-14 17:29:16 -07:00
bors
e08a6c2068 Auto merge of #34797 - doomrobo:fix-import-trait-method, r=jseyfried
Fixed issue where importing a trait method directly and then calling the method causes a compiler panic

The code below triggers the panic, and is included in a new regression test.

```rust
trait Foo {
    fn foo();
}

use Foo::foo;

fn main() {
    foo();
}
```
The bug is caused by `librustc_resolve` allowing the illegal binding to be imported even after displaying the error message above.

The fix amounts to importing a dummy binding (`rustc::hir::def::Def::Err`) instead of the actual trait method.
2016-07-14 14:33:17 -07:00
bors
78d49bfac2 Auto merge of #34824 - alexcrichton:fix-nightlies, r=brson
test: Remove NOTE assertions from trace_macros-gate

If no NOTE assertions are present I believe they aren't asserted at all, and it
looks like the number of NOTEs differs on distcheck vs `make check`, so let's
just remove them all.

Closes #18154
2016-07-14 11:40:14 -07:00
Alex Crichton
b2d1f7ebae test: Remove NOTE assertions from trace_macros-gate
If no NOTE assertions are present I believe they aren't asserted at all, and it
looks like the number of NOTEs differs on distcheck vs `make check`, so let's
just remove them all.

Closes #18154
2016-07-14 10:27:56 -07:00
bors
fe5c439f69 Auto merge of #34783 - Dridi:cdylib_usage, r=alexcrichton
Mention the crate type cdylib in rustc's usage

Hello,

I just tried to build a `cdylib` with the latest stable release, I've been passively waiting for this for quite some time now. Tested successfully on my machine, although it doesn't appear in `rustc`'s usage it seems to work like a charm so far. 😀

Thanks!
2016-07-14 06:37:30 -07:00
bors
6998018bce Auto merge of #33907 - strake:decode_utf8, r=alexcrichton
add core::char::DecodeUtf8

See [issue](https://github.com/rust-lang/rust/issues/33906)
2016-07-14 02:45:29 -07:00
bors
3c85f414e9 Auto merge of #34805 - michaelwoerister:stable-bounds-encoding, r=eddyb
tyencode: Make sure that projection bounds are handled in stable order.

Fixes #34796.

r? @alexcrichton
2016-07-13 23:09:02 -07:00
bors
935bd76367 Auto merge of #34776 - cuviper:solaris-readdir, r=alexcrichton
std: fix `readdir` errors for solaris

A `NULL` from `readdir` could be the end of stream or an error.  The only
way to know is to check `errno`, so it must be set to a known value first,
like a 0 that POSIX will never use.

This currently only matters for solaris targets, as the other unix platforms
are using `readdir_r` with a direct error return indication.  However, this is
getting deprecated (#34668) so they should all eventually switch to `readdir`.

This PR adds `set_errno`, uses it to clear the value before calling `readdir`,
then checks it again after to see the reason for a `NULL`.  A few other small
fixes are included just to get solaris compiling at all.

I couldn't get cross-compilation completely going, so I don't have a good way
to test this beyond a smoke-test cargo build of std.  I'd appreciate input from
someone more familiar with solaris -- cc @nbaksalyar?
2016-07-13 19:32:17 -07:00
M Farkas-Dyck
837029fec1 add core::char::DecodeUtf8 2016-07-13 17:40:16 -08:00
bors
3dbbe2f716 Auto merge of #34684 - oli-obk:eval_rustdoc_array_len, r=alexcrichton
evaluate the array length of fixed size array types in rustdoc

mitgates #34579

to fix it we'd need an expression simplifier.

r? @steveklabnik

cc @Osspial
2016-07-13 16:27:30 -07:00
bors
db71987ee1 Auto merge of #33642 - xen0n:ergonomic-format-macro, r=alexcrichton
Ergonomic format_args!

Fixes #9456 (at last).

Not a ground-up rewrite of the existing machinery, but more like an added intermediary layer between macro arguments and format placeholders. This is now implementing Rust RFC 1618!
2016-07-13 13:26:57 -07:00
Wang Xuerui
51e54e57a4
syntax_ext: format: better code documentation 2016-07-14 03:10:47 +08:00
Wang Xuerui
03563b12e8
format: add tests for ergonomic format_args!
format: workaround pretty-printer to pass tests
2016-07-14 03:10:46 +08:00
Wang Xuerui
718099435b
syntax_ext: format: de-duplicate argument objects 2016-07-14 03:10:46 +08:00
Wang Xuerui
f457e6c3e0
syntax_ext: format: process counts uniquely and separately 2016-07-14 03:10:46 +08:00
Wang Xuerui
5e55a44116
syntax_ext: format: allow multiple formats for one argument
This commit removed the restriction of only allowing one type per argument.
This is achieved by adding mappings between macro arguments and format
placeholders, then taking the mapping into consideration when emitting
the Arguments expression.

syntax_ext: format: fix implicit positional arguments

syntax_ext: format: don't panic if no args given for implicit positional args

Check the list lengths before use.
Fixes regression of `compile-fail/macro-backtrace-println.rs`.

syntax_ext: format: also map CountIsParam indices to expanded args

syntax_ext: format: fix ICE in case of malformed format args
2016-07-14 03:10:45 +08:00
Wang Xuerui
eb5417bf12
syntax_ext: format: rename variants of ArgumentType for clarity 2016-07-14 03:10:45 +08:00
Wang Xuerui
1ace7f0d49
syntax_ext: format: resolve named arguments early
Converts named argument references into indices, right after
verification as suggested by @alexcrichton. This drastically simplifies
the whole process!
2016-07-14 03:10:44 +08:00
Wang Xuerui
0e2a96321a
syntax_ext: format: separate verification and translation of pieces 2016-07-14 02:55:33 +08:00
Wang Xuerui
06b034ae8b
format: remove all implicit ref handling outside of libfmt_macros
format: beautifully get rid of ArgumentNext and CountIsNextParam

Now that CountIsNextParam and ArgumentNext are resolved during parse,
the need for handling them outside of libfmt_macros is obviated.

Note: *one* instance of implicit reference handling still remains, and
that's for implementing `all_args_simple`. It's trivial enough though,
so in this case it may be tolerable.
2016-07-14 02:54:47 +08:00
Wang Xuerui
71949f3b0d
libfmt_macros: resolve all implicit refs while parsing 2016-07-14 02:44:55 +08:00
bors
0b7fb80e1c Auto merge of #34772 - jseyfried:cleanup_interner, r=eddyb
Start cleaning up the string interner

r? @eddyb
2016-07-13 10:26:18 -07:00
ggomez
6b58baa5c8 Add examples for FpCategory 2016-07-13 17:32:23 +02:00
bors
4a12a70a5c Auto merge of #34752 - ollie27:rustdoc_search, r=GuillaumeGomez
rustdoc: Fix methods in seach results

Currently methods from extern crates are sometimes added to the search
index when they shouldn't be or added with the original path rather than
the reexported path. This fixes that by making sure `cache().paths` only
contains local paths like the description for it states. It also fixes a
few minor issues with link rendering and redirect generation which would
point to local crate docs even if the docs for that crate hadn't been
generated.

Also a bug with methods implemented on traits which caused wrong paths and
so dead links in the search results has been fixed.

For example:
[before](https://doc.rust-lang.org/nightly/std/?search=is_disjoint) [after](https://ollie27.github.io/rust_doc_test/std/?search=is_disjoint)
[before](https://doc.rust-lang.org/nightly/std/?search=map_or) [after](https://ollie27.github.io/rust_doc_test/std/?search=map_or)
[before](https://doc.rust-lang.org/nightly/std/?search=unsafecell%3A%3Anew) [after](https://ollie27.github.io/rust_doc_test/std/?search=unsafecell%3A%3Anew)
[before](https://doc.rust-lang.org/nightly/std/?search=rng%3A%3Agen_) [after](https://ollie27.github.io/rust_doc_test/std/?search=rng%3A%3Agen_)
[before](https://doc.rust-lang.org/nightly/std/?search=downcast_ref) [after](https://ollie27.github.io/rust_doc_test/std/?search=downcast_ref)

Fixes #20246
2016-07-13 07:27:43 -07:00
Tim Neumann
3c0c663b0e build compiler docs if requested in config 2016-07-13 16:12:10 +02:00
吴冉波
db2649363b doc: ffi referenced rust-snappy can not compile
r? @steveklabnik

The referenced code https://github.com/thestinger/rust-snappy can not work. Maybe it's the old rust version? I do not know.
So I try to rewrite these test cases. If it is not what you originally meaning, just ignored it.
2016-07-13 21:53:27 +08:00
Tim Neumann
a2718217dc only remove directory if it exists 2016-07-13 15:15:28 +02:00
Tim Neumann
c346482a77 create global doc dir for all doc targets 2016-07-13 15:05:52 +02:00
bors
362b665bb2 Auto merge of #34608 - apasel422:ll, r=bluss
Replace `LinkedList`'s use of `Box` with `Shared`

Closes #34417
2016-07-13 04:31:30 -07:00
bors
2ab18ce6f7 Auto merge of #34660 - jseyfried:fix_parse_stmt, r=nrc
Fix bugs in macro-expanded statement parsing

Fixes #34543.

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => {
    println!("") println!("")
    //^ Semicolons are now required on macro-expanded non-braced macro invocations
    //| in statement positions.
    let x = 0
    //^ Semicolons are now required on macro-expanded `let` statements
    //| that are followed by more statements, so this would break.
    let y = 0 //< (this would still be allowed to reduce breakage in the wild)
}
fn main() { m!() }
```

r? @eddyb
2016-07-13 01:37:07 -07:00
Oliver Schneider
9d33ce58b1
evaluate the array length of fixed size array types in rustdoc 2016-07-13 10:35:58 +02:00
Michael Rosenberg
5a99d79857 Fixed issue where importing a trait method directly and then calling the method causes a compiler panic 2016-07-13 02:34:10 -04:00
bors
617039bff0 Auto merge of #34756 - habnabit:mutex-refunwindsafe, r=alexcrichton
Mutex and RwLock need RefUnwindSafe too

Incomplete, because I don't know what the appropriate stability annotation is here, but this is an attempt to bring the documentation for `std::panic` in line with reality. Right now, it says:

>Types like `&Mutex<T>`, however, are unwind safe because they implement poisoning by default.

But only `Mutex<T>`, not `&Mutex<T>`, is unwind-safe.
2016-07-12 22:43:31 -07:00
Jeffrey Seyfried
57fac56cb5 Start a best-effort warning cycle. 2016-07-13 04:50:35 +00:00
Jeffrey Seyfried
c1b850d304 cleanup: Refactor parser method finish_parsing_statement -> parse_full_stmt. 2016-07-13 04:49:32 +00:00
Jeffrey Seyfried
759b8a8e7d Allow macro-expanded macros in trailing expression positions to expand into statements:
```rust
macro_rules! m { () => { let x = 1; x } }
macro_rules! n { () => {
    m!() //< This can now expand into statements
}}
fn main() { n!(); }
```

and revert needless fallout fixes.
2016-07-13 04:49:32 +00:00
Jeffrey Seyfried
52d485fe0d Fix bug in the pretty printer. 2016-07-13 04:49:32 +00:00
bors
4bbb1c5c99 Auto merge of #34739 - therealbstern:ipv4unspec, r=alexcrichton
Mark Ipv4Addr is_unspecified as stable and provide reference.

Per [#27709 (comment)](https://github.com/rust-lang/rust/issues/27709#issuecomment-231280999), no RFC is needed here.

IPv4 "unspecified" has been defined in [Stevens], and has been part of the IPv4 stack for quite some time.  This property should become stable, since this use of 0.0.0.0 is not going anywhere.

[Stevens][_UNIX Network Programming Volume 1, Second Edition_.  Stevens, W. Richard.  Prentice-Hall, 1998.  p. 891]

Please let me know if I got the rustdoc wrong or something.  I tried to be as terse as possible while still conveying the appropriate information.

This also has a slight impact on PR #34694, but that one came first, so this shouldn't block it, IMO.
2016-07-12 19:11:02 -07:00
Corey Farwell
27e44edb4c Add doc example for std::process::ExitStatus::success. 2016-07-12 21:32:55 -04:00
bors
26fd0117f9 Auto merge of #34705 - alexcrichton:clean-deprecated, r=brson
std: Clean out deprecated APIs

This primarily removes a lot of `sync::Static*` APIs and rejiggers the
associated implementations. While doing this it was discovered that the
`is_poisoned` method can actually result in a data race for the Mutex/RwLock
primitives, so the inner `Cell<bool>` was changed to an `AtomicBool` to prevent
the associated data race. Otherwise the usage/gurantees should be the same
they were before.
2016-07-12 15:15:56 -07:00