]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agobreak enum variant discriminant inference in case of 32-bit
Oliver Schneider [Thu, 10 Mar 2016 13:20:53 +0000 (14:20 +0100)]
break enum variant discriminant inference in case of 32-bit

`assert_eq!(-9223372036854775808isize as u64, 0x8000000000000000);`

fails on 32 bit and succeeds on 64 bit. These commits don't change that behavior.

The following worked before my changes, because the discriminant was
always processed as `u64`.
Now it fails, because the discriminant of `Bu64` is now `0` instead of `-9223372036854775808`. This is more in line with the above assertion's code, since
`-9223372036854775808isize as u64` on 32 bit yielded `0`.

```rust
enum Eu64 {
    Au64 = 0,
    Bu64 = 0x8000_0000_0000_0000
}
```

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 agodon't be a breaking change, even in presence of overflowing literals
Oliver Schneider [Wed, 9 Mar 2016 18:27:36 +0000 (19:27 +0100)]
don't be a breaking change, even in presence of overflowing literals

8 years agofix rustdoc
Oliver Schneider [Fri, 4 Mar 2016 11:33:23 +0000 (12:33 +0100)]
fix rustdoc

8 years agosimplify const path lookup for constants and associated constants
Oliver Schneider [Thu, 3 Mar 2016 13:48:08 +0000 (14:48 +0100)]
simplify const path lookup for constants and associated constants

8 years agoprefer the (associated) const's type over the type hint
Oliver Schneider [Thu, 3 Mar 2016 13:46:20 +0000 (14:46 +0100)]
prefer the (associated) const's type over the type hint

8 years agoalso print the expected type in the error message
Oliver Schneider [Thu, 25 Feb 2016 10:12:18 +0000 (11:12 +0100)]
also print the expected type in the error message

8 years agothe type hint given during a cast operation is just a soft hint
Oliver Schneider [Thu, 25 Feb 2016 09:14:10 +0000 (10:14 +0100)]
the type hint given during a cast operation is just a soft hint

8 years agoinfer integral types in presence of a type hint
Oliver Schneider [Thu, 25 Feb 2016 09:13:36 +0000 (10:13 +0100)]
infer integral types in presence of a type hint

8 years agodon't guess const fn argument types
Oliver Schneider [Wed, 24 Feb 2016 15:07:31 +0000 (16:07 +0100)]
don't guess const fn argument types

8 years agoconst eval failures aren't fatal, simply return a dummy instead
Oliver 'ker' Schneider [Sun, 27 Dec 2015 01:17:16 +0000 (02:17 +0100)]
const eval failures aren't fatal, simply return a dummy instead

8 years agotypestrong constant integers
Oliver Schneider [Wed, 16 Dec 2015 17:44:15 +0000 (18:44 +0100)]
typestrong constant integers

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 agoAdd comment explaining purpose of test
Niko Matsakis [Thu, 10 Mar 2016 10:21:00 +0000 (05:21 -0500)]
Add comment explaining purpose of test

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 agoRemove `feature(globs)` since they are stable
mitaa [Tue, 8 Mar 2016 23:57:13 +0000 (00:57 +0100)]
Remove `feature(globs)` since they are stable

8 years agoConsider `doc(hidden)` for crate-local inlining
mitaa [Thu, 10 Mar 2016 02:29:46 +0000 (03:29 +0100)]
Consider `doc(hidden)` for crate-local inlining

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 agoDo not report errors from regionck if other errors were already
Niko Matsakis [Wed, 9 Mar 2016 21:53:19 +0000 (16:53 -0500)]
Do not report errors from regionck if other errors were already
reported during the lifetime of this inferencer. Fixes #30580.

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 agoForbid `use Trait::*`
Jeffrey Seyfried [Tue, 8 Mar 2016 22:27:12 +0000 (22:27 +0000)]
Forbid `use Trait::*`

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 agoCheck for `doc(inline)` instead of `.*(inline)`
mitaa [Wed, 9 Mar 2016 01:05:39 +0000 (02:05 +0100)]
Check for `doc(inline)` instead of `.*(inline)`

8 years agoRegenerate x86 platform intrinsics
Ruud van Asseldonk [Wed, 9 Mar 2016 00:16:31 +0000 (01:16 +0100)]
Regenerate x86 platform intrinsics

The exact command used was:

    $ cd src/etc/platform-intrinsics/x86
    $ python2 ../generator.py --format compiler-defs -i info.json   \
      sse.json sse2.json sse3.json ssse3.json sse41.json sse42.json \
      avx.json avx2.json fma.json                                   \
      > ../../../librustc_platform_intrinsics/x86.rs

8 years agoDefine AVX conversion intrinsics
Ruud van Asseldonk [Tue, 8 Mar 2016 21:36:54 +0000 (22:36 +0100)]
Define AVX conversion intrinsics

This defines the following intrinsics:

 * `_mm256_cvtepi32_pd`
 * `_mm256_cvtepi32_ps`
 * `_mm256_cvtpd_epi32`
 * `_mm256_cvtpd_ps`
 * `_mm256_cvtps_epi32`
 * `_mm256_cvtps_pd`
 * `_mm256_cvttpd_epi32`
 * `_mm256_cvttps_epi32`

Intel reference: https://software.intel.com/en-us/node/514130.

8 years agoDefine AVX broadcast intrinsics
Ruud van Asseldonk [Tue, 8 Mar 2016 20:41:18 +0000 (21:41 +0100)]
Define AVX broadcast intrinsics

This defines `_mm256_broadcast_ps` and `_mm256_broadcast_pd`. The `_ss`
and `_sd` variants are not supported by LLVM. In Clang these intrinsics
are implemented as inline functions in C++.

Intel reference: https://software.intel.com/en-us/node/514144.

Note: the argument type should really be "0hPc" (a pointer to a vector
of half the width), but internally the LLVM intrinsic takes a pointer to
a signed integer, and for any other type LLVM will complain. This means
that a transmute is required to call these intrinsics.

The AVX2 broadcast intrinsics `_mm256_broadcastss_ps` and
`_mm256_broadcastsd_pd` are not available as LLVM intrinsics. In Clang
they are implemented using the shufflevector builtin.

8 years agoAdd regression test
Jeffrey Seyfried [Tue, 8 Mar 2016 23:33:48 +0000 (23:33 +0000)]
Add regression test

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 agoRefactor away check_ribs
Jeffrey Seyfried [Tue, 8 Mar 2016 23:28:10 +0000 (23:28 +0000)]
Refactor away check_ribs

8 years agoInclude the crate root in the ribs
Jeffrey Seyfried [Fri, 26 Feb 2016 05:39:33 +0000 (05:39 +0000)]
Include the crate root in the ribs

8 years agoFix name resolution in lexical scopes
Jeffrey Seyfried [Tue, 8 Mar 2016 21:44:19 +0000 (21:44 +0000)]
Fix name resolution in lexical scopes

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 agoAdd regression test
Jeffrey Seyfried [Tue, 8 Mar 2016 21:54:46 +0000 (21:54 +0000)]
Add regression test

8 years agoStop treating a type alias like a module or enum (preventing `use TypeAlias::*`)
Jeffrey Seyfried [Tue, 8 Mar 2016 21:50:01 +0000 (21:50 +0000)]
Stop treating a type alias like a module or enum (preventing `use TypeAlias::*`)

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 agocover more linux targets in libstd cargobuild
arcnmx [Tue, 8 Mar 2016 21:15:58 +0000 (16:15 -0500)]
cover more linux targets in libstd cargobuild

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"