]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agounbreak bitrig/openbsd build after 8389253d
Sébastien Marie [Wed, 25 Mar 2015 07:42:15 +0000 (08:42 +0100)]
unbreak bitrig/openbsd build after 8389253d

`PathBuf::new` have been changed. Use `PathBuf::from` instead.

Apply the same change for freebsd too, while here.

9 years agoAuto merge of #23681 - alexcrichton:rollup, r=alexcrichton
bors [Wed, 25 Mar 2015 01:42:42 +0000 (01:42 +0000)]
Auto merge of #23681 - alexcrichton:rollup, r=alexcrichton

9 years agoTest fixes and rebase conflicts, round 2
Alex Crichton [Tue, 24 Mar 2015 23:55:35 +0000 (16:55 -0700)]
Test fixes and rebase conflicts, round 2

9 years agorollup merge of #23674: nagisa/fallout-1
Alex Crichton [Tue, 24 Mar 2015 23:53:38 +0000 (16:53 -0700)]
rollup merge of #23674: nagisa/fallout-1

9 years agoTest fixes and rebase conflicts, round 1
Alex Crichton [Tue, 24 Mar 2015 23:48:50 +0000 (16:48 -0700)]
Test fixes and rebase conflicts, round 1

9 years agoAuto merge of #23546 - alexcrichton:hyphens, r=brson
bors [Tue, 24 Mar 2015 22:44:33 +0000 (22:44 +0000)]
Auto merge of #23546 - alexcrichton:hyphens, r=brson

The compiler will now issue a warning for crates that have syntax of the form
`extern crate "foo" as bar`, but it will still continue to accept this syntax.
Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist
in the transition period as well.

This patch will land hopefully in tandem with a Cargo patch that will start
translating all crate names to have underscores instead of hyphens.

cc #23533

9 years agoFix some fallout in librustdoc
Simonas Kazlauskas [Tue, 24 Mar 2015 22:39:29 +0000 (00:39 +0200)]
Fix some fallout in librustdoc

9 years agorollup merge of #23671: steveklabnik/doc_std_clone
Alex Crichton [Tue, 24 Mar 2015 22:27:16 +0000 (15:27 -0700)]
rollup merge of #23671: steveklabnik/doc_std_clone

9 years agorollup merge of #23638: pnkfelix/fsk-reject-specialized-drops
Alex Crichton [Tue, 24 Mar 2015 22:27:14 +0000 (15:27 -0700)]
rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops

Reject specialized Drop impls.

See Issue #8142 for discussion.

This makes it illegal for a Drop impl to be more specialized than the original item.

So for example, all of the following are now rejected (when they would have been blindly accepted before):

```rust
struct S<A> { ... };
impl Drop for S<i8> { ... } // error: specialized to concrete type

struct T<'a> { ... };
impl Drop for T<'static> { ... } // error: specialized to concrete region

struct U<A> { ... };
impl<A:Clone> Drop for U<A> { ... } // error: added extra type requirement

struct V<'a,'b>;
impl<'a,'b:a> Drop for V<'a,'b> { ... } // error: added extra region requirement
```

Due to examples like the above, this is a [breaking-change].

(The fix is to either remove the specialization from the `Drop` impl, or to transcribe the requirements into the struct/enum definition; examples of both are shown in the PR's fixed to `libstd`.)

----

This is likely to be the last thing blocking the removal of the `#[unsafe_destructor]` attribute.

Fix #8142
Fix #23584

9 years agorollup merge of #23546: alexcrichton/hyphens
Alex Crichton [Tue, 24 Mar 2015 21:56:00 +0000 (14:56 -0700)]
rollup merge of #23546: alexcrichton/hyphens

The compiler will now issue a warning for crates that have syntax of the form
`extern crate "foo" as bar`, but it will still continue to accept this syntax.
Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist
in the transition period as well.

This patch will land hopefully in tandem with a Cargo patch that will start
translating all crate names to have underscores instead of hyphens.

cc #23533

9 years agorustc: Add support for `extern crate foo as bar`
Alex Crichton [Thu, 19 Mar 2015 22:39:03 +0000 (15:39 -0700)]
rustc: Add support for `extern crate foo as bar`

The compiler will now issue a warning for crates that have syntax of the form
`extern crate "foo" as bar`, but it will still continue to accept this syntax.
Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist
in the transition period as well.

This patch will land hopefully in tandem with a Cargo patch that will start
translating all crate names to have underscores instead of hyphens.

cc #23533

9 years agorollup merge of #23668: alexcrichton/io-zero
Alex Crichton [Tue, 24 Mar 2015 21:50:48 +0000 (14:50 -0700)]
rollup merge of #23668: alexcrichton/io-zero

This commit alters the behavior of the `Read::read_to_end()` method to zero all
memory instead of passing an uninitialized buffer to `read`. This change is
motivated by the [discussion on the internals forum][discuss] where the
conclusion has been that the standard library will not expose uninitialized
memory.

[discuss]: http://internals.rust-lang.org/t/uninitialized-memory/1652

Closes #20314

9 years agorollup merge of #23662: steveklabnik/gh23421
Alex Crichton [Tue, 24 Mar 2015 21:50:48 +0000 (14:50 -0700)]
rollup merge of #23662: steveklabnik/gh23421

I assume since both shifts say the same thing, I should fix both of them, but then I realized I don't strictly know about left shift.

Fixes #23421

r? @pnkfelix

9 years agorollup merge of #23661: steveklabnik/any_docs
Alex Crichton [Tue, 24 Mar 2015 21:50:48 +0000 (14:50 -0700)]
rollup merge of #23661: steveklabnik/any_docs

http://www.reddit.com/r/rust/comments/304q00/type_information_in_rust/cpp43lu

9 years agorollup merge of #23659: GBGamer/master
Alex Crichton [Tue, 24 Mar 2015 21:50:47 +0000 (14:50 -0700)]
rollup merge of #23659: GBGamer/master

For other permissions beside USR permissions, we need these constants.

fixes #23658

9 years agorollup merge of #23646: steveklabnik/doc_file
Alex Crichton [Tue, 24 Mar 2015 21:50:47 +0000 (14:50 -0700)]
rollup merge of #23646: steveklabnik/doc_file

This is pretty basic, but it's nice to have something.

r? @alexcrichton

9 years agorollup merge of #23630: nrc/coerce-tidy
Alex Crichton [Tue, 24 Mar 2015 21:50:46 +0000 (14:50 -0700)]
rollup merge of #23630: nrc/coerce-tidy

See notes on the first commit

Closes #18601

r? @nikomatsakis

cc @eddyb

9 years agorollup merge of #23629: liammonahan/master
Alex Crichton [Tue, 24 Mar 2015 21:50:45 +0000 (14:50 -0700)]
rollup merge of #23629: liammonahan/master

Found a small typo on the Rust book "ownership" page.

Best,
Liam

r? @steveklabnik

9 years agorollup merge of #23592: alexcrichton/tweak-at-exit
Alex Crichton [Tue, 24 Mar 2015 21:50:45 +0000 (14:50 -0700)]
rollup merge of #23592: alexcrichton/tweak-at-exit

There have been some recent panics on the bots and this commit is an attempt to
appease them. Previously it was considered invalid to run `rt::at_exit` after
the handlers had already started running. Due to the multithreaded nature of
applications, however, it is not always possible to guarantee this. For example
[this program][ex] will show off the abort.

[ex]: https://gist.github.com/alexcrichton/56300b87af6fa554e52d

The semantics of the `rt::at_exit` function have been modified as such:

* It is now legal to call `rt::at_exit` at any time. The return value now
  indicates whether the closure was successfully registered or not. Callers must
  now decide what to do with this information.
* The `rt::at_exit` handlers will now be run for a fixed number of iterations.
  Common cases (such as the example shown) may end up registering a new handler
  while others are running perhaps once or twice, so this common condition is
  covered by re-running the handlers a fixed number of times, after which new
  registrations are forbidden.

Some usage of `rt::at_exit` was updated to handle these new semantics, but
deprecated or unstable libraries calling `rt::at_exit` were not updated.

9 years agorollup merge of #23573: steveklabnik/doc_associated_types
Alex Crichton [Tue, 24 Mar 2015 21:50:44 +0000 (14:50 -0700)]
rollup merge of #23573: steveklabnik/doc_associated_types

9 years agorollup merge of #23282: nikomatsakis/fn-trait-inheritance
Alex Crichton [Tue, 24 Mar 2015 21:50:44 +0000 (14:50 -0700)]
rollup merge of #23282: nikomatsakis/fn-trait-inheritance

The primary motivation here is to sidestep #19032 -- for a time, I thought that we should improve coherence or otherwise extend the language, but I now think that any such changes will require more time to bake. In the meantime, inheritance amongst the fn traits is both logically correct *and* a simple solution to that obstacle. This change introduces inheritance and modifies the compiler so that it can properly generate impls for closures and fns.

Things enabled by this PR (but not included in this PR):

1. An impl of `FnMut` for `&mut F` where `F : FnMut` (https://github.com/rust-lang/rust/issues/23015).
2. A better version of `Thunk` I've been calling `FnBox`.

I did not include either of these in the PR because:

1. Adding the impls in 1 currently induces a coherence conflict with the pattern trait. This is interesting and merits some discussion.
2. `FnBox` deserves to be a PR of its own.

The main downside to this design is (a) the need to write impls by hand; (b) the possibility of implementing `FnMut` with different semantics from `Fn`, etc. Point (a) is minor -- in particular, it does not affect normal closure usage -- and could be addressed in the future in many ways (better defaults; convenient macros; specialization; etc). Point (b) is unfortunate but "just a bug" from my POV, and certainly not unique to these traits (c.f. Copy/Clone, PartialEq/Eq, etc). (Until we lift the feature-gate on implementing the Fn traits, in any case, there is room to correct both of these if we find a nice way.)

Note that I believe this change is reversible in the future if we decide on another course of action, due to the feature gate on implementing the `Fn` traits, though I do not (currently) think we should reverse it.

Fixes #18835.

r? @nrc

9 years agoBug fixes
Nick Cameron [Tue, 24 Mar 2015 00:50:14 +0000 (13:50 +1300)]
Bug fixes

9 years agoUnit tests for Issue 8142, collected into one file.
Felix S. Klock II [Tue, 24 Mar 2015 09:46:40 +0000 (10:46 +0100)]
Unit tests for Issue 8142, collected into one file.

9 years agoReject specialized Drop impls.
Felix S. Klock II [Sat, 21 Mar 2015 12:12:08 +0000 (13:12 +0100)]
Reject specialized Drop impls.

See Issue 8142 for discussion.

This makes it illegal for a Drop impl to be more specialized than the
original item.

So for example, all of the following are now rejected (when they would
have been blindly accepted before):

```rust
struct S<A> { ... };
impl Drop for S<i8> { ... } // error: specialized to concrete type

struct T<'a> { ... };
impl Drop for T<'static> { ... } // error: specialized to concrete region

struct U<A> { ... };
impl<A:Clone> Drop for U<A> { ... } // error: added extra type requirement

struct V<'a,'b>;
impl<'a,'b:a> Drop for V<'a,'b> { ... } // error: added extra region requirement
```

Due to examples like the above, this is a [breaking-change].

(The fix is to either remove the specialization from the `Drop` impl,
or to transcribe the requirements into the struct/enum definition;
examples of both are shown in the PR's fixed to `libstd`.)

----

This is likely to be the last thing blocking the removal of the
`#[unsafe_destructor]` attribute.

Includes two new error codes for the new dropck check.

Update run-pass tests to accommodate new dropck pass.

Update tests and docs to reflect new destructor restriction.

----

Implementation notes:

We identify Drop impl specialization by not being as parametric as the
struct/enum definition via unification.

More specifically:

 1. Attempt unification of a skolemized instance of the struct/enum
    with an instance of the Drop impl's type expression where all of
    the impl's generics (i.e. the free variables of the type
    expression) have been replaced with unification variables.

 2. If unification fails, then reject Drop impl as specialized.

 3. If unification succeeds, check if any of the skolemized
    variables "leaked" into the constraint set for the inference
    context; if so, then reject Drop impl as specialized.

 4. Otherwise, unification succeeded without leaking skolemized
    variables: accept the Drop impl.

We identify whether a Drop impl is injecting new predicates by simply
looking whether the predicate, after an appropriate substitution,
appears on the struct/enum definition.

9 years agoAdded `T:Send` bound to `JoinGuard<T>` to avoid specialized `Drop` impl.
Felix S. Klock II [Sat, 21 Mar 2015 12:34:33 +0000 (13:34 +0100)]
Added `T:Send` bound to `JoinGuard<T>` to avoid specialized `Drop` impl.

9 years agoAdded `T:Send` bound to `Queue<T>` to avoid specialized `Drop` impl.
Felix S. Klock II [Sat, 21 Mar 2015 12:33:12 +0000 (13:33 +0100)]
Added `T:Send` bound to `Queue<T>` to avoid specialized `Drop` impl.

9 years agoAdded `T:Send` bound to `Packet<T>` to avoid specialized `Drop` impl.
Felix S. Klock II [Sat, 21 Mar 2015 12:31:58 +0000 (13:31 +0100)]
Added `T:Send` bound to `Packet<T>` to avoid specialized `Drop` impl.

9 years agoadded `T:Send` bound to `Mutex<T>` to avoid specialized Drop impl.
Felix S. Klock II [Sat, 21 Mar 2015 12:30:26 +0000 (13:30 +0100)]
added `T:Send` bound to `Mutex<T>` to avoid specialized Drop impl.

9 years agoAdded `W: Writer` bound to `BufferedWriter<W>` to avoid specialized `Drop` impl.
Felix S. Klock II [Sat, 21 Mar 2015 12:28:20 +0000 (13:28 +0100)]
Added `W: Writer` bound to `BufferedWriter<W>` to avoid specialized `Drop` impl.

9 years agoAdded `T:Send` bound to `Queue<T>` to avoid specialized Drop impl.
Felix S. Klock II [Sat, 21 Mar 2015 12:22:21 +0000 (13:22 +0100)]
Added `T:Send` bound to `Queue<T>` to avoid specialized Drop impl.

9 years agoAdded `Write` bounds to avoid a specialized Drop impl for `BufWriter`.
Felix S. Klock II [Sat, 21 Mar 2015 12:20:12 +0000 (13:20 +0100)]
Added `Write` bounds to avoid a specialized Drop impl for `BufWriter`.

9 years agoAdded `T:Send` bound to `sync::mpsc::Receiver` and `sync::mpsc::Sender`.
Felix S. Klock II [Sat, 21 Mar 2015 12:14:28 +0000 (13:14 +0100)]
Added `T:Send` bound to `sync::mpsc::Receiver` and `sync::mpsc::Sender`.

This was necessary to avoid specialized `Drop` impls for the two structs.

9 years agoRemove unnecessary bounds from Drop impl for `Arc` and `arc::Weak` and
Felix S. Klock II [Sat, 21 Mar 2015 12:13:07 +0000 (13:13 +0100)]
Remove unnecessary bounds from Drop impl for `Arc` and `arc::Weak` and
one of the helper method impls.

9 years agoChange lint names to plurals
Nick Cameron [Mon, 23 Mar 2015 22:23:34 +0000 (11:23 +1300)]
Change lint names to plurals

9 years agoAdd tests
Nick Cameron [Mon, 23 Mar 2015 04:28:57 +0000 (17:28 +1300)]
Add tests

9 years agoRemove the UnusedCasts lint
Nick Cameron [Mon, 23 Mar 2015 02:50:32 +0000 (15:50 +1300)]
Remove the UnusedCasts lint

9 years agoMinor refactoring in coercion.rs
Nick Cameron [Mon, 23 Mar 2015 02:26:51 +0000 (15:26 +1300)]
Minor refactoring in coercion.rs

9 years agoAdd trivial cast lints.
Nick Cameron [Fri, 20 Mar 2015 04:15:27 +0000 (17:15 +1300)]
Add trivial cast lints.

This permits all coercions to be performed in casts, but adds lints to warn in those cases.

Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference.

[breaking change]

* Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed.
* The unused casts lint has gone.
* Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are:
- You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_`
- Casts do not influence inference of integer types. E.g., the following used to type check:

```
let x = 42;
let y = &x as *const u32;
```

Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information:

```
let x: u32 = 42;
let y = &x as *const u32;
```

9 years agoAn example for clone
Steve Klabnik [Tue, 24 Mar 2015 20:58:08 +0000 (16:58 -0400)]
An example for clone

9 years agostd: Zero memory when calling `read_to_end()`
Alex Crichton [Tue, 24 Mar 2015 18:14:35 +0000 (11:14 -0700)]
std: Zero memory when calling `read_to_end()`

This commit alters the behavior of the `Read::read_to_end()` method to zero all
memory instead of passing an uninitialized buffer to `read`. This change is
motivated by the [discussion on the internals forum][discuss] where the
conclusion has been that the standard library will not expose uninitialized
memory.

[discuss]: http://internals.rust-lang.org/t/uninitialized-memory/1652

Closes #20314

9 years agoAuto merge of #23654 - alexcrichton:rollup, r=alexcrichton
bors [Tue, 24 Mar 2015 17:38:09 +0000 (17:38 +0000)]
Auto merge of #23654 - alexcrichton:rollup, r=alexcrichton

9 years agoTest fixes and rebase conflicts, round 4
Alex Crichton [Tue, 24 Mar 2015 17:23:47 +0000 (10:23 -0700)]
Test fixes and rebase conflicts, round 4

9 years agocorrect reference wrt shifts
Steve Klabnik [Tue, 24 Mar 2015 16:41:22 +0000 (12:41 -0400)]
correct reference wrt shifts

Fixes #23421

9 years agoClean up Any's title line
Steve Klabnik [Tue, 24 Mar 2015 16:15:49 +0000 (12:15 -0400)]
Clean up Any's title line

http://www.reddit.com/r/rust/comments/304q00/type_information_in_rust/cpp43lu

9 years agoAdd basic information about associated types
Steve Klabnik [Sat, 21 Mar 2015 02:09:57 +0000 (22:09 -0400)]
Add basic information about associated types

9 years agoMerge remote-tracking branch 'origin/master' into rollup
Alex Crichton [Tue, 24 Mar 2015 15:03:25 +0000 (08:03 -0700)]
Merge remote-tracking branch 'origin/master' into rollup

9 years agoAdd Examples for File
Steve Klabnik [Mon, 23 Mar 2015 19:40:43 +0000 (15:40 -0400)]
Add Examples for File

This is pretty basic, but it's nice to have something.

9 years agoAdd the other S_I(RWX)(GRP/OTH) for posix `creat`
Nicholas Mazzuca [Tue, 24 Mar 2015 10:25:48 +0000 (03:25 -0700)]
Add the other S_I(RWX)(GRP/OTH) for posix `creat`

9 years agoTest fixes and rebase conflicts, round 3
Alex Crichton [Tue, 24 Mar 2015 00:29:51 +0000 (17:29 -0700)]
Test fixes and rebase conflicts, round 3

9 years agoImprove the wording of the example section description on the ownership page
Liam Monahan [Tue, 24 Mar 2015 01:19:54 +0000 (21:19 -0400)]
Improve the wording of the example section description on the ownership page
to make it more clear.

9 years agorollup merge of #23653: dhuseby/bitrig-stage0-c64d671
Alex Crichton [Tue, 24 Mar 2015 00:13:39 +0000 (17:13 -0700)]
rollup merge of #23653: dhuseby/bitrig-stage0-c64d671

@alexcrichton this adds the latest Bitrig snapshot.  Please upload the corresponding snapshot: https://github.com/dhuseby/rust-cross-bitrig/blob/master/snapshots/rust-stage0-2015-03-17-c64d671-bitrig-x86_64-41de2c7a69a1ac648d3fa3b65e96a29bdc122163.tar.bz2

9 years agorollup merge of #23652: alexcrichton/stabilize-hasher-finish
Alex Crichton [Tue, 24 Mar 2015 00:13:38 +0000 (17:13 -0700)]
rollup merge of #23652: alexcrichton/stabilize-hasher-finish

This commit enables writing a stable implementation of the `Hasher` trait as
well as actually calculating the hash of a vlaue in a stable fashion. The
signature is stabilized as-is.

9 years agorollup merge of #23645: steveklabnik/gh23642
Alex Crichton [Tue, 24 Mar 2015 00:13:38 +0000 (17:13 -0700)]
rollup merge of #23645: steveklabnik/gh23642

Fixes #23642

9 years agorollup merge of #23644: mbrubeck/doc-edit
Alex Crichton [Tue, 24 Mar 2015 00:13:37 +0000 (17:13 -0700)]
rollup merge of #23644: mbrubeck/doc-edit

PR #23104 moved `is_null` and `offset` to an inherent impl on the raw pointer type.

I'm not sure whether or how it's possible to link to docs for that impl.

r? @steveklabnik

9 years agorollup merge of #23509: aturon/stab-entry
Alex Crichton [Tue, 24 Mar 2015 00:13:27 +0000 (17:13 -0700)]
rollup merge of #23509: aturon/stab-entry

This commit marks as `#[stable]` the `Entry` types for the maps provided
by `std`. The main reason these had been left unstable previously was
uncertainty about an eventual trait design, but several plausible
designs have been proposed that all work fine with the current type definitions.

r? @Gankro

9 years agoTest fixes and rebase conflicts, round 2
Alex Crichton [Mon, 23 Mar 2015 22:54:39 +0000 (15:54 -0700)]
Test fixes and rebase conflicts, round 2

9 years agoFallout from changing fn traits to use inheritance rather than bridge
Niko Matsakis [Wed, 11 Mar 2015 14:08:33 +0000 (10:08 -0400)]
Fallout from changing fn traits to use inheritance rather than bridge
impls. This is a [breaking-change] (for gated code) in that when you
implement `Fn` (`FnMut`) you must also implement `FnOnce`. This commit
demonstrates how to fix it.

9 years agoadding lastest Bitrig snapshot by hand
Dave Huseby [Mon, 23 Mar 2015 22:58:44 +0000 (15:58 -0700)]
adding lastest Bitrig snapshot by hand

9 years agoUpdate docs for ptr module.
Matt Brubeck [Mon, 23 Mar 2015 18:11:12 +0000 (11:11 -0700)]
Update docs for ptr module.

PR #23104 moved `is_null` and `offset` to an inherent impl on the raw pointer
type.

9 years agoStabilize Entry types
Aaron Turon [Thu, 19 Mar 2015 06:36:19 +0000 (23:36 -0700)]
Stabilize Entry types

This commit marks as `#[stable]` the `Entry` types for the maps provided
by `std`. The main reason these had been left unstable previously was
uncertainty about an eventual trait design, but several plausible
designs have been proposed that all work fine with the current type definitions.

9 years agoAuto merge of #23536 - pnkfelix:arith-oflo-shifts, r=nikomatsakis
bors [Mon, 23 Mar 2015 22:43:39 +0000 (22:43 +0000)]
Auto merge of #23536 - pnkfelix:arith-oflo-shifts, r=nikomatsakis

overflow-checking for rhs of shift operators

Subtask of #22020 ([RFC 560](https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md))

9 years agorollup merge of #23506: alexcrichton/remove-some-deprecated-things
Alex Crichton [Mon, 23 Mar 2015 22:27:06 +0000 (15:27 -0700)]
rollup merge of #23506: alexcrichton/remove-some-deprecated-things

Conflicts:
src/test/run-pass/deprecated-no-split-stack.rs

9 years agorollup merge of #23503: alexcrichton/fix-ptr-docs
Alex Crichton [Mon, 23 Mar 2015 22:26:24 +0000 (15:26 -0700)]
rollup merge of #23503: alexcrichton/fix-ptr-docs

The method with which backwards compatibility was retained ended up leading to
documentation that rustdoc didn't handle well and largely ended up confusing.

9 years agorollup merge of #23484: alexcrichton/marker-trait-stable
Alex Crichton [Mon, 23 Mar 2015 22:26:24 +0000 (15:26 -0700)]
rollup merge of #23484: alexcrichton/marker-trait-stable

This trait has proven quite useful when defining marker traits to avoid the
semi-confusing `PhantomFn` trait and it looks like it will continue to be a
useful tool for defining these traits.

9 years agoTest fixes and rebase conflicts, round 1
Alex Crichton [Mon, 23 Mar 2015 22:18:40 +0000 (15:18 -0700)]
Test fixes and rebase conflicts, round 1

9 years agorollup merge of #23383: alexcrichton/fs-create-dir-all
Alex Crichton [Mon, 23 Mar 2015 22:18:24 +0000 (15:18 -0700)]
rollup merge of #23383: alexcrichton/fs-create-dir-all

Conflicts:
src/libstd/fs/mod.rs

9 years agorollup merge of #23598: brson/gate
Alex Crichton [Mon, 23 Mar 2015 22:13:15 +0000 (15:13 -0700)]
rollup merge of #23598: brson/gate

Conflicts:
src/compiletest/compiletest.rs
src/libcollections/lib.rs
src/librustc_back/lib.rs
src/libserialize/lib.rs
src/libstd/lib.rs
src/libtest/lib.rs
src/test/run-make/rustdoc-default-impl/foo.rs
src/test/run-pass/env-home-dir.rs

9 years agorollup merge of #23650: brson/32-bit-userspace
Alex Crichton [Mon, 23 Mar 2015 22:11:18 +0000 (15:11 -0700)]
rollup merge of #23650: brson/32-bit-userspace

The variable '$SHELL' is not actually defined by 'sh'.

This makes Rust build correctly in popular Docker images.

9 years agorollup merge of #23648: steveklabnik/rollup
Alex Crichton [Mon, 23 Mar 2015 22:11:15 +0000 (15:11 -0700)]
rollup merge of #23648: steveklabnik/rollup

- Successful merges: #22954, #23119, #23509, #23561, #23590, #23607, #23608, #23618, #23622, #23639, #23641
- Failed merges: #23401

9 years agorollup merge of #23641: steveklabnik/gh23632
Alex Crichton [Mon, 23 Mar 2015 22:11:13 +0000 (15:11 -0700)]
rollup merge of #23641: steveklabnik/gh23632

Fixes #23632

9 years agorollup merge of #23640: nagisa/thread-less-weak
Alex Crichton [Mon, 23 Mar 2015 22:11:12 +0000 (15:11 -0700)]
rollup merge of #23640: nagisa/thread-less-weak

This is more portable as far as linux is concerned.

9 years agorollup merge of #23639: steveklabnik/gh21305
Alex Crichton [Mon, 23 Mar 2015 22:11:10 +0000 (15:11 -0700)]
rollup merge of #23639: steveklabnik/gh21305

Fixes #21305

Not sure if we should include more than this here, but it should be good to have at least this.

9 years agorollup merge of #23637: apasel422/iter
Alex Crichton [Mon, 23 Mar 2015 22:11:09 +0000 (15:11 -0700)]
rollup merge of #23637: apasel422/iter

9 years agorollup merge of #23634: WiSaGaN/bugfix/fix_dead_link
Alex Crichton [Mon, 23 Mar 2015 22:11:07 +0000 (15:11 -0700)]
rollup merge of #23634: WiSaGaN/bugfix/fix_dead_link

9 years agorollup merge of #23633: tomjakubowski/rustdoc-array-prim
Alex Crichton [Mon, 23 Mar 2015 22:11:06 +0000 (15:11 -0700)]
rollup merge of #23633: tomjakubowski/rustdoc-array-prim

Previously, impls for `[T; n]` were collected in the same place as impls for `[T]` and `&[T]`. This splits them out into their own primitive page in both core and std.

9 years agorollup merge of #23631: andersk/minstack-dlsym
Alex Crichton [Mon, 23 Mar 2015 22:11:05 +0000 (15:11 -0700)]
rollup merge of #23631: andersk/minstack-dlsym

Linking `__pthread_get_minstack`, even weakly, was causing Debian’s `dpkg-shlibdeps` to detect an unnecessarily strict versioned dependency on libc6.

Closes #23628.

9 years agorollup merge of #23622: steveklabnik/gh23196
Alex Crichton [Mon, 23 Mar 2015 22:11:03 +0000 (15:11 -0700)]
rollup merge of #23622: steveklabnik/gh23196

Fixes #23196

9 years agorollup merge of #23619: steveklabnik/gh23220
Alex Crichton [Mon, 23 Mar 2015 22:11:02 +0000 (15:11 -0700)]
rollup merge of #23619: steveklabnik/gh23220

Fixes #23571

I _think_ this is better, but other suggestions welcome too.

9 years agorollup merge of #23618: steveklabnik/gh23571
Alex Crichton [Mon, 23 Mar 2015 22:11:00 +0000 (15:11 -0700)]
rollup merge of #23618: steveklabnik/gh23571

Fixes #23571

9 years agorollup merge of #23615: steveklabnik/gh23540
Alex Crichton [Mon, 23 Mar 2015 22:10:58 +0000 (15:10 -0700)]
rollup merge of #23615: steveklabnik/gh23540

Closes #23540

9 years agorollup merge of #23612: dotdash/closure_bloat
Alex Crichton [Mon, 23 Mar 2015 22:10:57 +0000 (15:10 -0700)]
rollup merge of #23612: dotdash/closure_bloat

For the rust-call ABI, the last function argument is a tuple that gets
untupled for the actual call. For bare functions using this ABI, the
code has access to the tuple, so we need to tuple the arguments again.
But closures can't actually access the tuple. Their arguments map to the
elements in the tuple. So what we currently do is to tuple the arguments
and then immediately untuple them again, which is pretty useless and we
can just omit it.

9 years agorollup merge of #23608: nagisa/refine-cursor-docstring
Alex Crichton [Mon, 23 Mar 2015 22:10:55 +0000 (15:10 -0700)]
rollup merge of #23608: nagisa/refine-cursor-docstring

r? @steveklabnik

9 years agorollup merge of #23607: mahkoh/cursor
Alex Crichton [Mon, 23 Mar 2015 22:10:53 +0000 (15:10 -0700)]
rollup merge of #23607: mahkoh/cursor

Closes #23599

r? @alexcrichton

9 years agorollup merge of #23604: apasel422/btree
Alex Crichton [Mon, 23 Mar 2015 22:10:51 +0000 (15:10 -0700)]
rollup merge of #23604: apasel422/btree

`btree_map::IntoIter` (and `btree_set::IntoIter`) remains, but it is a bit trickier.

9 years agorollup merge of #23601: nikomatsakis/by-value-index
Alex Crichton [Mon, 23 Mar 2015 22:10:50 +0000 (15:10 -0700)]
rollup merge of #23601: nikomatsakis/by-value-index

This is a [breaking-change]. When indexing a generic map (hashmap, etc) using the `[]` operator, it is now necessary to borrow explicitly, so change `map[key]` to `map[&key]` (consistent with the `get` routine). However, indexing of string-valued maps with constant strings can now be written `map["abc"]`.

r? @japaric
cc @aturon @Gankro

9 years agorollup merge of #23590: FuGangqiang/attr
Alex Crichton [Mon, 23 Mar 2015 22:10:36 +0000 (15:10 -0700)]
rollup merge of #23590: FuGangqiang/attr

9 years agorollup merge of #23580: nikomatsakis/pattern-and-overflow
Alex Crichton [Mon, 23 Mar 2015 22:10:30 +0000 (15:10 -0700)]
rollup merge of #23580: nikomatsakis/pattern-and-overflow

9 years agorollup merge of #23579: Ms2ger/thread_local-unsafe
Alex Crichton [Mon, 23 Mar 2015 22:10:13 +0000 (15:10 -0700)]
rollup merge of #23579: Ms2ger/thread_local-unsafe

Conflicts:
src/libstd/thread/local.rs

9 years agorollup merge of #23561: steveklabnik/gh23422
Alex Crichton [Mon, 23 Mar 2015 22:09:10 +0000 (15:09 -0700)]
rollup merge of #23561: steveklabnik/gh23422

Fixes #23422

9 years agorollup merge of #23557: aturon/rfc-909
Alex Crichton [Mon, 23 Mar 2015 22:09:09 +0000 (15:09 -0700)]
rollup merge of #23557: aturon/rfc-909

This commit implements [RFC 909](https://github.com/rust-lang/rfcs/pull/909):

The `std::thread_local` module is now deprecated, and its contents are
available directly in `std::thread` as `LocalKey`, `LocalKeyState`, and
`ScopedKey`.

The macros remain exactly as they were, which means little if any code
should break. Nevertheless, this is technically a:

[breaking-change]

Closes #23547

9 years agorollup merge of #23541: aturon/stab-error
Alex Crichton [Mon, 23 Mar 2015 22:09:08 +0000 (15:09 -0700)]
rollup merge of #23541: aturon/stab-error

This small commit stabilizes the `Error` trait as-is, except that `Send`
and `Debug` are added as constraints. The `Send` constraint is because
most uses of `Error` will be for trait objects, and by default we would
like these objects to be transferrable between threads. The `Debug`
constraint is to ensure that e.g. `Box<Error>` is `Debug`, and because
types that implement `Display` should certainly implement `Debug` in any case.

In the near future we expect to add `Any`-like downcasting features to
`Error`, but this is waiting on some additional
mechanisms (`Reflect`). It will be added before 1.0 via default methods.

[breaking-change]

r? @alexcrichton

Closes #21790

9 years agorollup merge of #23538: aturon/conversion
Alex Crichton [Mon, 23 Mar 2015 22:09:05 +0000 (15:09 -0700)]
rollup merge of #23538: aturon/conversion

Conflicts:
src/librustc_back/rpath.rs

9 years agorollup merge of #23536: pnkfelix/arith-oflo-shifts
Alex Crichton [Mon, 23 Mar 2015 22:08:17 +0000 (15:08 -0700)]
rollup merge of #23536: pnkfelix/arith-oflo-shifts

overflow-checking for rhs of shift operators

Subtask of #22020 ([RFC 560](https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md))

9 years agorollup merge of #23517: vhbit/ext-socket-options
Alex Crichton [Mon, 23 Mar 2015 22:08:15 +0000 (15:08 -0700)]
rollup merge of #23517: vhbit/ext-socket-options

Continuation of #23380 - added corresponding constants for Windows, Linux, *BSDs

r? @alexcrichton

Alex, can you also cc to a person who can check correctness for Windows as I'm not that confident in header file I've downloaded.

9 years agorollup merge of #23515: nikomatsakis/issue-14985-trait-subtyping
Alex Crichton [Mon, 23 Mar 2015 22:08:13 +0000 (15:08 -0700)]
rollup merge of #23515: nikomatsakis/issue-14985-trait-subtyping

Remove incorrect subtyping for `&mut Trait` and introduce coercion for `&mut (Trait+'a)` to `&mut (Trait+'b)` if `'a:'b`.

Fixes #14985.

r? @nrc

9 years agorollup merge of #23466: woehr/master
Alex Crichton [Mon, 23 Mar 2015 22:08:10 +0000 (15:08 -0700)]
rollup merge of #23466: woehr/master

This fixes a bug in LLVM IR generation for in-line assembly where Rust would always use the host clobbers instead of target clobbers.

I also took this opportunity to clean/simplify the ```trans_inline_asm``` function.

This is my first Rust pull request; please let me know if I'm missing anything.

9 years agorollup merge of #23401: tshepang/crates-and-modules-doc-nits
Alex Crichton [Mon, 23 Mar 2015 22:08:01 +0000 (15:08 -0700)]
rollup merge of #23401: tshepang/crates-and-modules-doc-nits

Conflicts:
src/doc/trpl/crates-and-modules.md

9 years agorollup merge of #23283: brson/rpathfix
Alex Crichton [Mon, 23 Mar 2015 22:07:33 +0000 (15:07 -0700)]
rollup merge of #23283: brson/rpathfix

Fix regression in -C rpath that causes failures with symlinks

The new `relative_from` method no longer supports the case on unix
where both paths are absolute, which `-C rpath` depended on. This
version fixes the problem by copying the old path_relative_from
function into the rpath module.

Fixes #23140

After experimenting with the new `relative_from` function on `Path` I'm not sure what it's use case is. It no longer even figures out that the relative path from `/foo/bar` to `/foo/baz/qux` is `../baz/qux`.

9 years agorollup merge of #23269: shepmaster/split-not-double-ended
Alex Crichton [Mon, 23 Mar 2015 22:07:23 +0000 (15:07 -0700)]
rollup merge of #23269: shepmaster/split-not-double-ended

Closes #23262

9 years agorollup merge of #23211: FlaPer87/oibit-send-and-friends
Alex Crichton [Mon, 23 Mar 2015 22:07:21 +0000 (15:07 -0700)]
rollup merge of #23211: FlaPer87/oibit-send-and-friends

Fixes #23225

r? @nikomatsakis