Commit Graph

40807 Commits

Author SHA1 Message Date
Alex Crichton
bb252a8878 rollup merge of #23948: nikomatsakis/feature-gate-rust-abi
Like it says.

r? @alexcrichton
2015-04-01 13:56:19 -07:00
Felix S. Klock II
1c11748a54 fix typo. 2015-04-01 22:55:26 +02:00
Dave Huseby
f0a9a0ca7b manually adding the last two bitrig snapshots 2015-04-01 13:47:09 -07:00
Aaron Turon
371277fb0d 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]
2015-04-01 13:43:45 -07:00
Felix S. Klock II
a98e4713bf removed impls of Neg for u{8,16,32,64,size}. 2015-04-01 22:35:50 +02:00
Felix S. Klock II
98dd376f9c fallout when bootstrapping rustc. 2015-04-01 22:35:50 +02:00
Felix S. Klock II
3225b04c7d fallout from feature-gating unary negation on unsigned integers. 2015-04-01 22:34:27 +02:00
Felix S. Klock II
d8e309320d added unary_negate feature gate. 2015-04-01 22:34:26 +02:00
Alex Crichton
9bb05fd414 rollup merge of #23939: nikomatsakis/fn-box
Conflicts:
	src/liballoc/boxed.rs
2015-04-01 13:30:51 -07:00
Alex Crichton
e9bacbaa2c 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]
2015-04-01 13:30:08 -07:00
Alex Crichton
e98dce3e00 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]
2015-04-01 13:29:42 -07:00
Alex Crichton
fb4029f8ea 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
2015-04-01 13:22:16 -07:00
Alex Crichton
d55ffa9358 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
2015-04-01 13:22:15 -07:00
Alex Crichton
a3e5b357a4 rollup merge of #23942: vhbit/ios-rand 2015-04-01 13:22:15 -07:00
Alex Crichton
fd182f41dc 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
2015-04-01 13:22:12 -07:00
Alex Crichton
a3f6273795 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.
2015-04-01 13:22:10 -07:00
Alex Crichton
232e79fb91 rollup merge of #23568: steveklabnik/closure_docs
[rendered](https://github.com/steveklabnik/rust/blob/closure_docs/src/doc/trpl/closures.md)

r? @nikomatsakis
2015-04-01 13:22:09 -07:00
Niko Matsakis
3d8df31540 Path rustdoc test 2015-04-01 16:18:56 -04:00
Richo Healey
971c355bad rustup: Fix typo in nightly 2015-04-01 13:18:25 -07:00
Niko Matsakis
8eed73feb6 Remove TODO 2015-04-01 16:03:33 -04:00
Niko Matsakis
d81e86622c Feature gate rust-call ABI. 2015-04-01 15:59:50 -04:00
Niko Matsakis
449643301c Fix enum timezone across all platforms. 2015-04-01 15:57:02 -04:00
Aaron Turon
c0f86a953c 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.
2015-04-01 12:41:25 -07:00
Niko Matsakis
19d3dab31b 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.
2015-04-01 15:25:47 -04:00
Steve Klabnik
eac94fa097 Re-write closures chapter 2015-04-01 15:21:03 -04:00
Manish Goregaokar
ec6c2c3fc5 Rollup merge of #23932 - steveklabnik:doc_std_path, r=flaper87 2015-04-02 00:40:40 +05:30
Manish Goregaokar
77112bbe4f Rollup merge of #23927 - frewsxcv:patch-7, r=Manishearth 2015-04-02 00:40:40 +05:30
Manish Goregaokar
2159bbf650 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
2015-04-02 00:40:39 +05:30
Manish Goregaokar
6a3e8447eb Rollup merge of #23924 - nrc:unqual-assoc3, r=alexcrichton
Basically stuff I did for unqualified assoc types which is worth landing by itself.
2015-04-02 00:40:39 +05:30
Manish Goregaokar
debac97a10 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.
2015-04-02 00:40:39 +05:30
Manish Goregaokar
9eb0bab9de 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.
2015-04-02 00:40:38 +05:30
Manish Goregaokar
abd747cd15 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().
2015-04-02 00:40:38 +05:30
Manish Goregaokar
1d17e6eb1e 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.
2015-04-02 00:40:38 +05:30
Manish Goregaokar
02b38a2497 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
2015-04-02 00:40:38 +05:30
Niko Matsakis
cade32acf6 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)`.
2015-04-01 14:41:21 -04:00
Niko Matsakis
ed63d32651 Add (unstable) FnBox trait as a nicer replacement for Thunk. The doc
comment includes a test that also shows how it can be used.
2015-04-01 14:40:44 -04:00
Richo Healey
85c74c6305 cleanup: Test formatting 2015-04-01 11:04:09 -07:00
Richo Healey
a01138cb4f std: Unignore a test for #10663
This issue is long closed. It seems that unwrapping will always panic
though.
2015-04-01 11:04:09 -07:00
Alex Crichton
63f3d7f0fa rustup: Default to the beta channel
Switches rustup to using the beta channel by default
2015-04-01 11:04:03 -07:00
Valerii Hiora
28d7693930 iOS: os::last_os_error() fallout 2015-04-01 20:38:58 +03:00
Alex Crichton
c054ae2fa4 Merge branch 'fix-rustup' of https://github.com/richo/rust 2015-04-01 10:30:11 -07:00
Niko Matsakis
943729fa40 Missing imports 2015-04-01 12:49:02 -04:00
Niko Matsakis
c35c46821a Fallout in public-facing and semi-public-facing libs 2015-04-01 11:23:45 -04:00
Niko Matsakis
49b76a087b Fallout in libsyntax 2015-04-01 11:22:39 -04:00
Niko Matsakis
d9530c01a7 Fallout out rustc 2015-04-01 11:22:39 -04:00
Niko Matsakis
890ed5c468 Fallout in tests 2015-04-01 11:22:39 -04:00
Niko Matsakis
c4edd0c8df Make the trait Copy extend Clone. 2015-04-01 11:22:38 -04:00
Niko Matsakis
15b58fedca 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.
2015-04-01 11:21:42 -04:00
Niko Matsakis
30b2d9e764 Fallout in libstd: remove impls now considered to conflict. 2015-04-01 11:21:42 -04:00
Niko Matsakis
b0af587b64 Update tests for new coherence rules, and add a swatch of new tests
probing the specifics of `Fundamental`.

Fixes #23086.
Fixes #23516.
2015-04-01 11:21:42 -04:00