]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agorollup merge of #23949: aturon/stab-timeout
Alex Crichton [Wed, 1 Apr 2015 20:56:20 +0000 (13:56 -0700)]
rollup merge of #23949: aturon/stab-timeout

This commit renames and stabilizes:

* `Condvar::wait_timeout_ms` (renamed from `wait_timeout`)
* `thread::park_timeout_ms` (renamed from `park_timeout`)
* `thread::sleep_ms` (renamed from `sleep`)

In each case, the timeout is taken as a `u32` number of milliseconds,
rather than a `Duration`.

These functions are likely to be deprecated once a stable form of
`Duration` is available, but there is little cost to having these named
variants around, and it's crucial functionality for 1.0.

[breaking-change]

r? @alexcrichton

cc @sfackler @carllerche

9 years agorollup merge of #23948: nikomatsakis/feature-gate-rust-abi
Alex Crichton [Wed, 1 Apr 2015 20:56:19 +0000 (13:56 -0700)]
rollup merge of #23948: nikomatsakis/feature-gate-rust-abi

Like it says.

r? @alexcrichton

9 years agoStabilize basic timeout functionality
Aaron Turon [Wed, 1 Apr 2015 19:20:57 +0000 (12:20 -0700)]
Stabilize basic timeout functionality

This commit renames and stabilizes:

* `Condvar::wait_timeout_ms` (renamed from `wait_timeout`)
* `thread::park_timeout_ms` (renamed from `park_timeout`)
* `thread::sleep_ms` (renamed from `sleep`)

In each case, the timeout is taken as a `u32` number of milliseconds,
rather than a `Duration`.

These functions are likely to be deprecated once a stable form of
`Duration` is available, but there is little cost to having these named
variants around, and it's crucial functionality for 1.0.

[breaking-change]

9 years agorollup merge of #23939: nikomatsakis/fn-box
Alex Crichton [Wed, 1 Apr 2015 20:30:51 +0000 (13:30 -0700)]
rollup merge of #23939: nikomatsakis/fn-box

Conflicts:
src/liballoc/boxed.rs

9 years agorollup merge of #23951: alexcrichton/splitn
Alex Crichton [Wed, 1 Apr 2015 20:30:08 +0000 (13:30 -0700)]
rollup merge of #23951: alexcrichton/splitn

This commit is an implementation of [RFC 979][rfc] which changes the meaning of
the count parameter to the `splitn` function on strings and slices. The
parameter now means the number of items that are returned from the iterator, not
the number of splits that are made.

[rfc]: https://github.com/rust-lang/rfcs/pull/979

Closes #23911
[breaking-change]

9 years agostd: Changing the meaning of the count to splitn
Alex Crichton [Wed, 1 Apr 2015 18:28:34 +0000 (11:28 -0700)]
std: Changing the meaning of the count to splitn

This commit is an implementation of [RFC 979][rfc] which changes the meaning of
the count parameter to the `splitn` function on strings and slices. The
parameter now means the number of items that are returned from the iterator, not
the number of splits that are made.

[rfc]: https://github.com/rust-lang/rfcs/pull/979

Closes #23911
[breaking-change]

9 years agorollup merge of #23947: aturon/revise-num
Alex Crichton [Wed, 1 Apr 2015 20:22:16 +0000 (13:22 -0700)]
rollup merge of #23947: aturon/revise-num

Recent numerics stabilization removed the inherent `min_value` and
`max_value` methods from integer types, assuming that the module-level
constants would suffice. However, that failed to account for the use
case in FFI code when dealing with integer type aliases.

This commit reintroduces the methods as `#[stable]`, since this is
essential functionality for 1.0.

It's unfortunate to freeze these as methods, but when we can provide
inherent associated constants these methods can be deprecated.

r? @sfackler
cc @alexcrichton

9 years agorollup merge of #23944: alexcrichton/rustup-beta
Alex Crichton [Wed, 1 Apr 2015 20:22:15 +0000 (13:22 -0700)]
rollup merge of #23944: alexcrichton/rustup-beta

Switches rustup to using the beta channel by default. Includes #23824 for the implementation.

cc #20453
Closes #21149

9 years agorollup merge of #23942: vhbit/ios-rand
Alex Crichton [Wed, 1 Apr 2015 20:22:15 +0000 (13:22 -0700)]
rollup merge of #23942: vhbit/ios-rand

9 years agorollup merge of #23933: kgv/kgv_fix
Alex Crichton [Wed, 1 Apr 2015 20:22:12 +0000 (13:22 -0700)]
rollup merge of #23933: kgv/kgv_fix

Fix example and some text for: `read_line` takes `&mut String` and return `Result` instead `IoResult`.

r? @steveklabnik

9 years agorollup merge of #23867: nikomatsakis/issue-23086-take-3
Alex Crichton [Wed, 1 Apr 2015 20:22:10 +0000 (13:22 -0700)]
rollup merge of #23867: nikomatsakis/issue-23086-take-3

This PR implements rust-lang/rfcs#1023. In the process it fixes #23086 and #23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence.

I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable).

Fixes #23918.

9 years agorollup merge of #23568: steveklabnik/closure_docs
Alex Crichton [Wed, 1 Apr 2015 20:22:09 +0000 (13:22 -0700)]
rollup merge of #23568: steveklabnik/closure_docs

[rendered](https://github.com/steveklabnik/rust/blob/closure_docs/src/doc/trpl/closures.md)

r? @nikomatsakis

9 years agoPath rustdoc test
Niko Matsakis [Wed, 1 Apr 2015 20:18:56 +0000 (16:18 -0400)]
Path rustdoc test

9 years agorustup: Fix typo in nightly
Richo Healey [Wed, 1 Apr 2015 18:52:45 +0000 (11:52 -0700)]
rustup: Fix typo in nightly

9 years agoRemove TODO
Niko Matsakis [Wed, 1 Apr 2015 20:03:33 +0000 (16:03 -0400)]
Remove TODO

9 years agoFeature gate rust-call ABI.
Niko Matsakis [Wed, 1 Apr 2015 19:21:03 +0000 (15:21 -0400)]
Feature gate rust-call ABI.

9 years agoRe-add min_value, max_value methods
Aaron Turon [Wed, 1 Apr 2015 18:34:27 +0000 (11:34 -0700)]
Re-add min_value, max_value methods

Recent numerics stabilization removed the inherent `min_value` and
`max_value` methods from integer types, assuming that the module-level
constants would suffice. However, that failed to account for the use
case in FFI code when dealing with integer type aliases.

This commit reintroduces the methods as `#[stable]`, since this is
essential functionality for 1.0.

It's unfortunate to freeze these as methods, but when we can provide
inherent associated constants these methods can be deprecated.

9 years agoCollect the definition of the `Error` trait into `libstd` for now. This
Niko Matsakis [Wed, 1 Apr 2015 19:25:47 +0000 (15:25 -0400)]
Collect the definition of the `Error` trait into `libstd` for now.  This
sidesteps a coherence difficulty where `liballoc` had to prove that
`&str: !Error`, which didn't involve any local types.

9 years agoRe-write closures chapter
Steve Klabnik [Fri, 20 Mar 2015 21:35:52 +0000 (17:35 -0400)]
Re-write closures chapter

9 years agoRollup merge of #23932 - steveklabnik:doc_std_path, r=flaper87
Manish Goregaokar [Wed, 1 Apr 2015 19:10:40 +0000 (00:40 +0530)]
Rollup merge of #23932 - steveklabnik:doc_std_path, r=flaper87

9 years agoRollup merge of #23927 - frewsxcv:patch-7, r=Manishearth
Manish Goregaokar [Wed, 1 Apr 2015 19:10:40 +0000 (00:40 +0530)]
Rollup merge of #23927 - frewsxcv:patch-7, r=Manishearth

9 years agoRollup merge of #23925 - steveklabnik:gh22914, r=Gankro
Manish Goregaokar [Wed, 1 Apr 2015 19:10:39 +0000 (00:40 +0530)]
Rollup merge of #23925 - steveklabnik:gh22914, r=Gankro

Fixes #22914

Said issue was mostly fixed, as there wasn't any examples when it was initially posted. This is mostly just some re-wording of some things and some cleanup

9 years agoRollup merge of #23924 - nrc:unqual-assoc3, r=alexcrichton
Manish Goregaokar [Wed, 1 Apr 2015 19:10:39 +0000 (00:40 +0530)]
Rollup merge of #23924 - nrc:unqual-assoc3, r=alexcrichton

Basically stuff I did for unqualified assoc types which is worth landing by itself.

9 years agoRollup merge of #23895 - nikomatsakis:fn-trait-inheritance-add-impls, r=pnkfelix
Manish Goregaokar [Wed, 1 Apr 2015 19:10:39 +0000 (00:40 +0530)]
Rollup merge of #23895 - nikomatsakis:fn-trait-inheritance-add-impls, r=pnkfelix

The primary purpose of this PR is to add blanket impls for the `Fn` traits of the following (simplified) form:

    impl<F:Fn> Fn for &F
    impl<F:FnMut> FnMut for &mut F

However, this wound up requiring two changes:

1. A slight hack so that `x()` where `x: &mut F` is translated to `FnMut::call_mut(&mut *x, ())` vs `FnMut::call_mut(&mut x, ())`. This is achieved by just autoderef'ing one time when calling something whose type is `&F` or `&mut F`.
2. Making the infinite recursion test in trait matching a bit more tailored. This involves adding a notion of "matching" types that looks to see if types are potentially unifiable (it's an approximation).

The PR also includes various small refactorings to the inference code that are aimed at moving the unification and other code into a library (I've got that particular change in a branch, these changes just lead the way there by removing unnecessary dependencies between the compiler and the more general unification code).

Note that per rust-lang/rfcs#1023, adding impls like these would be a breaking change in the future.

cc @japaric
cc @alexcrichton
cc @aturon

Fixes #23015.

9 years agoRollup merge of #23867 - nikomatsakis:issue-23086-take-3, r=pnkfelix
Manish Goregaokar [Wed, 1 Apr 2015 19:10:38 +0000 (00:40 +0530)]
Rollup merge of #23867 - nikomatsakis:issue-23086-take-3, r=pnkfelix

This PR implements rust-lang/rfcs#1023. In the process it fixes #23086 and #23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence.

I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable).

Fixes #23918.

9 years agoRollup merge of #23847 - bcoopers:read_clarification, r=sfackler
Manish Goregaokar [Wed, 1 Apr 2015 19:10:38 +0000 (00:40 +0530)]
Rollup merge of #23847 - bcoopers:read_clarification, r=sfackler

This introduces no functional changes except for reducing a few unnecessary operations and variables.  Vec has the behavior that, if you request space past the capacity with reserve(), it will round up to the nearest power of 2.  What that effectively means is that after the first call to reserve(16), we are doubling our capacity every time.  So using the DEFAULT_BUF_SIZE and doubling cap_size() here is meaningless and has no effect on the call to reserve().

Note that with #23842 implemented this will hopefully have a clearer API and less of a need for commenting.  If #23842 is not implemented then the most clear implementation would be to call reserve_exact(buf.capacity()) at every step (and making sure that buf.capacity() is not zero at the beginning of the function of course).

Edit- functional change now introduced.  We will now zero 16 bytes of the vector first, then double to 32, then 64, etc. until we read 64kB.  This stops us from zeroing the entire vector when we double it, some of which may be wasted work.  Reallocation still follows the doubling strategy, but the responsibility has been moved to vec.extend(), which calls reserve() and push_back().

9 years agoRollup merge of #23844 - kvark:try_unique, r=alexcrichton
Manish Goregaokar [Wed, 1 Apr 2015 19:10:38 +0000 (00:40 +0530)]
Rollup merge of #23844 - kvark:try_unique, r=alexcrichton

While trying to implement parallel ECS processing, I stumbled upon the need to mutate `Arc` contents. The only existed method that allowed that was `make_unique`, but it has issues:
  - it may clone the data as if nothing happened, where the program may just need to crash
  - it forces `Clone` bound, which I don't have

The new `try_unique` allows accessing the contents mutably without `Clone` bound and error out if the pointer is not unique.

9 years agoRollup merge of #23066 - michaelwoerister:unreachable-if, r=pnkfelix
Manish Goregaokar [Wed, 1 Apr 2015 19:10:38 +0000 (00:40 +0530)]
Rollup merge of #23066 - michaelwoerister:unreachable-if, r=pnkfelix

This PR solves #21559 by making sure that unreachable if-expressions are not further translated.

Could someone who knows their way around `trans` take a look at the changes in `controlflow.rs`? I'm not sure if any other code relies on any side-effects of translating unreachable things.

cc @nikomatsakis @nrc @eddyb

9 years agoRemove `Thunk` struct and `Invoke` trait; change `Thunk` to be an alias
Niko Matsakis [Wed, 1 Apr 2015 15:12:30 +0000 (11:12 -0400)]
Remove `Thunk` struct and `Invoke` trait; change `Thunk` to be an alias
for `Box<FnBox()>`. I found the alias was still handy because it is
shorter than the fully written type.

This is a [breaking-change]: convert code using `Invoke` to use `FnBox`,
which is usually pretty straight-forward. Code using thunk mostly works
if you change `Thunk::new => Box::new` and `foo.invoke(arg)` to
`foo(arg)`.

9 years agoAdd (unstable) FnBox trait as a nicer replacement for `Thunk`. The doc
Niko Matsakis [Wed, 1 Apr 2015 14:11:46 +0000 (10:11 -0400)]
Add (unstable) FnBox trait as a nicer replacement for `Thunk`. The doc
comment includes a test that also shows how it can be used.

9 years agorustup: Default to the beta channel
Alex Crichton [Wed, 1 Apr 2015 17:42:06 +0000 (10:42 -0700)]
rustup: Default to the beta channel

Switches rustup to using the beta channel by default

9 years agoiOS: os::last_os_error() fallout
Valerii Hiora [Wed, 1 Apr 2015 17:38:58 +0000 (20:38 +0300)]
iOS: os::last_os_error() fallout

9 years agoMerge branch 'fix-rustup' of https://github.com/richo/rust
Alex Crichton [Wed, 1 Apr 2015 17:30:11 +0000 (10:30 -0700)]
Merge branch 'fix-rustup' of https://github.com/richo/rust

9 years agoFallout in libsyntax/librustc: use newtype'd options for linked lists,
Niko Matsakis [Mon, 30 Mar 2015 21:51:26 +0000 (17:51 -0400)]
Fallout in libsyntax/librustc: use newtype'd options for linked lists,
since `Option` is not fundamental and hence the old impls run afoul of
the orphan rules.

9 years agoFallout in libstd: remove impls now considered to conflict.
Niko Matsakis [Mon, 30 Mar 2015 21:50:31 +0000 (17:50 -0400)]
Fallout in libstd: remove impls now considered to conflict.

9 years agoUpdate tests for new coherence rules, and add a swatch of new tests
Niko Matsakis [Mon, 30 Mar 2015 21:49:30 +0000 (17:49 -0400)]
Update tests for new coherence rules, and add a swatch of new tests
probing the specifics of `Fundamental`.

Fixes #23086.
Fixes #23516.

9 years agoAdd `#[fundamental]` annotations into libcore so that `Sized` and the
Niko Matsakis [Mon, 30 Mar 2015 21:52:00 +0000 (17:52 -0400)]
Add `#[fundamental]` annotations into libcore so that `Sized` and the
`Fn` traits are considered fundamental, along with `Box` (though that is
mostly for show; the real type is `~T` in the compiler).

9 years agoImplement the changes to coherence such that we consider a type to be
Niko Matsakis [Mon, 30 Mar 2015 21:46:34 +0000 (17:46 -0400)]
Implement the changes to coherence such that we consider a type to be
local only if matches `FUNDAMENTAL(LocalType)`, where `FUNDAMENTAL`
includes `&T` and types marked as fundamental (which includes `Box`).
Also apply these tests to negative reasoning.

9 years agoSimplify `match` branches in iter.rs example
Corey Farwell [Wed, 1 Apr 2015 01:22:17 +0000 (21:22 -0400)]
Simplify `match` branches in iter.rs example

9 years agoAuto merge of #23109 - nikomatsakis:closure-region-hierarchy, r=pnkfelix
bors [Wed, 1 Apr 2015 14:42:16 +0000 (14:42 +0000)]
Auto merge of #23109 - nikomatsakis:closure-region-hierarchy, r=pnkfelix

Adjust internal treatment of the region hierarchy around closures. Work towards #3696.

r? @pnkfelix

9 years agoUpdate comments
Niko Matsakis [Wed, 1 Apr 2015 12:40:32 +0000 (08:40 -0400)]
Update comments

9 years agoRemove the `Option<>` since when computing LUB since I believe that the
Niko Matsakis [Fri, 6 Mar 2015 02:31:42 +0000 (21:31 -0500)]
Remove the `Option<>` since when computing LUB since I believe that the
case where `None` was returned should never happen in practice; it
amounts to comparing regions from two unrelated hierarchies. (I was also
not able to make it happen.)

9 years agoImplement the new region hierarchy rules, in which regions from distinct
Niko Matsakis [Thu, 5 Mar 2015 11:24:22 +0000 (06:24 -0500)]
Implement the new region hierarchy rules, in which regions from distinct
hierarchies are judged based on the lexical relationship of their
respective fn bodies.

9 years agoAdd a meta-hierarchy of trees -- in future, each fn body will inhabit
Niko Matsakis [Wed, 4 Mar 2015 15:52:39 +0000 (10:52 -0500)]
Add a meta-hierarchy of trees -- in future, each fn body will inhabit
its own disjoint region tree, and the new table encodes the lexical
relationships between those trees.

9 years agoAuto merge of #23936 - pnkfelix:rollup, r=pnkfelix
bors [Wed, 1 Apr 2015 10:02:37 +0000 (10:02 +0000)]
Auto merge of #23936 - pnkfelix:rollup, r=pnkfelix

This is an attempt to fix #23922

9 years agoUpdate android tests to reflect API switch from `os::env` to `env::vars`.
Felix S. Klock II [Wed, 1 Apr 2015 09:59:51 +0000 (11:59 +0200)]
Update android tests to reflect API switch from `os::env` to `env::vars`.

9 years agoTest fixes and rebase conflicts
Alex Crichton [Wed, 1 Apr 2015 01:59:36 +0000 (18:59 -0700)]
Test fixes and rebase conflicts

9 years agoFix rust book error-handling.md for new std::io.
kgv [Wed, 1 Apr 2015 06:37:19 +0000 (09:37 +0300)]
Fix rust book error-handling.md for new std::io.

Fix example and some text for: `read_line` takes `&mut String` and return `Result` instead `IoResult`.

9 years agoAdd examples + documentation for std::path
Steve Klabnik [Wed, 1 Apr 2015 05:11:38 +0000 (01:11 -0400)]
Add examples + documentation for std::path

9 years agoAdded Arc::try_unique
Dzmitry Malyshau [Sun, 29 Mar 2015 21:38:05 +0000 (17:38 -0400)]
Added Arc::try_unique

9 years agoTidying up and reformatting
Nick Cameron [Sun, 29 Mar 2015 23:21:20 +0000 (12:21 +1300)]
Tidying up and reformatting

9 years agorollup merge of #23923: steveklabnik/gh23688
Alex Crichton [Wed, 1 Apr 2015 01:06:42 +0000 (18:06 -0700)]
rollup merge of #23923: steveklabnik/gh23688

Fixes #23688

r? @alexcrichton

9 years agorollup merge of #23921: aturon/issue-17746
Alex Crichton [Wed, 1 Apr 2015 01:06:41 +0000 (18:06 -0700)]
rollup merge of #23921: aturon/issue-17746

Closes #17746

9 years agorollup merge of #23863: pnkfelix/arith-oflo-const-eval
Alex Crichton [Wed, 1 Apr 2015 01:06:35 +0000 (18:06 -0700)]
rollup merge of #23863: pnkfelix/arith-oflo-const-eval

const_eval : add overflow-checking for {`+`, `-`, `*`, `/`, `<<`, `>>`}.

One tricky detail here: There is some duplication of labor between `rustc::middle::const_eval` and `rustc_trans::trans::consts`. It might be good to explore ways to try to factor out the common structure to the two passes (by abstracting over the particular value-representation used in the compile-time interpreter).

----

Update: Rebased atop #23841

Fix #22531

Fix #23030

Fix #23221

Fix #23235

9 years agodealing with fallout to the tests, in particular diffs between 32- vs 64-bit targets.
Felix S. Klock II [Wed, 1 Apr 2015 00:51:45 +0000 (02:51 +0200)]
dealing with fallout to the tests, in particular diffs between 32- vs 64-bit targets.

See also #23926.

9 years agoUnify handling of checking repeat-count validity.
Felix S. Klock II [Wed, 1 Apr 2015 00:40:56 +0000 (02:40 +0200)]
Unify handling of checking repeat-count validity.

9 years agoFixes to compile-fail error messages post-rebase.
Felix S. Klock II [Tue, 31 Mar 2015 22:15:09 +0000 (00:15 +0200)]
Fixes to compile-fail error messages post-rebase.

9 years agoInclude feature `core` to get access to `wrapping_add`.
Felix S. Klock II [Tue, 31 Mar 2015 19:53:12 +0000 (21:53 +0200)]
Include feature `core` to get access to `wrapping_add`.

9 years agoTest cases for checking arithmetic overflow during const eval.
Felix S. Klock II [Mon, 30 Mar 2015 11:26:02 +0000 (13:26 +0200)]
Test cases for checking arithmetic overflow during const eval.

9 years agoFallout from changes for overflow-checking during constant evaluation.
Felix S. Klock II [Sun, 29 Mar 2015 23:23:15 +0000 (01:23 +0200)]
Fallout from changes for overflow-checking during constant evaluation.

9 years agorustc_trans::trans::consts add overflow checking
Felix S. Klock II [Fri, 27 Mar 2015 13:25:48 +0000 (14:25 +0100)]
rustc_trans::trans::consts add overflow checking

9 years agorustc::middle::const_eval : add overflow-checking for {+, -, *}.
Felix S. Klock II [Wed, 25 Mar 2015 10:10:09 +0000 (11:10 +0100)]
rustc::middle::const_eval : add overflow-checking for {+, -, *}.

The overflow-checking attempts to accommodate early evaluation where
we do not have type information yet.

Also, add fixme note about something that has been bothering me.

9 years agorust_llvm: Add way to reflectively ask if a ValueRef is a known constant int.
Felix S. Klock II [Fri, 27 Mar 2015 00:37:10 +0000 (01:37 +0100)]
rust_llvm: Add way to reflectively ask if a ValueRef is a known constant int.

Add option-returning variants to `const_to_int`/`const_to_uint` that
never assert fail. (These will be used for overflow checking from
rustc_trans::trans::consts.)

9 years agoty.rs improve error feedback when const-eval errs during repeat count eval.
Felix S. Klock II [Sat, 28 Mar 2015 17:47:08 +0000 (18:47 +0100)]
ty.rs improve error feedback when const-eval errs during repeat count eval.

9 years agoRefactored ty::ctxt so node_types mutations must go through ty methods.
Felix S. Klock II [Thu, 26 Mar 2015 09:57:42 +0000 (10:57 +0100)]
Refactored ty::ctxt so node_types mutations must go through ty methods.

9 years agoAdded overflowing_{div,rem,shl,shr} method implementations to WrappingOps.
Felix S. Klock II [Fri, 27 Mar 2015 13:17:10 +0000 (14:17 +0100)]
Added overflowing_{div,rem,shl,shr} method implementations to WrappingOps.

9 years agoFix #23890: const-eval `_ as usize`, `_ as isize` must dispatch to target type.
Felix S. Klock II [Tue, 31 Mar 2015 15:55:28 +0000 (17:55 +0200)]
Fix #23890: const-eval `_ as usize`, `_ as isize` must dispatch to target type.

9 years agofix post rebase.
Felix S. Klock II [Mon, 30 Mar 2015 18:20:35 +0000 (20:20 +0200)]
fix post rebase.

9 years agoAdded tests for discriminant overflows.
Felix S. Klock II [Sat, 28 Mar 2015 10:14:06 +0000 (11:14 +0100)]
Added tests for discriminant overflows.

9 years agoAdded type-specific overflow checks when computing enum discriminant values.
Felix S. Klock II [Fri, 27 Mar 2015 00:43:14 +0000 (01:43 +0100)]
Added type-specific overflow checks when computing enum discriminant values.

Moved such overflow checking into one place (in `rustc::middle::ty`,
since it needs to be run on-demand during `const_eval` in some
scenarios), and revised `rustc_typeck` accordingly.

(Note that we only check for overflow if program did not provide a
discriminant value explicitly.)

Fix #23030

Fix #23221

Fix #23235

9 years agoTest fixes and rebase conflicts, round 3
Alex Crichton [Tue, 31 Mar 2015 23:20:09 +0000 (16:20 -0700)]
Test fixes and rebase conflicts, round 3

9 years agoImprovements to PhantomData<T>'s docs 👻
Steve Klabnik [Wed, 1 Apr 2015 00:18:32 +0000 (20:18 -0400)]
Improvements to PhantomData<T>'s docs ðŸ‘»

Fixes #22914

9 years agoAdd description of + for multiple trait bounds
Steve Klabnik [Tue, 31 Mar 2015 23:45:09 +0000 (19:45 -0400)]
Add description of + for multiple trait bounds

Fixes #23688

9 years agoPretty print ids for assoc items
Nick Cameron [Tue, 24 Mar 2015 01:52:55 +0000 (14:52 +1300)]
Pretty print ids for assoc items

9 years agoAdd test for #17746
Aaron Turon [Tue, 31 Mar 2015 23:22:23 +0000 (16:22 -0700)]
Add test for #17746

Closes #17746

9 years agorollup merge of #23919: alexcrichton/stabilize-io-error
Alex Crichton [Tue, 31 Mar 2015 23:18:55 +0000 (16:18 -0700)]
rollup merge of #23919: alexcrichton/stabilize-io-error

Conflicts:
src/libstd/fs/tempdir.rs
src/libstd/io/error.rs

9 years agorollup merge of #23899: steveklabnik/gh23851
Alex Crichton [Tue, 31 Mar 2015 23:18:27 +0000 (16:18 -0700)]
rollup merge of #23899: steveklabnik/gh23851

Conflicts:
src/libcore/iter.rs

9 years agostd: Stabilize last bits of io::Error
Alex Crichton [Tue, 31 Mar 2015 23:01:03 +0000 (16:01 -0700)]
std: Stabilize last bits of io::Error

This commit stabilizes a few remaining bits of the `io::Error` type:

* The `Error::new` method is now stable. The last `detail` parameter was removed
  and the second `desc` parameter was generalized to `E: Into<Box<Error>>` to
  allow creating an I/O error from any form of error. Currently there is no form
  of downcasting, but this will be added in time.

* An implementation of `From<&str> for Box<Error>` was added to liballoc to
  allow construction of errors from raw strings.

* The `Error::raw_os_error` method was stabilized as-is.

* Trait impls for `Clone`, `Eq`, and `PartialEq` were removed from `Error` as it
  is not possible to use them with trait objects.

This is a breaking change due to the modification of the `new` method as well as
the removal of the trait implementations for the `Error` type.

[breaking-change]

9 years agorollup merge of #23920: steveklabnik/gh23881
Alex Crichton [Tue, 31 Mar 2015 23:12:38 +0000 (16:12 -0700)]
rollup merge of #23920: steveklabnik/gh23881

Fixes #23881

9 years agorollup merge of #23901: steveklabnik/fix_links_str
Alex Crichton [Tue, 31 Mar 2015 23:12:36 +0000 (16:12 -0700)]
rollup merge of #23901: steveklabnik/fix_links_str

Remove broken links that should just point to the current page, and while we're at it, re-wrap to 100 chars.

9 years agoMove benchmark tests to unstable section
Steve Klabnik [Tue, 31 Mar 2015 23:02:32 +0000 (19:02 -0400)]
Move benchmark tests to unstable section

Fixes #23881

9 years agorollup merge of #23288: alexcrichton/issue-19470
Alex Crichton [Tue, 31 Mar 2015 22:59:35 +0000 (15:59 -0700)]
rollup merge of #23288: alexcrichton/issue-19470

This is a deprecated attribute that is slated for removal, and it also affects
all implementors of the trait. This commit removes the attribute and fixes up
implementors accordingly. The primary implementation which was lost was the
ability to compare `&[T]` and `Vec<T>` (in that order).

This change also modifies the `assert_eq!` macro to not consider both directions
of equality, only the one given in the left/right forms to the macro. This
modification is motivated due to the fact that `&[T] == Vec<T>` no longer
compiles, causing hundreds of errors in unit tests in the standard library (and
likely throughout the community as well).

Closes #19470
[breaking-change]

9 years agorollup merge of #23908: aturon/stab-more-stragglers
Alex Crichton [Tue, 31 Mar 2015 22:58:58 +0000 (15:58 -0700)]
rollup merge of #23908: aturon/stab-more-stragglers

* The `io::Seek` trait.
* The `Iterator::{partition, unsip}` methods.
* The `Vec::into_boxed_slice` method.
* The `LinkedList::append` method.
* The `{or_insert, or_insert_with` methods in the `Entry` APIs.

r? @alexcrichton

9 years agorollup merge of #23907: alexcrichton/impl-exit
Alex Crichton [Tue, 31 Mar 2015 22:58:57 +0000 (15:58 -0700)]
rollup merge of #23907: alexcrichton/impl-exit

This commit is an implementation of [RFC #1011][rfc] which adds an `exit`
function to the standard library for immediately terminating the current process
with a specified exit code.

[rfc]: https://github.com/rust-lang/rfcs/pull/1011

Closes #23914

9 years agorollup merge of #23906: steveklabnik/spellin
Alex Crichton [Tue, 31 Mar 2015 22:58:57 +0000 (15:58 -0700)]
rollup merge of #23906: steveklabnik/spellin

9 years agorollup merge of #23902: freebroccolo/master
Alex Crichton [Tue, 31 Mar 2015 22:58:57 +0000 (15:58 -0700)]
rollup merge of #23902: freebroccolo/master

9 years agoTest fixes and rebase conflicts, round 2
Alex Crichton [Tue, 31 Mar 2015 18:41:18 +0000 (11:41 -0700)]
Test fixes and rebase conflicts, round 2

9 years agorollup merge of #23873: alexcrichton/remove-deprecated
Alex Crichton [Tue, 31 Mar 2015 18:34:17 +0000 (11:34 -0700)]
rollup merge of #23873: alexcrichton/remove-deprecated

Conflicts:
src/libcollectionstest/fmt.rs
src/libcollectionstest/lib.rs
src/libcollectionstest/str.rs
src/libcore/error.rs
src/libstd/fs.rs
src/libstd/io/cursor.rs
src/libstd/os.rs
src/libstd/process.rs
src/libtest/lib.rs
src/test/run-pass-fulldeps/compiler-calls.rs

9 years agorollup merge of #23879: seanmonstar/del-from-error
Alex Crichton [Tue, 31 Mar 2015 18:27:21 +0000 (11:27 -0700)]
rollup merge of #23879: seanmonstar/del-from-error

Conflicts:
src/libcore/error.rs

9 years agorollup merge of #23875: aturon/revise-convert-2
Alex Crichton [Tue, 31 Mar 2015 18:26:10 +0000 (11:26 -0700)]
rollup merge of #23875: aturon/revise-convert-2

* Marks `#[stable]` the contents of the `std::convert` module.

* Added methods `PathBuf::as_path`, `OsString::as_os_str`,
  `String::as_str`, `Vec::{as_slice, as_mut_slice}`.

* Deprecates `OsStr::from_str` in favor of a new, stable, and more
  general `OsStr::new`.

* Adds unstable methods `OsString::from_bytes` and `OsStr::{to_bytes,
  to_cstring}` for ergonomic FFI usage.

[breaking-change]

r? @alexcrichton

9 years agoTest fixes and rebase conflicts, round 1
Alex Crichton [Tue, 31 Mar 2015 17:26:25 +0000 (10:26 -0700)]
Test fixes and rebase conflicts, round 1

9 years agorollup merge of #23872: huonw/eager-lexing
Alex Crichton [Tue, 31 Mar 2015 17:16:54 +0000 (10:16 -0700)]
rollup merge of #23872: huonw/eager-lexing

Conflicts:
src/libsyntax/parse/lexer/mod.rs

9 years agostd: Clean out #[deprecated] APIs
Alex Crichton [Mon, 30 Mar 2015 18:00:05 +0000 (11:00 -0700)]
std: Clean out #[deprecated] APIs

This commit cleans out a large amount of deprecated APIs from the standard
library and some of the facade crates as well, updating all users in the
compiler and in tests as it goes along.

9 years agorollup merge of #23893: frewsxcv/patch-6
Alex Crichton [Tue, 31 Mar 2015 17:15:35 +0000 (10:15 -0700)]
rollup merge of #23893: frewsxcv/patch-6

9 years agorollup merge of #23886: demelev/remove_as_slice_usage
Alex Crichton [Tue, 31 Mar 2015 17:15:35 +0000 (10:15 -0700)]
rollup merge of #23886: demelev/remove_as_slice_usage

9 years agorollup merge of #23885: steveklabnik/doc_std_env
Alex Crichton [Tue, 31 Mar 2015 17:15:33 +0000 (10:15 -0700)]
rollup merge of #23885: steveklabnik/doc_std_env

Just one or two things to finish this module off

9 years agorollup merge of #23882: wettowelreactor/patch-2
Alex Crichton [Tue, 31 Mar 2015 17:15:33 +0000 (10:15 -0700)]
rollup merge of #23882: wettowelreactor/patch-2

Removed duplicate words

9 years agorollup merge of #23878: Ryman/stable_extremes
Alex Crichton [Tue, 31 Mar 2015 17:15:32 +0000 (10:15 -0700)]
rollup merge of #23878: Ryman/stable_extremes

`min`-like functions now return the leftmost element/input for equal elements.
`max`-like return the rightmost.

Closes #23687.

cc @HeroesGrave, @aturon, @alexcrichton

9 years agorollup merge of #23876: alexcrichton/stabilize-any
Alex Crichton [Tue, 31 Mar 2015 17:15:32 +0000 (10:15 -0700)]
rollup merge of #23876: alexcrichton/stabilize-any

This commit stabilizes the following APIs:

* `TypeId::of` - now that it has an `Any` bound it's ready to be stable.
* `Box<Any>::downcast` - now that an inherent impl on `Box<Any>` as well as
  `Box<Any+Send>` is allowed the `BoxAny` trait is removed in favor of these
  inherent methods.

This is a breaking change due to the removal of the `BoxAny` trait, but
consumers can simply remove imports to fix crates.

[breaking-change]

9 years agorollup merge of #23766: alexcrichton/stabilize-raw-fd
Alex Crichton [Tue, 31 Mar 2015 17:15:29 +0000 (10:15 -0700)]
rollup merge of #23766: alexcrichton/stabilize-raw-fd

This commit stabilizes the platform-specific `io` modules, specifically around
the traits having to do with the raw representation of each object on each
platform.

Specifically, the following material was stabilized:

* `AsRaw{Fd,Socket,Handle}`
* `RawFd` (renamed from `Fd`)
* `RawHandle` (renamed from `Handle`)
* `RawSocket` (renamed from `Socket`)
* `AsRaw{Fd,Socket,Handle}` implementations
* `std::os::{unix, windows}::io`

The following material was added as `#[unstable]`:

* `FromRaw{Fd,Socket,Handle}`
* Implementations for various primitives

There are a number of future improvements that are possible to make to this
module, but this should cover a good bit of functionality desired from these
modules for now. Some specific future additions may include:

* `IntoRawXXX` traits to consume the raw representation and cancel the
  auto-destructor.
* `Fd`, `Socket`, and `Handle` abstractions that behave like Rust objects and
  have nice methods for various syscalls.

At this time though, these are considered backwards-compatible extensions and
will not be stabilized at this time.

This commit is a breaking change due to the addition of `Raw` in from of the
type aliases in each of the platform-specific modules.

[breaking-change]