]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRollup merge of #32183 - bluss:doc-index, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32183 - bluss:doc-index, r=alexcrichton

Clarify doc for slice slicing (Index impls)

Clarify doc for slice slicing (Index impls)

This is a follow up for PR #32099 and #32057

8 years agoRollup merge of #32181 - srinivasreddy:librustfront, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32181 - srinivasreddy:librustfront, r=steveklabnik

removed suffixes for librustc_front

8 years agoRollup merge of #32180 - srinivasreddy:type_check_lib, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:27 +0000 (02:41 +0530)]
Rollup merge of #32180 - srinivasreddy:type_check_lib, r=steveklabnik

removed integer suffixes in librustc_typeck crate

8 years agoRollup merge of #32178 - naltun:patch-1, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32178 - naltun:patch-1, r=steveklabnik

Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`

8 years agoRollup merge of #32174 - cmbrandenburg:spell_fix, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32174 - cmbrandenburg:spell_fix, r=steveklabnik

Spell fixes for std::ffi doc comments

8 years agoRollup merge of #32171 - frewsxcv:compiletest, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32171 - frewsxcv:compiletest, r=alexcrichton

Fix a couple compiletest nits.

8 years agoRollup merge of #32158 - seanmonstar:dead-associated-type, r=alexcrichton
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32158 - seanmonstar:dead-associated-type, r=alexcrichton

lint: mark associated types as live for the dead_code pass

Associated types of trait impls were being excluded from the live list. So types that only appeared in trait impls were being marked as dead code.

8 years agoRollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnik
Manish Goregaokar [Fri, 11 Mar 2016 21:11:26 +0000 (02:41 +0530)]
Rollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnik

Add missing documentation examples for BinaryHeap.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BinaryHeap` collection
type.

This is part of issue #29348.

r? @steveklabnik

8 years agoAuto merge of #32133 - alexcrichton:linkchecker, r=brson
bors [Fri, 11 Mar 2016 12:38:04 +0000 (04:38 -0800)]
Auto merge of #32133 - alexcrichton:linkchecker, r=brson

Add a link validator to rustbuild

This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general.

There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time.

The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely:

1. New steps are defined for building the tool and running the tool
2. The dependencies are configured
3. The steps are implemented

In terms of the link checker, these commits do a few things:

* A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet).
* A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed.
* A few rustdoc bugs here and there were fixed

8 years agoAuto merge of #32034 - alexcrichton:old-x86-msvc, r=aturon
bors [Fri, 11 Mar 2016 06:47:49 +0000 (22:47 -0800)]
Auto merge of #32034 - alexcrichton:old-x86-msvc, r=aturon

rustc: Add an i586-pc-windows-msvc target

Similarly to #31629 where an i586-unknown-linux-gnu target was added, there is
sometimes a desire to compile for x86 Windows as well where SSE2 is disabled.
This commit mirrors the i586-unknown-linux-gnu target and simply adds a variant
for Windows as well.

This is motivated by a recent [Gecko bug][ff] where crashes were seen on 32-bit
Windows due to users having CPUs that don't support SSE2 instructions. It was
requested that we could have non-SSE2 builds of the standard library available
so they could continue to use vanilla releases and nightlies.

[ff]: https://bugzilla.mozilla.org/show_bug.cgi?id=1253202

8 years agoAuto merge of #32121 - GuillaumeGomez:help_e0514, r=cmr
bors [Fri, 11 Mar 2016 04:37:04 +0000 (20:37 -0800)]
Auto merge of #32121 - GuillaumeGomez:help_e0514, r=cmr

Add help for E0514

I fixed #30622.

r? @arielb1

8 years agoAuto merge of #32102 - alexcrichton:assert-safe-closures, r=aturon
bors [Fri, 11 Mar 2016 01:52:12 +0000 (17:52 -0800)]
Auto merge of #32102 - alexcrichton:assert-safe-closures, r=aturon

std: Add impl of FnOnce to AssertRecoverSafe

This was originally intended, but forgot to land by accident!

cc #27719

8 years agoAuto merge of #32117 - mitaa:patch-3, r=alexcrichton
bors [Thu, 10 Mar 2016 22:57:31 +0000 (14:57 -0800)]
Auto merge of #32117 - mitaa:patch-3, r=alexcrichton

rustdoc: correct src-link url

It would have been nice for htmldocck to catch this, especially since there are rustdoc tests specifically for checking src-links.

fixes #32113

8 years agoClarify doc for slice slicing (Index impls)
Ulrik Sverdrup [Thu, 10 Mar 2016 20:36:43 +0000 (21:36 +0100)]
Clarify doc for slice slicing (Index impls)

This is a follow up for PR #32099 and #32057

8 years agoremoved suffixes for librustc_front
srinivasreddy [Thu, 10 Mar 2016 20:02:03 +0000 (01:32 +0530)]
removed suffixes for librustc_front

8 years agoAuto merge of #32107 - Stebalien:partial-write, r=alexcrichton
bors [Thu, 10 Mar 2016 19:56:29 +0000 (11:56 -0800)]
Auto merge of #32107 - Stebalien:partial-write, r=alexcrichton

Never return an error after a partial write

If LineWriter fails to flush, return the number of bytes written instead
of an error.

Fixes #32085

8 years agoremoved integer constants in librustc_typeck
srinivasreddy [Thu, 10 Mar 2016 19:11:25 +0000 (00:41 +0530)]
removed integer constants in librustc_typeck

8 years agoUpdate getting-started.md
Noah [Thu, 10 Mar 2016 17:34:42 +0000 (11:34 -0600)]
Update getting-started.md

In `rustc 1.7.0` the message that is displayed is now `Rust is ready to roll.`

8 years agoAuto merge of #32101 - SimonSapin:patch-11, r=alexcrichton
bors [Thu, 10 Mar 2016 15:05:05 +0000 (07:05 -0800)]
Auto merge of #32101 - SimonSapin:patch-11, r=alexcrichton

Add info in `rustdoc --passes list`

CC @mitaa, https://github.com/rust-lang/rust/pull/32055/files#r55205006

8 years agoAuto merge of #32173 - steveklabnik:rollup, r=steveklabnik
bors [Thu, 10 Mar 2016 13:01:03 +0000 (05:01 -0800)]
Auto merge of #32173 - steveklabnik:rollup, r=steveklabnik

Rollup of 8 pull requests

- Successful merges: #31830, #32091, #32125, #32136, #32147, #32148, #32149, #32150
- Failed merges:

8 years agoSpell fixes for std::ffi doc comments
Craig M. Brandenburg [Thu, 10 Mar 2016 12:14:00 +0000 (05:14 -0700)]
Spell fixes for std::ffi doc comments

8 years agoRemove unnecessary mut in docs causing test failures.
Nathan Kleyn [Thu, 10 Mar 2016 11:40:31 +0000 (11:40 +0000)]
Remove unnecessary mut in docs causing test failures.

8 years agoRollup merge of #32150 - steveklabnik:gh20213, r=bluss
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32150 - steveklabnik:gh20213, r=bluss

Remove inaccurate claim about inline assembly

It's not like GCC's.

Fixes #20213

8 years agoRollup merge of #32149 - steveklabnik:gh31628, r=bluss
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32149 - steveklabnik:gh31628, r=bluss

Add other primitive types to the reference

Fixes #31628

8 years agoRollup merge of #32148 - steveklabnik:gh31912, r=apasel422
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32148 - steveklabnik:gh31912, r=apasel422

Small grammar fix in Guessing Game

When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes #31912

8 years agoRollup merge of #32147 - steveklabnik:gh31950, r=bluss
Steve Klabnik [Thu, 10 Mar 2016 11:01:54 +0000 (14:01 +0300)]
Rollup merge of #32147 - steveklabnik:gh31950, r=bluss

Clarify that try_unwrap needs exactly one

Fixes #31950

8 years agoRollup merge of #32136 - nathankleyn:improve-docs-for-btreeset, r=steveklabnik
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #32136 - nathankleyn:improve-docs-for-btreeset, r=steveklabnik

Add missing documentation examples for BTreeSet.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BTreeSet` collection
type.

This is part of issue #29348.

r? @steveklabnik

8 years agoRollup merge of #32125 - pyfisch:patch-2, r=steveklabnik
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #32125 - pyfisch:patch-2, r=steveklabnik

Remove final note from testing chapter.

The information that documentation tests cannot be run in binary crates is already given at the beginning of the section.

8 years agoRollup merge of #32091 - dirk:dirk/siphasher-docs-clarification, r=alexcrichton
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #32091 - dirk:dirk/siphasher-docs-clarification, r=alexcrichton

Clarify documentation of hash::SipHasher

The docs were making assertions/recommendations they shouldn't have. This clarifies them and adds some helpful links.

Fixes #32043.

r? @sfackler

8 years agoRollup merge of #31830 - frewsxcv:assoc-func, r=steveklabnik
Steve Klabnik [Thu, 10 Mar 2016 11:01:53 +0000 (14:01 +0300)]
Rollup merge of #31830 - frewsxcv:assoc-func, r=steveklabnik

Prefer 'associated function' over 'static method' in msg.

TRPL seems to refer to 'static functions' as 'associated functions'.
This terminology should be used consistently.

8 years agoAuto merge of #32100 - SimonSapin:patch-6, r=alexcrichton
bors [Thu, 10 Mar 2016 10:45:14 +0000 (02:45 -0800)]
Auto merge of #32100 - SimonSapin:patch-6, r=alexcrichton

"can be built on Ref::map"… how?

Now that `std::cell::Ref::filter_map` and `RefMut::filter_map` are deprecated, using them gives a warning like:
```
script/dom/element.rs:754:9: 754:24 warning: use of deprecated item: can be built on Ref::map, #[warn(deprecated)] on by default
```

But it’s not at all obvious *how* the functionality can be built on `Ref::map`. This PR adds to the warning message a crates.io URL for a crate that does.

8 years agoDifferentiate "line" and "line number" variable names.
Corey Farwell [Thu, 10 Mar 2016 06:13:51 +0000 (22:13 -0800)]
Differentiate "line" and "line number" variable names.

8 years agoPrefer `Option::expect` over explicit unwrapping.
Corey Farwell [Thu, 10 Mar 2016 05:44:35 +0000 (21:44 -0800)]
Prefer `Option::expect` over explicit unwrapping.

8 years agoAuto merge of #32097 - jseyfried:fix_resolution_regression, r=nikomatsakis
bors [Thu, 10 Mar 2016 06:41:48 +0000 (22:41 -0800)]
Auto merge of #32097 - jseyfried:fix_resolution_regression, r=nikomatsakis

Fix a regression in import resolution

This fixes #32089 (caused by #31726) by deducing that name resolution has failed (as opposed to being determinate) in more cases.

r? @nikomatsakis

8 years agoPrefer 'associated function' over 'static method' in msg.
Corey Farwell [Tue, 23 Feb 2016 05:04:30 +0000 (00:04 -0500)]
Prefer 'associated function' over 'static method' in msg.

TRPL seems to refer to 'static functions' as 'associated functions'.
This terminology should be used consistently.

8 years agoAuto merge of #31710 - eddyb:reify, r=nikomatsakis
bors [Thu, 10 Mar 2016 04:16:20 +0000 (20:16 -0800)]
Auto merge of #31710 - eddyb:reify, r=nikomatsakis

Distinguish fn item types to allow reification from nothing to fn pointers.

The first commit is a rebase of #26284, except for files that have moved since.

This is a [breaking-change], due to:
* each FFI function has a distinct type, like all other functions currently do
* all generic parameters on functions are recorded in their item types, e.g.:
`size_of::<u8>` & `size_of::<i8>`'s types differ despite their identical signature.
* function items are zero-sized, which will stop transmutes from working on them

The first two cases are handled in most cases with the new coerce-unify logic,
which will combine incompatible function item types into function pointers,
at the outer-most level of if-else chains, match arms and array literals.

The last case is specially handled during type-checking such that transmutes
from a function item type to a pointer or integer type will continue to work for
another release cycle, but are being linted against. To get rid of warnings and
ensure your code will continue to compile, cast to a pointer before transmuting.

8 years agoAuto merge of #31618 - alexcrichton:no-thread-spawns, r=brson
bors [Thu, 10 Mar 2016 02:18:10 +0000 (18:18 -0800)]
Auto merge of #31618 - alexcrichton:no-thread-spawns, r=brson

Optimize some functions in std::process

* Be sure that `read_to_end` gets directed towards `read_to_end_uninitialized` for all handles
* When spawning a child that guaranteed doesn't need a stdin, don't actually create a stdin pipe for that process, instead just redirect it to /dev/null
* When calling `wait_with_output`, don't spawn threads to read out the pipes of the child. Instead drain all pipes on the calling thread and *then* wait on the process.

Functionally, it is intended that nothing changes as part of this PR

---

Note that this was the same as #31613, and even after that it turned out that fixing Windows was easier than I thought! To copy a comment from over there:

> As some rationale for this as well, it's always bothered me that we've spawned threads in the standard library for this (seems a bit overkill), and I've also been curious lately as to our why our build times for Windows are so much higher than Unix (on the buildbots we have). I have done basically 0 investigation into why, but I figured it can't help to try to optimize Command::output which I believe is called quite a few times during the test suite.

8 years agoAuto merge of #32165 - alexcrichton:fix-broken-master, r=alexcrichton
bors [Thu, 10 Mar 2016 00:21:32 +0000 (16:21 -0800)]
Auto merge of #32165 - alexcrichton:fix-broken-master, r=alexcrichton

collections: Fix broken doc example

PR #32135 was accidentally merged without tests passing, and unfortunately one
of the tests added was broken, so this fixes that.

8 years agocollections: Fix broken doc example
Alex Crichton [Thu, 10 Mar 2016 00:20:32 +0000 (16:20 -0800)]
collections: Fix broken doc example

PR #32135 was accidentally merged without tests passing, and unfortunately one
of the tests added was broken, so this fixes that.

8 years agoMerge pull request #32135 from nathankleyn/improve-docs-for-btreemap
Steve Klabnik [Wed, 9 Mar 2016 22:14:40 +0000 (01:14 +0300)]
Merge pull request #32135 from nathankleyn/improve-docs-for-btreemap

Add missing documentation examples for BTreeMap.

8 years agolint: mark associated types as live for the dead_code pass
Sean McArthur [Wed, 9 Mar 2016 18:12:24 +0000 (10:12 -0800)]
lint: mark associated types as live for the dead_code pass

8 years agostd: Don't spawn threads in `wait_with_output`
Alex Crichton [Fri, 12 Feb 2016 18:29:25 +0000 (10:29 -0800)]
std: Don't spawn threads in `wait_with_output`

Semantically there's actually no reason for us to spawn threads as part of the
call to `wait_with_output`, and that's generally an incredibly heavyweight
operation for just reading a few bytes (especially when stderr probably rarely
has bytes!). An equivalent operation in terms of what's implemented today would
be to just drain both pipes of all contents and then call `wait` on the child
process itself.

On Unix we can implement this through some convenient use of the `select`
function, whereas on Windows we can make use of overlapped I/O. Note that on
Windows this requires us to use named pipes instead of anonymous pipes, but
they're semantically the same under the hood.

8 years agoAdd missing "basic usage" sections to docs, fix review comments.
Nathan Kleyn [Wed, 9 Mar 2016 16:39:23 +0000 (16:39 +0000)]
Add missing "basic usage" sections to docs, fix review comments.

8 years agotrans: Keep transmutes from fn item types working, but lint them.
Eduard Burtescu [Wed, 9 Mar 2016 16:35:27 +0000 (18:35 +0200)]
trans: Keep transmutes from fn item types working, but lint them.

8 years agoAddress review comments to add "basic usage" sections to docs.
Nathan Kleyn [Wed, 9 Mar 2016 16:18:31 +0000 (16:18 +0000)]
Address review comments to add "basic usage" sections to docs.

8 years agoAuto merge of #32073 - jseyfried:fix_another_trait_privacy_error, r=nikomatsakis
bors [Wed, 9 Mar 2016 15:14:05 +0000 (07:14 -0800)]
Auto merge of #32073 - jseyfried:fix_another_trait_privacy_error, r=nikomatsakis

Fix incorrect trait privacy error

This PR fixes #21670 by using the crate metadata instead of `ExternalExports` to determine if an external item is public.

r? @nikomatsakis

8 years agotypeck: Unify if-else blocks, match arms and array elements by coercing where possible.
Eduard Burtescu [Sun, 6 Mar 2016 15:33:30 +0000 (17:33 +0200)]
typeck: Unify if-else blocks, match arms and array elements by coercing where possible.

8 years agotypeck: Remove the redundant "unifier" from check_expr_with_unifier.
Eduard Burtescu [Mon, 22 Feb 2016 19:39:57 +0000 (21:39 +0200)]
typeck: Remove the redundant "unifier" from check_expr_with_unifier.

8 years agotypeck: Support multiple expressions getting coerced at the same type.
Eduard Burtescu [Mon, 22 Feb 2016 12:06:19 +0000 (14:06 +0200)]
typeck: Support multiple expressions getting coerced at the same type.

8 years agotypeck: don't wastefully clone expressions for cast checks.
Eduard Burtescu [Sun, 21 Feb 2016 19:39:32 +0000 (21:39 +0200)]
typeck: don't wastefully clone expressions for cast checks.

8 years agotypeck: Remove Coerce::unpack_actual_value.
Eduard Burtescu [Sun, 21 Feb 2016 16:58:08 +0000 (18:58 +0200)]
typeck: Remove Coerce::unpack_actual_value.

8 years agoinfer: Take the origin in report_mismatched_types.
Eduard Burtescu [Sun, 21 Feb 2016 16:57:30 +0000 (18:57 +0200)]
infer: Take the origin in report_mismatched_types.

8 years agotypeck: rename mk_assignty to coercion::try.
Eduard Burtescu [Sun, 21 Feb 2016 16:56:35 +0000 (18:56 +0200)]
typeck: rename mk_assignty to coercion::try.

8 years agoinfer: Remove redundant commit_if_ok calls.
Eduard Burtescu [Sun, 21 Feb 2016 16:53:53 +0000 (18:53 +0200)]
infer: Remove redundant commit_if_ok calls.

8 years agoTest that function types are actually zero-sized.
Eduard Burtescu [Sun, 21 Feb 2016 11:52:41 +0000 (13:52 +0200)]
Test that function types are actually zero-sized.

8 years agotests: Avoid transmuting from fn item types.
Eduard Burtescu [Thu, 18 Feb 2016 13:19:38 +0000 (15:19 +0200)]
tests: Avoid transmuting from fn item types.

8 years agotypeck: Use TyFnDef for methods.
Eduard Burtescu [Thu, 18 Feb 2016 13:19:11 +0000 (15:19 +0200)]
typeck: Use TyFnDef for methods.

8 years agotypeck: Introduce reification for fn ptr casts.
Eduard Burtescu [Thu, 18 Feb 2016 13:18:46 +0000 (15:18 +0200)]
typeck: Introduce reification for fn ptr casts.

8 years agotrans: Reify functions & methods to fn ptrs only where necessary.
Eduard Burtescu [Sun, 6 Mar 2016 15:32:47 +0000 (17:32 +0200)]
trans: Reify functions & methods to fn ptrs only where necessary.

8 years agotrans: Remove unused ref_id from monomorphic_fn.
Eduard Burtescu [Wed, 17 Feb 2016 07:11:46 +0000 (09:11 +0200)]
trans: Remove unused ref_id from monomorphic_fn.

8 years agotrans: Move type_of_fn_from_ty callers to type_of.
Eduard Burtescu [Wed, 17 Feb 2016 09:10:46 +0000 (11:10 +0200)]
trans: Move type_of_fn_from_ty callers to type_of.

8 years agoPrint fn type parameters for TyFnDef.
Eduard Burtescu [Tue, 16 Feb 2016 16:37:32 +0000 (18:37 +0200)]
Print fn type parameters for TyFnDef.

8 years agoTrack fn type and lifetime parameters in TyFnDef.
Eduard Burtescu [Tue, 16 Feb 2016 16:36:41 +0000 (18:36 +0200)]
Track fn type and lifetime parameters in TyFnDef.

8 years agoSplit TyBareFn into TyFnDef and TyFnPtr.
Eli Friedman [Sat, 13 Jun 2015 20:15:03 +0000 (13:15 -0700)]
Split TyBareFn into TyFnDef and TyFnPtr.

There's a lot of stuff wrong with the representation of these types:
TyFnDef doesn't actually uniquely identify a function, TyFnPtr is used to
represent method calls, TyFnDef in the sub-expression of a cast isn't
correctly reified, and probably some other stuff I haven't discovered yet.
Splitting them seems like the right first step, though.

8 years agoAuto merge of #31631 - jonas-schievink:agoraphobia, r=nrc
bors [Wed, 9 Mar 2016 13:25:48 +0000 (05:25 -0800)]
Auto merge of #31631 - jonas-schievink:agoraphobia, r=nrc

[breaking-batch] Move more uses of `panictry!` out of libsyntax

8 years agoAuto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrc
bors [Wed, 9 Mar 2016 11:34:55 +0000 (03:34 -0800)]
Auto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrc

Show clearer error message when #![deny(warnings)] escalates a warning

Addresses #30730

8 years agoAuto merge of #32071 - jseyfried:parse_pub, r=nikomatsakis
bors [Wed, 9 Mar 2016 09:45:33 +0000 (01:45 -0800)]
Auto merge of #32071 - jseyfried:parse_pub, r=nikomatsakis

Make errors for unnecessary visibility qualifiers consistent

This PR refactors away `syntax::parse::parser::ParsePub` so that unnecessary visibility qualifiers on variant fields are reported not by the parser but by `privacy::SanePrivacyVisitor` (thanks to @petrochenkov's drive-by improvements in #31919).

r? @nikomatsakis

8 years agoRemove inaccurate claim about inline assembly
Steve Klabnik [Wed, 9 Mar 2016 08:52:35 +0000 (03:52 -0500)]
Remove inaccurate claim about inline assembly

It's not like GCC's.

Fixes #20213

8 years agoAdd other primitive types to the reference
Steve Klabnik [Wed, 9 Mar 2016 08:42:36 +0000 (03:42 -0500)]
Add other primitive types to the reference

Fixes #31628

8 years agoSmall grammar fix in Guessing Game
Steve Klabnik [Wed, 9 Mar 2016 08:37:19 +0000 (03:37 -0500)]
Small grammar fix in Guessing Game

When it was Option.expect(), there was an .ok().expect(), but now that it uses Result.expect(), there's only one method, not two.

Fixes #31912

8 years agoClarify that try_unwrap needs exactly one
Steve Klabnik [Wed, 9 Mar 2016 08:32:47 +0000 (03:32 -0500)]
Clarify that try_unwrap needs exactly one

Fixes #31950

8 years agoAuto merge of #32023 - matklad:diamonds-and-rust, r=nikomatsakis
bors [Wed, 9 Mar 2016 07:34:34 +0000 (23:34 -0800)]
Auto merge of #32023 - matklad:diamonds-and-rust, r=nikomatsakis

tests: add test for empty <>

Rust allows to specify an empty list of type and lifetime parameters, but there are no tests for it:

```
user@UNIT-326 [12:53:45] [~/projects/rust] [diamonds-and-rust]
-> % grep "<>" -R src/test
src/test/compile-fail/generic-type-params-name-repr.rs:    // And don't print <> at all when there's just defaults.
src/test/debuginfo/issue22656.rs:// when trying to handle a Vec<> or anything else that contains zero-sized
```

So let's add them! Besides it's such a wonderful opportunity to put a reference to Judas Priest band into the branch name ;)

8 years agoLink to actual CSPRNG in `hash::SipHasher` documentation
Dirk Gadsden [Wed, 9 Mar 2016 05:52:44 +0000 (21:52 -0800)]
Link to actual CSPRNG in `hash::SipHasher` documentation

8 years agoAuto merge of #31981 - achanda:unspecified-ip, r=alexcrichton
bors [Wed, 9 Mar 2016 05:13:29 +0000 (21:13 -0800)]
Auto merge of #31981 - achanda:unspecified-ip, r=alexcrichton

Exclude 0.0.0.0 from the list of globally routable addresses

8 years agostd: Don't always create stdin for children
Alex Crichton [Fri, 12 Feb 2016 18:28:03 +0000 (10:28 -0800)]
std: Don't always create stdin for children

For example if `Command::output` or `Command::status` is used then stdin is just
immediately closed. Add an option for this so as an optimization we can avoid
creating pipes entirely.

This should help reduce the number of active file descriptors when spawning
processes on Unix and the number of active handles on Windows.

8 years agostd: Funnel read_to_end through to one location
Alex Crichton [Fri, 12 Feb 2016 08:17:24 +0000 (00:17 -0800)]
std: Funnel read_to_end through to one location

This pushes the implementation detail of proxying `read_to_end` through to
`read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle`
implementations on Unix/Windows. This way intermediate layers will also be able
to take advantage of this optimized implementation.

This commit also adds the optimized implementation for `ChildStdout` and
`ChildStderr`.

8 years agoAuto merge of #32126 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 9 Mar 2016 00:13:19 +0000 (16:13 -0800)]
Auto merge of #32126 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #31772, #32083, #32084, #32092, #32099, #32103, #32115
- Failed merges:

8 years agoAdd missing documentation examples for BinaryHeap.
Nathan Kleyn [Tue, 8 Mar 2016 23:27:24 +0000 (23:27 +0000)]
Add missing documentation examples for BinaryHeap.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BinaryHeap` collection
type.

This is part of issue #29348.

8 years agoAdd missing documentation examples for BTreeSet.
Nathan Kleyn [Tue, 8 Mar 2016 22:53:54 +0000 (22:53 +0000)]
Add missing documentation examples for BTreeSet.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BTreeSet` collection
type.

This is part of issue #29348.

8 years agoAdd missing documentation examples for BTreeMap.
Nathan Kleyn [Tue, 8 Mar 2016 22:44:40 +0000 (22:44 +0000)]
Add missing documentation examples for BTreeMap.

As part of the ongoing effort to document all methods with examples,
this commit adds the missing examples for the `BTreeMap` collection
type.

This is part of issue #29348.

8 years agorustbuild: Add the error-index-generator
Alex Crichton [Tue, 8 Mar 2016 21:42:32 +0000 (13:42 -0800)]
rustbuild: Add the error-index-generator

This adds a step and a rule for building the error index as part of rustbuild.

8 years agorustdoc: Don't inline all impls all at once
Alex Crichton [Tue, 8 Mar 2016 19:20:16 +0000 (11:20 -0800)]
rustdoc: Don't inline all impls all at once

Right now whenever rustdoc inlines a struct or enum from another crate it ends
up inlining *all* `impl` items found in the other crate at the same time. The
rationale for this was to discover all trait impls which are otherwise not
probed for. This unfortunately picks up a lot of impls of public traits for
private types, causing lots of broken links.

This commit instead hoards all of those inlined impls into a temporary storage
location which is then selectively drawn from whenever we inline a new type.
This should ensure that we still inline all relevant impls while avoiding all
private ones.

8 years agostd: Fix rustdoc links with std::fmt::Alignment
Alex Crichton [Tue, 8 Mar 2016 19:19:03 +0000 (11:19 -0800)]
std: Fix rustdoc links with std::fmt::Alignment

This is actually a reexported implementation detail in the `rt::v1` module but
rustdoc doesn't like reexporting items from `doc(hidden)` modules. Do what we'd
end up doing anyway from an API perspective and make a public-facing `enum` that
can be retranslated under the hood if necessary.

8 years agodoc: Fix a bunch of broken links
Alex Crichton [Tue, 8 Mar 2016 07:55:52 +0000 (23:55 -0800)]
doc: Fix a bunch of broken links

A few categories:

* Links into compiler docs were just all removed as we're not generating
  compiler docs.
* Move up one more level to forcibly go to std docs to fix inlined documentation
  across the facade crates.

8 years agorustbuild: Fix stage1 rustdoc
Alex Crichton [Tue, 8 Mar 2016 07:21:05 +0000 (23:21 -0800)]
rustbuild: Fix stage1 rustdoc

Just always build stage1 rustdoc, it's really not that much more to build as
it's essentially just one library.

8 years agorustbuild: Add a link checker for documentation
Alex Crichton [Tue, 8 Mar 2016 07:15:55 +0000 (23:15 -0800)]
rustbuild: Add a link checker for documentation

Add a script to get run which verifies that `href` links in documents are
correct. We're always getting a steady stream of "fix a broken link" PRs and
issue reports, and we should probably just nip them all in the bud.

8 years agorustbuild: Fixup calling rustdoc in various stages
Alex Crichton [Tue, 8 Mar 2016 07:11:05 +0000 (23:11 -0800)]
rustbuild: Fixup calling rustdoc in various stages

The stage0 rustdoc comes from the snapshot, and we need a shim like with `rustc`
to pass `--cfg` for now.

8 years agorustbuild: Use an enum to indicate destination
Alex Crichton [Tue, 8 Mar 2016 06:58:59 +0000 (22:58 -0800)]
rustbuild: Use an enum to indicate destination

Instead of using a `is_std: bool`, instead use a more well-typed and
self-documenting enum to indicate the mode in which Cargo is being invoked.

8 years agorustbuild: Move rustbook to a `src/tools` directory
Alex Crichton [Tue, 8 Mar 2016 06:32:37 +0000 (22:32 -0800)]
rustbuild: Move rustbook to a `src/tools` directory

We've actually got quite a few tools that are compiled as part of our build,
let's start housing them all in a `tools` directory.

8 years agorustbuild: Refactor adding steps manually
Alex Crichton [Tue, 8 Mar 2016 06:50:25 +0000 (22:50 -0800)]
rustbuild: Refactor adding steps manually

Use a macro so it automatically picks up new steps.

8 years agorustbuild: Add crate documentation generation
Alex Crichton [Tue, 8 Mar 2016 06:36:21 +0000 (22:36 -0800)]
rustbuild: Add crate documentation generation

Run `cargo doc` to generate all documentation for the standard library, and also
add a target which generates documentation for the compiler as well (but don't
enable it by default).

8 years agoRollup merge of #32115 - tclfs:patch-1, r=apasel422
Steve Klabnik [Tue, 8 Mar 2016 18:44:12 +0000 (21:44 +0300)]
Rollup merge of #32115 - tclfs:patch-1, r=apasel422

Update a spelling inconsistency

L26: "zero cost" -> "zero-cost"

8 years agoRollup merge of #32103 - timmontague:patch-1, r=alexcrichton
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32103 - timmontague:patch-1, r=alexcrichton

Fixed link in ownership documentation

Changed "[vector]" to a link to the vector documentation.

8 years agoRollup merge of #32099 - bluss:doc-string-slicing, r=alexcrichton
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32099 - bluss:doc-string-slicing, r=alexcrichton

Clarify documentation for string slicing (Index impls)

Clarify documentation for string slicing (Index impls)

- Mention the sugared syntax for the implementations, since it's not
  apparent from the docs that `Index<Range<usize>>` corresponds to
  `&self[a..b]`.
- Be specific in that start <= end and end <= len

This is just one fix in response to #32057

8 years agoRollup merge of #32092 - bluss:operator-overload, r=steveklabnik
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32092 - bluss:operator-overload, r=steveklabnik

Update syntax index with OpAssign traits

book: Update syntax index with OpAssign traits

The traits are stable from Rust 1.8.

8 years agoRollup merge of #32084 - gokhanettin:typo-in-comment, r=alexcrichton
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32084 - gokhanettin:typo-in-comment, r=alexcrichton

Fix typos - mismatching parentheses in comments

Fixes mismatching parentheses in the comments of precision example.

r? @steveklabnik

8 years agoRollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakis
Steve Klabnik [Tue, 8 Mar 2016 18:44:11 +0000 (21:44 +0300)]
Rollup merge of #32083 - nodakai:reference-scoped-enum-alias, r=nikomatsakis

reference.md: clarify the limitation of type alias on an enum

Tentatively define the current behavior as the specification.

Cf. rust-lang/rust#26264, rust-lang/rust#28556, rust-lang/rust#30936

8 years agoRollup merge of #31772 - nodakai:patch-1, r=steveklabnik
Steve Klabnik [Tue, 8 Mar 2016 18:44:10 +0000 (21:44 +0300)]
Rollup merge of #31772 - nodakai:patch-1, r=steveklabnik

Clarify the semantics of enum discriminants

cf. https://doc.rust-lang.org/error-index.html#E0082

> The default type for enum discriminants is isize, but it can be adjusted by adding the repr attribute to the enum declaration.

It would be great if anyone could check my English.

8 years agoRemove final note from testing chapter.
Pyfisch [Tue, 8 Mar 2016 18:33:27 +0000 (19:33 +0100)]
Remove final note from testing chapter.

The information that documentation tests cannot be run in binary crates is already given at the beginning of the section.

8 years agoAuto merge of #32009 - alexcrichton:trim-fulldeps, r=brson
bors [Tue, 8 Mar 2016 15:34:28 +0000 (07:34 -0800)]
Auto merge of #32009 - alexcrichton:trim-fulldeps, r=brson

mk: Distribute fewer TARGET_CRATES

Right now everything in TARGET_CRATES is built by default for all non-fulldeps
tests and is distributed by default for all target standard library packages.
Currenly this includes a number of unstable crates which are rarely used such as
`graphviz` and `rbml`>

This commit trims down the set of `TARGET_CRATES`, moves a number of tests to
`*-fulldeps` as a result, and trims down the dependencies of libtest so we can
distribute fewer crates in the `rust-std` packages.