]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #34849 - tshepang:patch-2, r=apasel422
Guillaume Gomez [Sat, 16 Jul 2016 14:55:59 +0000 (16:55 +0200)]
Rollup merge of #34849 - tshepang:patch-2, r=apasel422

doc: remove extraneous word

8 years agoRollup merge of #34848 - tshepang:patch-1, r=apasel422
Guillaume Gomez [Sat, 16 Jul 2016 14:55:59 +0000 (16:55 +0200)]
Rollup merge of #34848 - tshepang:patch-1, r=apasel422

doc: remove stray comma

8 years agoRollup merge of #34847 - baskerville:unwanted-tag, r=apasel422
Guillaume Gomez [Sat, 16 Jul 2016 14:55:59 +0000 (16:55 +0200)]
Rollup merge of #34847 - baskerville:unwanted-tag, r=apasel422

Add missing inline code delimiters around Vec<T>

r? @steveklabnik

8 years agoRollup merge of #34838 - steveklabnik:gh33677, r=alexcrichton
Guillaume Gomez [Sat, 16 Jul 2016 14:55:59 +0000 (16:55 +0200)]
Rollup merge of #34838 - steveklabnik:gh33677, r=alexcrichton

Fix up documentation around no_std

1. Fix the sections in the book to have the correct signatures. I've
   also marked them as `ignore`; there's no way to set the `no_std`
   feature for libc, so it pulls in the stdlib, so this wasn't even
   testing the actual thing it was testing. Better to just ignore.
2. Correcting libcore's docs for factual inaccuracy, and add a note
   about language items.

Fixes #33677

r? @alexcrichton

8 years agoRollup merge of #34837 - GuillaumeGomez:better_example, r=nagisa
Guillaume Gomez [Sat, 16 Jul 2016 14:55:59 +0000 (16:55 +0200)]
Rollup merge of #34837 - GuillaumeGomez:better_example, r=nagisa

Improve float number example

r? @nagisa

8 years agoRollup merge of #34768 - alexcrichton:issue-audit, r=aturon
Guillaume Gomez [Sat, 16 Jul 2016 14:55:58 +0000 (16:55 +0200)]
Rollup merge of #34768 - alexcrichton:issue-audit, r=aturon

std: Correct tracking issue for SipHash{13,24}

The referenced tracking issue was closed and was actually about changing the
algorithm.

cc #34767

8 years agoRollup merge of #33362 - andradei:master, r=Manishearth
Guillaume Gomez [Sat, 16 Jul 2016 14:55:57 +0000 (16:55 +0200)]
Rollup merge of #33362 - andradei:master, r=Manishearth

Add mention to RFC 940 in the Rust Reference.

This PR adds a mention to hyphens in Cargo package names being replaced by underscores when used as a crate, as per [RFC 940](https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md)

It also formats the RFCs consistently as RFC XXX instead of RFCXXX.

8 years agodoc: remove extraneous word
Tshepang Lekhonkhobe [Sat, 16 Jul 2016 09:13:29 +0000 (11:13 +0200)]
doc: remove extraneous word

8 years agodoc: remove stray comma
Tshepang Lekhonkhobe [Sat, 16 Jul 2016 09:10:05 +0000 (11:10 +0200)]
doc: remove stray comma

8 years agoAdd missing inline code delimiters around Vec<T>
Bastien Dejean [Sat, 16 Jul 2016 08:50:19 +0000 (10:50 +0200)]
Add missing inline code delimiters around Vec<T>

8 years agoAuto merge of #34779 - infinity0:master, r=alexcrichton
bors [Sat, 16 Jul 2016 08:19:16 +0000 (01:19 -0700)]
Auto merge of #34779 - infinity0:master, r=alexcrichton

If local-rust is the same as the current version, then force a local-rebuild

In Debian, we would like the option to build/rebuild the current release from
*either* the current or previous stable release. So we use enable-local-rust
instead of enable-local-rebuild, and read the bootstrap key dynamically from
whatever is installed locally.

In general, it does not make much sense to allow enable-local-rust without also
setting the bootstrap key, since the build would fail otherwise.

(The way I detect "the bootstrap key of [the local] rustc installation" is a bit hacky, suggestions welcome.)

8 years agoAuto merge of #34676 - aravind-pg:inner-attr, r=brson
bors [Sat, 16 Jul 2016 05:21:40 +0000 (22:21 -0700)]
Auto merge of #34676 - aravind-pg:inner-attr, r=brson

Better error message for inner attribute following doc comment

Before it was always just "an inner attribute is not permitted in this context", whereas now we add a special case for when an inner attr follows an outer attr. If the outer attr is a doc comment, then the error is "an inner attr is not permitted following a doc comment", and otherwise it's "an inner attr is not permitted following an outer attribute". In all other cases it's still  "an inner attribute is not permitted in this context".

Note that the public API and behaviour of `parse_attribute` is unchanged. Also, all new names are very open to bikeshedding -- they're arguably clunky.

Fixes #34516. cc @brson

8 years agosyntax: Better error message for inner attr following doc comment
Aravind Gollakota [Wed, 6 Jul 2016 04:35:12 +0000 (21:35 -0700)]
syntax: Better error message for inner attr following doc comment

8 years agoAuto merge of #34841 - alexcrichton:no-mips-soft-float, r=brson
bors [Sat, 16 Jul 2016 00:36:22 +0000 (17:36 -0700)]
Auto merge of #34841 - alexcrichton:no-mips-soft-float, r=brson

mk: Don't pass -msoft-float on mips-gnu

Soon the LLVM upgrade (#34743) will require an updated CMake installation, and
the easiest way to do this was to upgrade the Ubuntu version of the bots to
16.04. This in turn brings in a new MIPS compiler on the linux-cross builder,
which is now from the "official" ubuntu repositories. Unfortunately these
new compilers don't support compiling with the `-msoft-float` flag like we're
currently passing, causing compiles to fail.

This commit removes these flags as it's not clear *why* they're being passed, as
the mipsel targets also don't have it. At least if it's not supported by a
debian default compiler, perhaps it's not too relevant to support?

8 years agomk: Don't pass -msoft-float on mips-gnu
Alex Crichton [Fri, 15 Jul 2016 04:48:41 +0000 (21:48 -0700)]
mk: Don't pass -msoft-float on mips-gnu

Soon the LLVM upgrade (#34743) will require an updated CMake installation, and
the easiest way to do this was to upgrade the Ubuntu version of the bots to
16.04. This in turn brings in a new MIPS compiler on the linux-cross builder,
which is now from the "official" ubuntu repositories. Unfortunately these
new compilers don't support compiling with the `-msoft-float` flag like we're
currently passing, causing compiles to fail.

This commit removes these flags as it's not clear *why* they're being passed, as
the mipsel targets also don't have it. At least if it's not supported by a
debian default compiler, perhaps it's not too relevant to support?

8 years agoFix up documentation around no_std
Steve Klabnik [Fri, 15 Jul 2016 17:17:35 +0000 (13:17 -0400)]
Fix up documentation around no_std

1. Fix the sections in the book to have the correct signatures. I've
   also marked them as `ignore`; there's no way to set the `no_std`
   feature for libc, so it pulls in the stdlib, so this wasn't even
   testing the actual thing it was testing. Better to just ignore.
2. Correcting libcore's docs for factual inaccuracy, and add a note
   about language items.

Fixes #33677

8 years agorustbuild: If local-rust is the same as the current version, then force a local-rebuild
Ximin Luo [Thu, 14 Jul 2016 17:39:55 +0000 (19:39 +0200)]
rustbuild: If local-rust is the same as the current version, then force a local-rebuild

8 years agomk: If local-rust is the same as the current version, then force a local-rebuild
Ximin Luo [Thu, 14 Jul 2016 17:32:53 +0000 (19:32 +0200)]
mk: If local-rust is the same as the current version, then force a local-rebuild

8 years agoImprove float number example
Guillaume Gomez [Fri, 15 Jul 2016 15:51:27 +0000 (17:51 +0200)]
Improve float number example

8 years agoAuto merge of #34570 - jseyfried:no_rename, r=nrc
bors [Fri, 15 Jul 2016 15:48:41 +0000 (08:48 -0700)]
Auto merge of #34570 - jseyfried:no_rename, r=nrc

Simplify the macro hygiene algorithm

This PR removes renaming from the hygiene algorithm and treats differently marked identifiers as unequal.

This change makes the scope of identifiers in `macro_rules!` items empty. That is, identifiers in `macro_rules!` definitions do not inherit any semantics from the `macro_rules!`'s scope.

Since `macro_rules!` macros are items, the scope of their identifiers "should" be the same as that of other items; in particular, the scope should contain only items. Since all items are unhygienic today, this would mean the scope should be empty.

However, the scope of an identifier in a `macro_rules!` statement today is the scope that the identifier would have if it replaced the `macro_rules!` (excluding anything unhygienic, i.e. locals only).

To continue to support this, this PR tracks the scope of each `macro_rules!` and uses it in `resolve` to ensure that an identifier expanded from a `macro_rules!` gets a chance to resolve to the locals in the `macro_rules!`'s scope.

This PR is a pure refactoring. After this PR,
 - `syntax::ext::expand` is much simpler.
 - We can expand macros in any order without causing problems for hygiene (needed for macro modularization).
 - We can deprecate or remove today's `macro_rules!` scope easily.
 - Expansion performance improves by 25%, post-expansion memory usage decreases by ~5%.
 - Expanding a block is no longer quadratic in the number of `let` statements (fixes #10607).

r? @nrc

8 years agoAuto merge of #34819 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 15 Jul 2016 10:06:58 +0000 (03:06 -0700)]
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

8 years agoRollup merge of #34818 - frewsxcv:vecdoc, r=GuillaumeGomez
Guillaume Gomez [Fri, 15 Jul 2016 08:56:43 +0000 (10:56 +0200)]
Rollup merge of #34818 - frewsxcv:vecdoc, r=GuillaumeGomez

Mention where `std::vec` structs originate from.

None

8 years agoRollup merge of #34804 - GuillaumeGomez:fix_ret, r=steveklabnik
Guillaume Gomez [Fri, 15 Jul 2016 08:56:43 +0000 (10:56 +0200)]
Rollup merge of #34804 - GuillaumeGomez:fix_ret, r=steveklabnik

Add examples for FpCategory

Fixes #29364.

r? @steveklabnik

8 years agoRollup merge of #34799 - wuranbo:patch-3, r=steveklabnik
Guillaume Gomez [Fri, 15 Jul 2016 08:56:43 +0000 (10:56 +0200)]
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.

8 years agoRollup merge of #34794 - frewsxcv:exitstatus-success, r=GuillaumeGomez
Guillaume Gomez [Fri, 15 Jul 2016 08:56:43 +0000 (10:56 +0200)]
Rollup merge of #34794 - frewsxcv:exitstatus-success, r=GuillaumeGomez

Add doc example for `std::process::ExitStatus::success`.

None

8 years agoRollup merge of #34777 - glandium:issue34697, r=GuillaumeGomez
Guillaume Gomez [Fri, 15 Jul 2016 08:56:42 +0000 (10:56 +0200)]
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.

8 years agoRollup merge of #34733 - izgzhen:alloc-arc-doc-improve, r=steveklabnik
Guillaume Gomez [Fri, 15 Jul 2016 08:56:42 +0000 (10:56 +0200)]
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`.

8 years agoRollup merge of #34456 - tbu-:pr_ptr_null, r=aturon
Guillaume Gomez [Fri, 15 Jul 2016 08:56:42 +0000 (10:56 +0200)]
Rollup merge of #34456 - tbu-:pr_ptr_null, r=aturon

Use `ptr::{null, null_mut}` instead of `0 as *{const, mut}`

8 years agoAdd labels hygiene test
Jeffrey Seyfried [Fri, 15 Jul 2016 05:23:55 +0000 (05:23 +0000)]
Add labels hygiene test

8 years agoInclude the `MacroDefinition` rib in the label ribs.
Jeffrey Seyfried [Fri, 15 Jul 2016 05:14:48 +0000 (05:14 +0000)]
Include the `MacroDefinition` rib in the label ribs.

8 years agoAuto merge of #34801 - TimNN:rustbuild-doc-fixes, r=alexcrichton
bors [Fri, 15 Jul 2016 03:29:54 +0000 (20:29 -0700)]
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.

8 years agoMention where `std::vec` structs originate from.
Corey Farwell [Thu, 14 Jul 2016 13:34:43 +0000 (09:34 -0400)]
Mention where `std::vec` structs originate from.

8 years agoAuto merge of #34599 - cuviper:unicode-9.0, r=alexcrichton
bors [Fri, 15 Jul 2016 00:29:16 +0000 (17:29 -0700)]
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.

8 years agoAuto merge of #34797 - doomrobo:fix-import-trait-method, r=jseyfried
bors [Thu, 14 Jul 2016 21:33:17 +0000 (14:33 -0700)]
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.

8 years agoAuto merge of #34824 - alexcrichton:fix-nightlies, r=brson
bors [Thu, 14 Jul 2016 18:40:14 +0000 (11:40 -0700)]
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

8 years agotest: Remove NOTE assertions from trace_macros-gate
Alex Crichton [Thu, 14 Jul 2016 17:27:56 +0000 (10:27 -0700)]
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

8 years agomk: Move some definitions after their dependencies, to be visually less confusing
Ximin Luo [Thu, 14 Jul 2016 15:13:13 +0000 (17:13 +0200)]
mk: Move some definitions after their dependencies, to be visually less confusing

8 years agoAuto merge of #34783 - Dridi:cdylib_usage, r=alexcrichton
bors [Thu, 14 Jul 2016 13:37:30 +0000 (06:37 -0700)]
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. :grinning:

Thanks!

8 years agoAuto merge of #33907 - strake:decode_utf8, r=alexcrichton
bors [Thu, 14 Jul 2016 09:45:29 +0000 (02:45 -0700)]
Auto merge of #33907 - strake:decode_utf8, r=alexcrichton

add core::char::DecodeUtf8

See [issue](https://github.com/rust-lang/rust/issues/33906)

8 years agoAuto merge of #34805 - michaelwoerister:stable-bounds-encoding, r=eddyb
bors [Thu, 14 Jul 2016 06:09:02 +0000 (23:09 -0700)]
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

8 years agoAuto merge of #34776 - cuviper:solaris-readdir, r=alexcrichton
bors [Thu, 14 Jul 2016 02:32:17 +0000 (19:32 -0700)]
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?

8 years agoadd core::char::DecodeUtf8
M Farkas-Dyck [Fri, 27 May 2016 16:16:27 +0000 (08:16 -0800)]
add core::char::DecodeUtf8

8 years agoRemove irrelevant tests
Jeffrey Seyfried [Sun, 26 Jun 2016 04:12:31 +0000 (04:12 +0000)]
Remove irrelevant tests

8 years agoImplement `macro_rules!` placeholders and the macro scope map
Jeffrey Seyfried [Sun, 26 Jun 2016 03:32:45 +0000 (03:32 +0000)]
Implement `macro_rules!` placeholders and the macro scope map

8 years agoInstead of renaming, treat differently marked identifiers as unequal
Jeffrey Seyfried [Wed, 22 Jun 2016 02:50:05 +0000 (02:50 +0000)]
Instead of renaming, treat differently marked identifiers as unequal

8 years agoRemove `IllegalCtxt`
Jeffrey Seyfried [Wed, 22 Jun 2016 02:49:31 +0000 (02:49 +0000)]
Remove `IllegalCtxt`

8 years agoMove node id assigning into `resolve`
Jeffrey Seyfried [Wed, 22 Jun 2016 01:56:39 +0000 (01:56 +0000)]
Move node id assigning into `resolve`

8 years agoAuto merge of #34684 - oli-obk:eval_rustdoc_array_len, r=alexcrichton
bors [Wed, 13 Jul 2016 23:27:30 +0000 (16:27 -0700)]
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

8 years agoAuto merge of #33642 - xen0n:ergonomic-format-macro, r=alexcrichton
bors [Wed, 13 Jul 2016 20:26:57 +0000 (13:26 -0700)]
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!

8 years agosyntax_ext: format: better code documentation
Wang Xuerui [Thu, 2 Jun 2016 13:47:34 +0000 (21:47 +0800)]
syntax_ext: format: better code documentation

8 years agoformat: add tests for ergonomic format_args!
Wang Xuerui [Sat, 21 May 2016 15:08:30 +0000 (23:08 +0800)]
format: add tests for ergonomic format_args!

format: workaround pretty-printer to pass tests

8 years agosyntax_ext: format: de-duplicate argument objects
Wang Xuerui [Thu, 2 Jun 2016 10:16:24 +0000 (18:16 +0800)]
syntax_ext: format: de-duplicate argument objects

8 years agosyntax_ext: format: process counts uniquely and separately
Wang Xuerui [Sat, 21 May 2016 08:00:01 +0000 (16:00 +0800)]
syntax_ext: format: process counts uniquely and separately

8 years agosyntax_ext: format: allow multiple formats for one argument
Wang Xuerui [Sat, 14 May 2016 12:42:47 +0000 (20:42 +0800)]
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

8 years agosyntax_ext: format: rename variants of ArgumentType for clarity
Wang Xuerui [Sat, 21 May 2016 04:58:17 +0000 (12:58 +0800)]
syntax_ext: format: rename variants of ArgumentType for clarity

8 years agosyntax_ext: format: resolve named arguments early
Wang Xuerui [Sun, 5 Jun 2016 12:39:05 +0000 (20:39 +0800)]
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!

8 years agosyntax_ext: format: separate verification and translation of pieces
Wang Xuerui [Sun, 5 Jun 2016 10:01:37 +0000 (18:01 +0800)]
syntax_ext: format: separate verification and translation of pieces

8 years agoformat: remove all implicit ref handling outside of libfmt_macros
Wang Xuerui [Mon, 16 May 2016 17:02:42 +0000 (01:02 +0800)]
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.

8 years agolibfmt_macros: resolve all implicit refs while parsing
Wang Xuerui [Mon, 16 May 2016 06:10:54 +0000 (14:10 +0800)]
libfmt_macros: resolve all implicit refs while parsing

8 years agoAuto merge of #34772 - jseyfried:cleanup_interner, r=eddyb
bors [Wed, 13 Jul 2016 17:26:18 +0000 (10:26 -0700)]
Auto merge of #34772 - jseyfried:cleanup_interner, r=eddyb

Start cleaning up the string interner

r? @eddyb

8 years agoAdd examples for FpCategory
ggomez [Wed, 13 Jul 2016 15:32:23 +0000 (17:32 +0200)]
Add examples for FpCategory

8 years agoAuto merge of #34752 - ollie27:rustdoc_search, r=GuillaumeGomez
bors [Wed, 13 Jul 2016 14:27:43 +0000 (07:27 -0700)]
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

8 years agobuild compiler docs if requested in config
Tim Neumann [Wed, 13 Jul 2016 13:40:42 +0000 (15:40 +0200)]
build compiler docs if requested in config

8 years agodoc: ffi referenced rust-snappy can not compile
吴冉波 [Wed, 13 Jul 2016 13:53:27 +0000 (21:53 +0800)]
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.

8 years agoonly remove directory if it exists
Tim Neumann [Wed, 13 Jul 2016 13:15:28 +0000 (15:15 +0200)]
only remove directory if it exists

8 years agocreate global doc dir for all doc targets
Tim Neumann [Wed, 13 Jul 2016 13:05:52 +0000 (15:05 +0200)]
create global doc dir for all doc targets

8 years agoAuto merge of #34608 - apasel422:ll, r=bluss
bors [Wed, 13 Jul 2016 11:31:30 +0000 (04:31 -0700)]
Auto merge of #34608 - apasel422:ll, r=bluss

Replace `LinkedList`'s use of `Box` with `Shared`

Closes #34417

8 years agoAuto merge of #34660 - jseyfried:fix_parse_stmt, r=nrc
bors [Wed, 13 Jul 2016 08:37:07 +0000 (01:37 -0700)]
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

8 years agoevaluate the array length of fixed size array types in rustdoc
Oliver Schneider [Wed, 13 Jul 2016 08:35:58 +0000 (10:35 +0200)]
evaluate the array length of fixed size array types in rustdoc

8 years agoFixed issue where importing a trait method directly and then calling the method cause...
Michael Rosenberg [Wed, 13 Jul 2016 05:36:09 +0000 (01:36 -0400)]
Fixed issue where importing a trait method directly and then calling the method causes a compiler panic

8 years agoAuto merge of #34756 - habnabit:mutex-refunwindsafe, r=alexcrichton
bors [Wed, 13 Jul 2016 05:43:31 +0000 (22:43 -0700)]
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.

8 years agoStart a best-effort warning cycle.
Jeffrey Seyfried [Tue, 12 Jul 2016 03:56:19 +0000 (03:56 +0000)]
Start a best-effort warning cycle.

8 years agocleanup: Refactor parser method `finish_parsing_statement` -> `parse_full_stmt`.
Jeffrey Seyfried [Thu, 7 Jul 2016 04:12:20 +0000 (04:12 +0000)]
cleanup: Refactor parser method `finish_parsing_statement` -> `parse_full_stmt`.

8 years agoAllow macro-expanded macros in trailing expression positions to expand into statements:
Jeffrey Seyfried [Tue, 5 Jul 2016 08:21:25 +0000 (08:21 +0000)]
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.

8 years agoFix bug in the pretty printer.
Jeffrey Seyfried [Tue, 5 Jul 2016 11:21:25 +0000 (11:21 +0000)]
Fix bug in the pretty printer.

8 years agoAuto merge of #34739 - therealbstern:ipv4unspec, r=alexcrichton
bors [Wed, 13 Jul 2016 02:11:02 +0000 (19:11 -0700)]
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.

8 years agoAdd doc example for `std::process::ExitStatus::success`.
Corey Farwell [Tue, 12 Jul 2016 23:52:44 +0000 (19:52 -0400)]
Add doc example for `std::process::ExitStatus::success`.

8 years agoAuto merge of #34705 - alexcrichton:clean-deprecated, r=brson
bors [Tue, 12 Jul 2016 22:15:56 +0000 (15:15 -0700)]
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.

8 years agostd: Clean out deprecated APIs
Alex Crichton [Thu, 7 Jul 2016 18:46:09 +0000 (11:46 -0700)]
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.

8 years agoMention the crate type cdylib in rustc's usage
Dridi Boukelmoune [Tue, 12 Jul 2016 16:56:11 +0000 (18:56 +0200)]
Mention the crate type cdylib in rustc's usage

8 years agoAuto merge of #34757 - sourcefrog:debug-filetype, r=alexcrichton
bors [Tue, 12 Jul 2016 13:54:46 +0000 (06:54 -0700)]
Auto merge of #34757 - sourcefrog:debug-filetype, r=alexcrichton

Derive Debug on FileType.

Partially fixes #32054

8 years agorustdoc: Fix methods in seach results
Oliver Middleton [Sat, 9 Jul 2016 13:07:37 +0000 (14:07 +0100)]
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.

8 years agoAuto merge of #34778 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 12 Jul 2016 10:58:33 +0000 (03:58 -0700)]
Auto merge of #34778 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #34736, #34737, #34740, #34742, #34749, #34750, #34770
- Failed merges: #33951

8 years agoRollup merge of #34770 - davidko:patch-1, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:24 +0000 (12:08 +0200)]
Rollup merge of #34770 - davidko:patch-1, r=steveklabnik

Fixed some typos

I believe these are typos?

8 years agoRollup merge of #34750 - GuillaumeGomez:error_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:24 +0000 (12:08 +0200)]
Rollup merge of #34750 - GuillaumeGomez:error_doc, r=steveklabnik

Add examples for std::Error module

Fixes #29352.

r? @steveklabnik

8 years agoRollup merge of #34749 - GuillaumeGomez:any_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34749 - GuillaumeGomez:any_doc, r=steveklabnik

Improve std::any module doc

Fixes #29340.

r? @steveklabnik

8 years agoRollup merge of #34742 - abhijeetbhagat:master, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34742 - abhijeetbhagat:master, r=steveklabnik

Update on struct expressions

Update doc for struct expressions (#32769)

8 years agoRollup merge of #34740 - GuillaumeGomez:boxed_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34740 - GuillaumeGomez:boxed_doc, r=steveklabnik

Improve boxed docs

Fixes #29343.

r? @steveklabnik

8 years agoRollup merge of #34737 - frewsxcv:libstd-process-child, r=GuillaumeGomez
Guillaume Gomez [Tue, 12 Jul 2016 10:08:23 +0000 (12:08 +0200)]
Rollup merge of #34737 - frewsxcv:libstd-process-child, r=GuillaumeGomez

Various `std::process` doc improvements.

None

8 years agoRollup merge of #34736 - GuillaumeGomez:cells_doc, r=steveklabnik
Guillaume Gomez [Tue, 12 Jul 2016 10:08:22 +0000 (12:08 +0200)]
Rollup merge of #34736 - GuillaumeGomez:cells_doc, r=steveklabnik

Add missing examples for std::cell types

Fixes #29344.

r? @steveklabnik

8 years agoUse `ptr::{null, null_mut}` instead of `0 as *{const, mut}`
Tobias Bucher [Fri, 24 Jun 2016 18:54:52 +0000 (20:54 +0200)]
Use `ptr::{null, null_mut}` instead of `0 as *{const, mut}`

8 years agoAuto merge of #34755 - jonas-schievink:minor-differences, r=eddyb
bors [Tue, 12 Jul 2016 08:06:34 +0000 (01:06 -0700)]
Auto merge of #34755 - jonas-schievink:minor-differences, r=eddyb

Move variant_size_differences out of trans

Also enhances the error message a bit, fixes #30505 on the way, and adds
a test (which was missing).

Closes #34018

8 years agotyencode: Make sure that projection bounds are handled in stable order.
Michael Woerister [Wed, 13 Jul 2016 16:30:28 +0000 (12:30 -0400)]
tyencode: Make sure that projection bounds are handled in stable order.

8 years agodoc: Mention that writeln! and println! always use LF
Mike Hommey [Tue, 12 Jul 2016 05:37:04 +0000 (14:37 +0900)]
doc: Mention that writeln! and println! always use LF

Fixes #34697

8 years agoAuto merge of #34637 - GuillaumeGomez:syntax_codes, r=jonathandturner
bors [Tue, 12 Jul 2016 05:09:44 +0000 (22:09 -0700)]
Auto merge of #34637 - GuillaumeGomez:syntax_codes, r=jonathandturner

Syntax codes

r? @jonathandturner

cc @steveklabnik

This is a first big shot. I'll do the second one later in the week once this one is merged.

8 years agostd: clear errno before readdir, then check it (solaris)
Josh Stone [Tue, 12 Jul 2016 04:43:53 +0000 (21:43 -0700)]
std: clear errno before readdir, then check it (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 patch adds `set_errno`, uses it to clear the value before calling
`readdir`, then checks it again after to see the reason for a `NULL`.

8 years agolibc: fast-forward for solaris `RTLD_DEFAULT`
Josh Stone [Tue, 12 Jul 2016 04:43:31 +0000 (21:43 -0700)]
libc: fast-forward for solaris `RTLD_DEFAULT`

8 years agostd: Fix IPV6 imports for solaris
Josh Stone [Tue, 12 Jul 2016 04:35:54 +0000 (21:35 -0700)]
std: Fix IPV6 imports for solaris

Like BSDs, Solaris maps `IPV6_ADD_MEMBERSHIP` and `IPV6_DROP_MEMBERSHIP`
from `IPV6_JOIN_GROUP` and `IPV6_LEAVE_GROUP` respectively.

8 years agostd: Fix `Thread::set_name()` for newlib and solaris
Josh Stone [Tue, 12 Jul 2016 04:35:47 +0000 (21:35 -0700)]
std: Fix `Thread::set_name()` for newlib and solaris

The `use ffi::CStr` in `unix/thread.rs` was previously guarded, but now
all platforms need it for `Thread::set_name()`.  Newlib and Solaris do
nothing here, as they have no way to set a thread name, but they still
define the same method signature.

8 years agoFix fallout.
Jeffrey Seyfried [Sat, 2 Jul 2016 15:49:50 +0000 (15:49 +0000)]
Fix fallout.