]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoChange the type of constants BYTES/BITS to usize
Vadim Petrochenkov [Sat, 28 Mar 2015 12:57:49 +0000 (15:57 +0300)]
Change the type of constants BYTES/BITS to usize

9 years agoAuto merge of #23838 - kgv:master, r=steveklabnik
bors [Mon, 30 Mar 2015 04:22:38 +0000 (04:22 +0000)]
Auto merge of #23838 - kgv:master, r=steveklabnik

Remove the last sentence about standard io chapter.

Additional Fixes #23760

9 years agoAuto merge of #23837 - wesleywiser:patch-1, r=alexcrichton
bors [Mon, 30 Mar 2015 01:31:34 +0000 (01:31 +0000)]
Auto merge of #23837 - wesleywiser:patch-1, r=alexcrichton

Fixes #23397

9 years agoAuto merge of #23830 - petrochenkov:spellcheck, r=steveklabnik
bors [Sun, 29 Mar 2015 22:39:46 +0000 (22:39 +0000)]
Auto merge of #23830 - petrochenkov:spellcheck, r=steveklabnik

With help of https://github.com/lucasdemarchi/codespell

r? @steveklabnik

9 years agoRemove about standard io chapter from the book (from arrays-vectors-and-slices chapter)
kgv [Sun, 29 Mar 2015 20:26:31 +0000 (23:26 +0300)]
Remove about standard io chapter from the book (from arrays-vectors-and-slices chapter)

Remove the last sentence about standard io chapter.

Additional Fixes #23760

9 years agoAuto merge of #23820 - sfackler:fast_read_to_end, r=alexcrichton
bors [Sun, 29 Mar 2015 19:47:18 +0000 (19:47 +0000)]
Auto merge of #23820 - sfackler:fast_read_to_end, r=alexcrichton

with_end_to_cap is enormously expensive now that it's initializing
memory since it involves 64k allocation + memset on every call. This is
most noticable when calling read_to_end on very small readers, where the
new version if **4 orders of magnitude** faster.

BufReader also depended on with_end_to_cap so I've rewritten it in its
original form.

As a bonus, converted the buffered IO struct Debug impls to use the
debug builders.

I first came across this in sfackler/rust-postgres#106 where a user reported a 10x performance regression. A call to read_to_end turned out to be the culprit: https://github.com/sfackler/rust-postgres/commit/9cd413d42c287154d6c64cc7913666b0517f35f3.

The new version differs from the old in a couple of ways. The buffer size used is now adaptive. It starts at 32 bytes and doubles each time EOF hasn't been reached up to a limit of 64k. In addition, the buffer is only truncated when EOF or an error has been reached, rather than after every call to read as was the case for the old implementation.

I wrote up a benchmark to compare the old version and new version: https://gist.github.com/sfackler/e979711b0ee2f2063462

It tests a couple of different cases: a high bandwidth reader, a low bandwidth reader, and a low bandwidth reader that won't return more than 10k per call to `read`. The high bandwidth reader should be analagous to use cases when reading from e.g. a `BufReader` or `Vec`, and the low bandwidth readers should be analogous to reading from something like a `TcpStream`.

Of special note, reads from a high bandwith reader containing 4 bytes are now *4,495 times faster*.
```
~/foo ❯ cargo bench
   Compiling foo v0.0.1 (file:///home/sfackler/foo)
     Running target/release/foo-7498d7dd7faecf5c

running 13 tests
test test_new ... ignored
test new_delay_4      ... bench:    230768 ns/iter (+/- 14812)
test new_delay_4_cap  ... bench:    231421 ns/iter (+/- 7211)
test new_delay_5m     ... bench:  14495370 ns/iter (+/- 4008648)
test new_delay_5m_cap ... bench:  73127954 ns/iter (+/- 59908587)
test new_nodelay_4    ... bench:        83 ns/iter (+/- 2)
test new_nodelay_5m   ... bench:  12527237 ns/iter (+/- 335243)
test std_delay_4      ... bench:    373095 ns/iter (+/- 12613)
test std_delay_4_cap  ... bench:    374190 ns/iter (+/- 19611)
test std_delay_5m     ... bench:  17356012 ns/iter (+/- 15906588)
test std_delay_5m_cap ... bench: 883555035 ns/iter (+/- 205559857)
test std_nodelay_4    ... bench:    144937 ns/iter (+/- 2448)
test std_nodelay_5m   ... bench:  16095893 ns/iter (+/- 3315116)

test result: ok. 0 passed; 0 failed; 1 ignored; 12 measured
```

r? @alexcrichton

9 years agoFix extremely small stability bars on docs page
Wesley Wiser [Sun, 29 Mar 2015 19:14:02 +0000 (15:14 -0400)]
Fix extremely small stability bars on docs page

Fixes #23397

9 years agoAuto merge of #23816 - frewsxcv:fromiterator-example, r=Manishearth
bors [Sun, 29 Mar 2015 16:54:40 +0000 (16:54 +0000)]
Auto merge of #23816 - frewsxcv:fromiterator-example, r=Manishearth

9 years agoAdd an example for FromIterator::from_iter
Corey Farwell [Sat, 28 Mar 2015 21:28:58 +0000 (17:28 -0400)]
Add an example for FromIterator::from_iter

9 years agoAuto merge of #23831 - Manishearth:rollup, r=Manishearth
bors [Sun, 29 Mar 2015 14:02:28 +0000 (14:02 +0000)]
Auto merge of #23831 - Manishearth:rollup, r=Manishearth

- Successful merges: #23811, #23814, #23817, #23821, #23829
- Failed merges:

9 years agoRollup merge of #23829 - huachaohuang:master, r=Manishearth
Manish Goregaokar [Sun, 29 Mar 2015 12:52:16 +0000 (18:22 +0530)]
Rollup merge of #23829 - huachaohuang:master, r=Manishearth

9 years agoRollup merge of #23821 - nicholasbishop:bishop-slice-iter-typo-fix, r=alexcrichton
Manish Goregaokar [Sun, 29 Mar 2015 12:52:16 +0000 (18:22 +0530)]
Rollup merge of #23821 - nicholasbishop:bishop-slice-iter-typo-fix, r=alexcrichton

9 years agoRollup merge of #23817 - phildawes:master, r=alexcrichton
Manish Goregaokar [Sun, 29 Mar 2015 12:52:16 +0000 (18:22 +0530)]
Rollup merge of #23817 - phildawes:master, r=alexcrichton

Hello! I noticed that the email address in AUTHORS.txt doesn't point to my home email. Could somebody merge this patch to correct it please?

Thanks very much!

9 years agoRollup merge of #23814 - steveklabnik:gh23320, r=alexcrichton
Manish Goregaokar [Sun, 29 Mar 2015 12:52:15 +0000 (18:22 +0530)]
Rollup merge of #23814 - steveklabnik:gh23320, r=alexcrichton

Fixes #23320

9 years agoRollup merge of #23811 - alexcrichton:libc-stable, r=Manishearth
Manish Goregaokar [Sun, 29 Mar 2015 12:52:15 +0000 (18:22 +0530)]
Rollup merge of #23811 - alexcrichton:libc-stable, r=Manishearth

Right now the `std::isize::BYTES` typedef is `#[unstable]`, but liblibc is using
this, preventing it from compiling on stable Rust.

9 years agoAuto merge of #23809 - cmr:issue-21310, r=Manishearth
bors [Sun, 29 Mar 2015 11:12:26 +0000 (11:12 +0000)]
Auto merge of #23809 - cmr:issue-21310, r=Manishearth

This isn't really possible to test in an automatic way, since the only traits
you can negative impl are `Send` and `Sync`, and the implementors page for
those only exists in libstd.

Closes #21310

9 years agoFix typo
Huachao Huang [Sun, 29 Mar 2015 10:22:01 +0000 (18:22 +0800)]
Fix typo

9 years agoAuto merge of #23787 - steveklabnik:gh23760, r=alexcrichton
bors [Sun, 29 Mar 2015 08:14:30 +0000 (08:14 +0000)]
Auto merge of #23787 - steveklabnik:gh23760, r=alexcrichton

This was originally used to set up the guessing game, but that no longer
exists. This version uses `old_io`, and updating it involves talking
about `&mut` and such, which we haven't covered yet. So, for now, let's
just remove it.

Fixes #23760

9 years agoFix massive performance issue in read_to_end
Steven Fackler [Sun, 29 Mar 2015 01:47:29 +0000 (18:47 -0700)]
Fix massive performance issue in read_to_end

with_end_to_cap is enormously expensive now that it's initializing
memory since it involves 64k allocation + memset on every call. This is
most noticable when calling read_to_end on very small readers, where the
new version if **4 orders of magnitude** faster.

BufReader also depended on with_end_to_cap so I've rewritten it in its
original form.

As a bonus, converted the buffered IO struct Debug impls to use the
debug builders.

Fixes #23815

9 years agoAuto merge of #23810 - sfackler:debug-collections, r=alexcrichton
bors [Sun, 29 Mar 2015 05:21:29 +0000 (05:21 +0000)]
Auto merge of #23810 - sfackler:debug-collections, r=alexcrichton

The collections debug helpers no longer prefix output with the
collection name, in line with the current conventions for Debug
implementations. Implementations that want to preserve the current
behavior can simply add a `try!(write!(fmt, "TypeName "));` at the
beginning of the `fmt` method.

[breaking-change]

9 years agoOops fix output examples
Steven Fackler [Sat, 28 Mar 2015 22:55:02 +0000 (15:55 -0700)]
Oops fix output examples

9 years agoAuto merge of #23819 - pnkfelix:kill-unsafe-dtor, r=pnkfelix
bors [Sun, 29 Mar 2015 02:33:27 +0000 (02:33 +0000)]
Auto merge of #23819 - pnkfelix:kill-unsafe-dtor, r=pnkfelix

Port of pcwalton removal of `#[unsafe_destructor]` check.

Earlier commits impose rules on lifetimes that make generic destructors safe; thus we no longer need the `#[unsafe_destructor]` attribute nor its associated check.

----

So remove the check for the unsafe_destructor attribute.

And remove outdated compile-fail tests from when lifetime-parameteric dtors were disallowed/unsafe.

In addition, when one uses the attribute without the associated feature, report that the attribute is deprecated.

However, I do not think this is a breaking-change, because the attribute and feature are still currently accepted by the compiler. (After the next snapshot that has this commit, we can remove the feature itself and the attribute as well.)

----

I consider this to:

Fix #22196

(technically there is still the post snapshot work of removing the last remnants of the feature and the attribute, but the ticket can still be closed in my opinion).

9 years agoFix typo in docstring for slice
Nicholas Bishop [Sun, 29 Mar 2015 02:06:42 +0000 (22:06 -0400)]
Fix typo in docstring for slice

9 years agoPort of pcwalton removal of `#[unsafe_destructor]` check.
Felix S. Klock II [Mon, 27 Oct 2014 11:57:14 +0000 (12:57 +0100)]
Port of pcwalton removal of `#[unsafe_destructor]` check.

Earlier commits impose rules on lifetimes that make generic
destructors safe; thus we no longer need the `#[unsafe_destructor]`
attribute nor its associated check.

----

So remove the check for the unsafe_destructor attribute.

And remove outdated compile-fail tests from when lifetime-parameteric
dtors were disallowed/unsafe.

In addition, when one uses the attribute without the associated
feature, report that the attribute is deprecated.

However, I do not think this is a breaking-change, because the
attribute and feature are still currently accepted by the compiler.
(After the next snapshot that has this commit, we can remove the
feature itself and the attribute as well.)

----

I consider this to:

Fix #22196

(techincally there is still the post snapshot work of removing the
last remants of the feature and the attribute, but the ticket can
still be closed in my opinion).

9 years agoFold in debug builder doc examples
Steven Fackler [Sat, 28 Mar 2015 18:30:03 +0000 (11:30 -0700)]
Fold in debug builder doc examples

9 years agoCorrect Phil Dawes email address
Phil Dawes [Sat, 28 Mar 2015 22:18:03 +0000 (22:18 +0000)]
Correct Phil Dawes email address

9 years agoAuto merge of #23300 - sfackler:rm-iterator-ext, r=alexcrichton
bors [Sat, 28 Mar 2015 22:11:49 +0000 (22:11 +0000)]
Auto merge of #23300 - sfackler:rm-iterator-ext, r=alexcrichton

All methods are inlined into Iterator with `Self: Sized` bounds to make
sure Iterator is still object safe.

[breaking-change]

This is blocked on ICEs: https://gist.github.com/sfackler/5aff7c57cf8d896e2c6f
Seem to be similar to #23281.

9 years agoRemove IteratorExt
Steven Fackler [Thu, 12 Mar 2015 05:41:24 +0000 (22:41 -0700)]
Remove IteratorExt

All methods are inlined into Iterator with `Self: Sized` bounds to make
sure Iterator is still object safe.

[breaking-change]

9 years agoDocument properties for Eq + Hash
Steve Klabnik [Sat, 28 Mar 2015 20:06:37 +0000 (16:06 -0400)]
Document properties for Eq + Hash

Fixes #23320

9 years agoRemove standard io chapter from the book
Steve Klabnik [Fri, 27 Mar 2015 18:31:26 +0000 (14:31 -0400)]
Remove standard io chapter from the book

This was originally used to set up the guessing game, but that no longer
exists. This version uses `old_io`, and updating it involves talking
about `&mut` and such, which we haven't covered yet. So, for now, let's
just remove it.

Fixes #23760

9 years agoFold collections debug impls
Steven Fackler [Sat, 28 Mar 2015 18:24:26 +0000 (11:24 -0700)]
Fold collections debug impls

Also convert [T]'s Debug impl. The behavior of the alternate flag here's
changing.

9 years agolibc: Don't use unstable apis
Alex Crichton [Sat, 28 Mar 2015 17:49:45 +0000 (10:49 -0700)]
libc: Don't use unstable apis

Right now the `std::isize::BYTES` typedef is `#[unstable]`, but liblibc is using
this, preventing it from compiling on stable Rust.

9 years agoUpdate debug helpers and add list builder
Steven Fackler [Fri, 27 Mar 2015 05:42:29 +0000 (22:42 -0700)]
Update debug helpers and add list builder

The collections debug helpers no longer prefix output with the
collection name, in line with the current conventions for Debug
implementations. Implementations that want to preserve the current
behavior can simply add a `try!(write!(fmt, "TypeName "));` at the
beginning of the `fmt` method.

[breaking-change]

9 years agoAuto merge of #23807 - vhbit:ios-int-drop, r=alexcrichton
bors [Sat, 28 Mar 2015 17:14:44 +0000 (17:14 +0000)]
Auto merge of #23807 - vhbit:ios-int-drop, r=alexcrichton

None

9 years agoiOS: int/uint fallout
Valerii Hiora [Sat, 28 Mar 2015 15:18:03 +0000 (17:18 +0200)]
iOS: int/uint fallout

9 years agoFix some typos
Vadim Petrochenkov [Sat, 28 Mar 2015 15:09:51 +0000 (18:09 +0300)]
Fix some typos

9 years agoAuto merge of #23806 - Manishearth:rollup, r=Manishearth
bors [Sat, 28 Mar 2015 12:42:45 +0000 (12:42 +0000)]
Auto merge of #23806 - Manishearth:rollup, r=Manishearth

- Successful merges: #23332, #23751, #23788, #23803, #23804
- Failed merges:

9 years agoRollup merge of #23804 - dnwade:patch-1, r=Manishearth
Manish Goregaokar [Sat, 28 Mar 2015 12:42:06 +0000 (18:12 +0530)]
Rollup merge of #23804 - dnwade:patch-1, r=Manishearth

r? @steveklabnik

9 years agoRollup merge of #23803 - richo:unused-braces, r=Manishearth
Manish Goregaokar [Sat, 28 Mar 2015 12:42:06 +0000 (18:12 +0530)]
Rollup merge of #23803 - richo:unused-braces, r=Manishearth

Pretty much what it says on the tin.

9 years agoRollup merge of #23788 - steveklabnik:gh23748, r=alexcrichton
Manish Goregaokar [Sat, 28 Mar 2015 12:42:04 +0000 (18:12 +0530)]
Rollup merge of #23788 - steveklabnik:gh23748, r=alexcrichton

Fixes #23748

9 years agoRollup merge of #23751 - tshepang:do-not-hardcode-the-growth, r=Manishearth
Manish Goregaokar [Sat, 28 Mar 2015 12:42:04 +0000 (18:12 +0530)]
Rollup merge of #23751 - tshepang:do-not-hardcode-the-growth, r=Manishearth

I found the arbitrary `10` surprising. A better method name, in such a case, would be `grow_by_10` :)

9 years agoRollup merge of #23332 - jakub-:rustup-curl-silent-flag, r=brson
Manish Goregaokar [Sat, 28 Mar 2015 12:42:04 +0000 (18:12 +0530)]
Rollup merge of #23332 - jakub-:rustup-curl-silent-flag, r=brson

curl's progress meter would otherwise interfere with sudo's password prompt.

In addition, add the -f flag to make sure 4xx status codes are treated as errors.

r? @brson

9 years agobook: Fix typo
Dan W. [Sat, 28 Mar 2015 10:31:51 +0000 (03:31 -0700)]
book: Fix typo

r? @steveklabnik

9 years agocleanup: Remove unused braces in use statements
Richo Healey [Sat, 28 Mar 2015 09:23:20 +0000 (02:23 -0700)]
cleanup: Remove unused braces in use statements

9 years agoAuto merge of #23799 - reem:error-no-send, r=aturon
bors [Sat, 28 Mar 2015 09:09:50 +0000 (09:09 +0000)]
Auto merge of #23799 - reem:error-no-send, r=aturon

The Send bound is an unnecessary restriction, and though provided as a convenience, can't be removed by downstream code.

The removal of this bound is a [breaking-change] since it removes an implicit Send bound on all `E: Error` and all `Error` trait objects.

To migrate, consider if your code actually requires the Send bound and, if so, add it explicitly.

Fixes #23774

r? @aturon

9 years agoAuto merge of #23798 - alexcrichton:issue-23781, r=aturon
bors [Sat, 28 Mar 2015 05:43:12 +0000 (05:43 +0000)]
Auto merge of #23798 - alexcrichton:issue-23781, r=aturon

Previously a panic was generated for recursive prints due to a double-borrow of
a `RefCell`. This was solved by the second borrow's output being directed
towards the global stdout instead of the per-thread stdout (still experimental
functionality).

After this functionality was altered, however, recursive prints still deadlocked
due to the overridden `write_fmt` method which locked itself first and then
wrote all the data. This was fixed by removing the override of the `write_fmt`
method. This means that unlocked usage of `write!` on a `Stdout`/`Stderr` may be
slower due to acquiring more locks, but it's easy to make more performant with a
call to `.lock()`.

Closes #23781

9 years agostd: Don't deadlock/panic on recursive prints
Alex Crichton [Fri, 27 Mar 2015 23:25:49 +0000 (16:25 -0700)]
std: Don't deadlock/panic on recursive prints

Previously a panic was generated for recursive prints due to a double-borrow of
a `RefCell`. This was solved by the second borrow's output being directed
towards the global stdout instead of the per-thread stdout (still experimental
functionality).

After this functionality was altered, however, recursive prints still deadlocked
due to the overridden `write_fmt` method which locked itself first and then
wrote all the data. This was fixed by removing the override of the `write_fmt`
method. This means that unlocked usage of `write!` on a `Stdout`/`Stderr` may be
slower due to acquiring more locks, but it's easy to make more performant with a
call to `.lock()`.

Closes #23781

9 years agoAuto merge of #23789 - steveklabnik:gh22716, r=alexcrichton
bors [Sat, 28 Mar 2015 01:55:50 +0000 (01:55 +0000)]
Auto merge of #23789 - steveklabnik:gh22716, r=alexcrichton

Fixes #22716

9 years agoMake `std::error::Error` not inherit from Send
Jonathan Reem [Fri, 27 Mar 2015 23:35:16 +0000 (16:35 -0700)]
Make `std::error::Error` not inherit from Send

The Send bound is an unnecessary restriction, and though provided as a
convenience, can't be removed by downstream code.

The removal of this bound is a [breaking-change] since it
removes an implicit Send bound on all `E: Error` and all
`Error` trait objects.

To migrate, consider if your code actually requires the Send
bound and, if so, add it explicitly.

Fixes #23774

9 years agoAuto merge of #23796 - alexcrichton:rollup, r=alexcrichton
bors [Fri, 27 Mar 2015 23:11:21 +0000 (23:11 +0000)]
Auto merge of #23796 - alexcrichton:rollup, r=alexcrichton

9 years agorollup merge of #23786: alexcrichton/less-quotes
Alex Crichton [Fri, 27 Mar 2015 21:33:46 +0000 (14:33 -0700)]
rollup merge of #23786: alexcrichton/less-quotes

Conflicts:
src/test/auxiliary/static-function-pointer-aux.rs
src/test/auxiliary/trait_default_method_xc_aux.rs
src/test/run-pass/issue-4545.rs

9 years agorollup merge of #23763: brson/installer
Alex Crichton [Fri, 27 Mar 2015 21:32:55 +0000 (14:32 -0700)]
rollup merge of #23763: brson/installer

9 years agoTest fixes and rebase conflicts, round 3
Alex Crichton [Fri, 27 Mar 2015 21:09:28 +0000 (14:09 -0700)]
Test fixes and rebase conflicts, round 3

9 years agorollup merge of #23794: brson/slicegate
Alex Crichton [Fri, 27 Mar 2015 20:44:40 +0000 (13:44 -0700)]
rollup merge of #23794: brson/slicegate

Conflicts:
src/test/run-pass/issue-13027.rs

9 years agoNote that zip and enumerate are similar
Steve Klabnik [Fri, 27 Mar 2015 18:58:22 +0000 (14:58 -0400)]
Note that zip and enumerate are similar

Fixes #22716

9 years agoExplain why &self is common
Steve Klabnik [Fri, 27 Mar 2015 18:48:13 +0000 (14:48 -0400)]
Explain why &self is common

Fixes #23748

9 years agorustdoc: show negative impls properly in the implementors page
Corey Richardson [Fri, 27 Mar 2015 21:29:07 +0000 (17:29 -0400)]
rustdoc: show negative impls properly in the implementors page

This isn't really possible to test in an automatic way, since the only traits
you can negative impl are `Send` and `Sync`, and the implementors page for
those only exists in libstd.

Closes #21310

9 years agoTest fixes and rebase conflicts, round 2
Alex Crichton [Fri, 27 Mar 2015 20:22:26 +0000 (13:22 -0700)]
Test fixes and rebase conflicts, round 2

9 years agorollup merge of #23793: steveklabnik/gh21668
Alex Crichton [Fri, 27 Mar 2015 20:04:38 +0000 (13:04 -0700)]
rollup merge of #23793: steveklabnik/gh21668

Fixes #21668

9 years agorollup merge of #23197: aatxe/master
Alex Crichton [Fri, 27 Mar 2015 20:04:27 +0000 (13:04 -0700)]
rollup merge of #23197: aatxe/master

`std::dynamic_library` is currently using `std::old_io::Path` specifically. This change brings the API in alignment with `std::fs::File` by having it take `std::path::AsPath`. The Windows code should work, but I admittedly haven't tried it (I don't have a Windows machine readily available right now).

r? @alexcrichton

9 years agoFeature gate *all* slice patterns. #23121
Brian Anderson [Fri, 27 Mar 2015 01:34:27 +0000 (18:34 -0700)]
Feature gate *all* slice patterns. #23121

Until some backwards-compatibility hazards are fixed in #23121,
these need to be unstable.

[breaking-change]

9 years agorollup merge of #23791: jviereck/fix-23713
Alex Crichton [Fri, 27 Mar 2015 19:44:10 +0000 (12:44 -0700)]
rollup merge of #23791: jviereck/fix-23713

Fixes #23713.

9 years agorollup merge of #23665: steveklabnik/doc_std_ascii
Alex Crichton [Fri, 27 Mar 2015 19:44:02 +0000 (12:44 -0700)]
rollup merge of #23665: steveklabnik/doc_std_ascii

Also tweaked a few things.

9 years agorollup merge of #23486: nikomatsakis/issue-23485
Alex Crichton [Fri, 27 Mar 2015 19:44:00 +0000 (12:44 -0700)]
rollup merge of #23486: nikomatsakis/issue-23485

When testing whether a default method predicates are satisfiable,
combine normalization with this check so that we also skip the
default method if normalization fails. Fixes #23485.

r? @nrc (I tried to address your nit from before as well)

9 years agorollup merge of #23285: steveklabnik/gh11794
Alex Crichton [Fri, 27 Mar 2015 19:43:59 +0000 (12:43 -0700)]
rollup merge of #23285: steveklabnik/gh11794

Fixes #11794

I mostly removed superflous examples which use the standard library.

I have one more quesiton here though: threads. They're mostly a library thing, at this point, right?

9 years agoUpdate return value docs in atomics docs
Steve Klabnik [Fri, 27 Mar 2015 19:37:11 +0000 (15:37 -0400)]
Update return value docs in atomics docs

Fixes #21668

9 years agoAuto merge of #23419 - murarth:lookup-addr, r=alexcrichton
bors [Fri, 27 Mar 2015 19:34:04 +0000 (19:34 +0000)]
Auto merge of #23419 - murarth:lookup-addr, r=alexcrichton

Closes #22608

9 years agoFix wording for Option<T>.unwrap. Fixes #23713
Julian Viereck [Fri, 27 Mar 2015 19:14:09 +0000 (20:14 +0100)]
Fix wording for Option<T>.unwrap. Fixes #23713

9 years agoFix fallout of removing quotes in crate names
Alex Crichton [Fri, 27 Mar 2015 17:22:44 +0000 (10:22 -0700)]
Fix fallout of removing quotes in crate names

9 years agoTest fixes and rebase conflicts, round 1
Alex Crichton [Fri, 27 Mar 2015 18:29:36 +0000 (11:29 -0700)]
Test fixes and rebase conflicts, round 1

9 years agoWhen testing whether a default method predicates are satisfiable,
Niko Matsakis [Wed, 18 Mar 2015 19:26:38 +0000 (15:26 -0400)]
When testing whether a default method predicates are satisfiable,
combine normalization with this check so that we also skip the
default method if normalization fails. Fixes #23485.

9 years agoUpdated std::dynamic_lib to use std::path.
Aaron Weiss [Mon, 23 Mar 2015 17:42:48 +0000 (13:42 -0400)]
Updated std::dynamic_lib to use std::path.

9 years agoMerge 'richo/unquote-crates' into less-quotes
Alex Crichton [Fri, 27 Mar 2015 18:06:41 +0000 (11:06 -0700)]
Merge 'richo/unquote-crates' into less-quotes

Conflicts:
src/libsyntax/parse/parser.rs

9 years agoUnquote all crate names without underscores
Richo Healey [Fri, 27 Mar 2015 17:58:12 +0000 (10:58 -0700)]
Unquote all crate names without underscores

9 years agorustc: Remove support for hyphens in crate names
Alex Crichton [Fri, 27 Mar 2015 00:35:13 +0000 (17:35 -0700)]
rustc: Remove support for hyphens in crate names

This commit removes parser support for `extern crate "foo" as bar` as the
renamed crate is now required to be an identifier. Additionally this commit
enables hard errors on crate names that contain hyphens in them, they must now
solely contain alphanumeric characters or underscores.

If the crate name is inferred from the file name, however, the file name
`foo-bar.rs` will have the crate name inferred as `foo_bar`. If a binary is
being emitted it will have the name `foo-bar` and a library will have the name
`libfoo_bar.rlib`.

This commit is a breaking change for a number of reasons:

* Old syntax is being removed. This was previously only issuing warnings.
* The output for the compiler when input is received on stdin is now `rust_out`
  instead of `rust-out`.
* The crate name for a crate in the file `foo-bar.rs` is now `foo_bar` which can
  affect infrastructure such as logging.

[breaking-change]

9 years agorollup merge of #23749: alexcrichton/remove-old-impl-check
Alex Crichton [Fri, 27 Mar 2015 17:10:38 +0000 (10:10 -0700)]
rollup merge of #23749: alexcrichton/remove-old-impl-check

Conflicts:
src/libsyntax/feature_gate.rs

9 years agorollup merge of #23741: alexcrichton/remove-int-uint
Alex Crichton [Fri, 27 Mar 2015 17:10:05 +0000 (10:10 -0700)]
rollup merge of #23741: alexcrichton/remove-int-uint

Conflicts:
src/librustc/middle/ty.rs
src/librustc_trans/trans/adt.rs
src/librustc_typeck/check/mod.rs
src/libserialize/json.rs
src/test/run-pass/spawn-fn.rs

9 years agorollup merge of #23738: alexcrichton/snapshots
Alex Crichton [Fri, 27 Mar 2015 17:08:40 +0000 (10:08 -0700)]
rollup merge of #23738: alexcrichton/snapshots

Conflicts:
src/libcollections/vec.rs

9 years agorollup merge of #23780: ruud-v-a/wrapping
Alex Crichton [Fri, 27 Mar 2015 17:07:54 +0000 (10:07 -0700)]
rollup merge of #23780: ruud-v-a/wrapping

This allows `Wrapping<T>` to be used in `assert_eq!`, for example.

One of the tests (compile-fail/xc-private-method.rs) fails, but I can hardly imagine it is related to this change. I would also like to add a tests to ensure that `assert_eq!` compiles and keeps working in the future for `Wrapped<T>` values, but there appear to be no tests in libcore. What would be a good place to add such a test?

9 years agorollup merge of #23776: nrc/allow_trivial_cast
Alex Crichton [Fri, 27 Mar 2015 17:07:54 +0000 (10:07 -0700)]
rollup merge of #23776: nrc/allow_trivial_cast

r? @alexcrichton

9 years agorollup merge of #23775: alexcrichton/fix-flaky-test
Alex Crichton [Fri, 27 Mar 2015 17:07:53 +0000 (10:07 -0700)]
rollup merge of #23775: alexcrichton/fix-flaky-test

Windows gets quite unhappy when a thread fails while the main thread is exiting,
frequently leading to process deadlock. This has been causing quite a few
deadlocks on the windows bots recently. The child threads are presumably failing
because the `println!` is failing due to the main thread being shut down.

9 years agorollup merge of #23771: aturon/stab-straggle-1
Alex Crichton [Fri, 27 Mar 2015 17:07:52 +0000 (10:07 -0700)]
rollup merge of #23771: aturon/stab-straggle-1

Marks as `#[stable}`:

* `ok_or`
* `ok_or_else`
* `iter_mut`
* `cloned`

Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to
work only on `Option<&T>`. Thus, this is a:

[breaking-change]

r? @alexcrichton

9 years agorollup merge of #23769: alexcrichton/stabilize-split
Alex Crichton [Fri, 27 Mar 2015 17:07:51 +0000 (10:07 -0700)]
rollup merge of #23769: alexcrichton/stabilize-split

Now that `<[_]>::split` is an inherent method, it will trump `BufRead::split`
when `BufRead` is in scope, so there is no longer a conflict. As a result,
calling `slice.split()` will probably always give you precisely what you want!

9 years agorollup merge of #23767: tshepang/typo
Alex Crichton [Fri, 27 Mar 2015 17:07:51 +0000 (10:07 -0700)]
rollup merge of #23767: tshepang/typo

9 years agorollup merge of #23765: alexcrichton/remove-colon-syntax
Alex Crichton [Fri, 27 Mar 2015 17:07:50 +0000 (10:07 -0700)]
rollup merge of #23765: alexcrichton/remove-colon-syntax

This syntax has been renamed to `-l static=foo` some time ago.

9 years agorollup merge of #23764: tshepang/no-guessing-anymore
Alex Crichton [Fri, 27 Mar 2015 17:07:50 +0000 (10:07 -0700)]
rollup merge of #23764: tshepang/no-guessing-anymore

9 years agorollup merge of #23761: alexcrichton/remove-phase
Alex Crichton [Fri, 27 Mar 2015 17:07:49 +0000 (10:07 -0700)]
rollup merge of #23761: alexcrichton/remove-phase

This commit removes the extra deprecation warnings and support for the old
`phase` and `plugin` attributes for loading plugins.

9 years agorollup merge of #23753: aturon/revise-convert
Alex Crichton [Fri, 27 Mar 2015 17:07:49 +0000 (10:07 -0700)]
rollup merge of #23753: aturon/revise-convert

This commit revises `path` and `os_str` to use blanket impls for `From`
on reference types. This both cuts down on the number of required impls,
and means that you can pass through e.g. `T: AsRef<OsStr>` to
`PathBuf::from` without an intermediate call to `as_ref`.

It also makes a FIXME note for later generalizing the blanket impls for
`AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do
so.

9 years agorollup merge of #23752: alexcrichton/remove-should-fail
Alex Crichton [Fri, 27 Mar 2015 17:07:48 +0000 (10:07 -0700)]
rollup merge of #23752: alexcrichton/remove-should-fail

This attribute has been deprecated in favor of #[should_panic]. This also
updates rustdoc to no longer accept the `should_fail` directive and instead
renames it to `should_panic`.

9 years agorollup merge of #23750: murarth/ipaddr-fromstr
Alex Crichton [Fri, 27 Mar 2015 17:07:48 +0000 (10:07 -0700)]
rollup merge of #23750: murarth/ipaddr-fromstr

9 years agorollup merge of #23747: tshepang/misleading-info
Alex Crichton [Fri, 27 Mar 2015 17:07:47 +0000 (10:07 -0700)]
rollup merge of #23747: tshepang/misleading-info

The first sentence was not compatible with the second.

9 years agorollup merge of #23745: oneeman/trpl-looping
Alex Crichton [Fri, 27 Mar 2015 17:07:47 +0000 (10:07 -0700)]
rollup merge of #23745: oneeman/trpl-looping

Was reading the 'Looping' section of the book and was puzzled why the last example uses `0u32..10` when the others don't.  Tried it out without and it seems to work, so I figured it should just be `0..10`.  If there is a reason it needs to be `0u32..10` it should be explained in the text (I'd offer to do it but I have no idea).

r? @steveklabnik

9 years agorollup merge of #23743: Adenilson/addInfoArcClone01
Alex Crichton [Fri, 27 Mar 2015 17:07:47 +0000 (10:07 -0700)]
rollup merge of #23743: Adenilson/addInfoArcClone01

Adding more information about the behavior of Arc/Rc when you perform a clone() call.

9 years agorollup merge of #23740: alexcrichton/remove-deprecated-slicing-syntax
Alex Crichton [Fri, 27 Mar 2015 17:07:45 +0000 (10:07 -0700)]
rollup merge of #23740: alexcrichton/remove-deprecated-slicing-syntax

This syntax has been deprecated for quite some time, and there were only a few
remaining uses of it in the codebase anyway.

9 years agorollup merge of #23736: gmjosack/master
Alex Crichton [Fri, 27 Mar 2015 17:07:45 +0000 (10:07 -0700)]
rollup merge of #23736: gmjosack/master

Found a few 404s that seemed like simple fixes:

In footer.inc, certain 404 pages were 404ing on the request to jquery.js and playpen.js. This is easily demonstrated by visiting http://doc.rust-lang.org/foo then http://doc.rust-lang.org/foo/bar. The latter 404s, looking for foo/jquery.js.

The Result docs use old_io Writer as an example. Fix the link to old_io Writer. There's probably an effort to update the example away from a deprecated api but this was a simple fix.

rustc/plugin was pointing at the old guide and it was a broken link anyways (plugin vs plugins). Point at the book instead.

The main page of the API docs referenced c_{str,vec}. Looks like these were deleted in 25d5a3a19423fee01787de87a56d185dd4e0a4e7. Point at ffi docs instead.

9 years agorollup merge of #23725: tamird/test-with-ios
Alex Crichton [Fri, 27 Mar 2015 17:07:44 +0000 (10:07 -0700)]
rollup merge of #23725: tamird/test-with-ios

r? @alexcrichton this should allow `make check` to run when `./configure`d for iOS cross-compilation

9 years agorollup merge of #23721: erickt/deprecate
Alex Crichton [Fri, 27 Mar 2015 17:07:44 +0000 (10:07 -0700)]
rollup merge of #23721: erickt/deprecate

This is technically a breaking change as it deprecates and unstables some previously stable apis that were missed in the last round of deprecations.

[breaking change]

9 years agorollup merge of #23719: steveklabnik/unstable_book
Alex Crichton [Fri, 27 Mar 2015 17:07:44 +0000 (10:07 -0700)]
rollup merge of #23719: steveklabnik/unstable_book

Now that feature flags are only on nightly, it's good to split this stuff out.

9 years agorollup merge of #23712: nikomatsakis/reflect-trait
Alex Crichton [Fri, 27 Mar 2015 17:07:43 +0000 (10:07 -0700)]
rollup merge of #23712: nikomatsakis/reflect-trait

This PR introduces a `Reflect` marker trait which is a supertrait of `Any`. The idea is that `Reflect` is defined for all concrete types, but is not defined for type parameters unless there is a `T:Reflect` bound. This is intended to preserve the parametricity property. This allows the `Any` interface to be stabilized without committing us to unbounded reflection that is not easily detectable by the caller.

The implementation of `Reflect` relies on an experimental variant of OIBIT. This variant behaves differently for objects, since it requires that all types exposed as part of the object's *interface* are `Reflect`, but isn't concerned about other types that may be closed over. In other words, you don't have to write `Foo+Reflect` in order for `Foo: Reflect` to hold (where `Foo` is a trait).

Given that `Any` is slated to stabilization and hence that we are committed to some form of reflection, the goal of this PR is to leave our options open with respect to parametricity. I see the options for full stabilization as follows (I think an RFC would be an appropriate way to confirm whichever of these three routes we take):

1. We make `Reflect` a lang-item.
2. We stabilize some version of the OIBIT variation I implemented as a general mechanism that may be appropriate for other use cases.
3. We give up on preserving parametricity here and just have `impl<T> Reflect for T` instead. In that case, `Reflect` is a harmless but not especially useful trait going forward.

cc @aturon
cc @alexcrichton
cc @glaebhoerl (this is more-or-less your proposal, as I understood it)
cc @reem (this is more-or-less what we discussed on IRC at some point)
cc @FlaPer87 (vaguely pertains to OIBIT)

9 years agorollup merge of #23690: wettowelreactor/patch-1
Alex Crichton [Fri, 27 Mar 2015 17:07:42 +0000 (10:07 -0700)]
rollup merge of #23690: wettowelreactor/patch-1