Commit Graph

40279 Commits

Author SHA1 Message Date
Niko Matsakis
70042cff97 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.
2015-03-27 14:28:25 -04:00
bors
242ed0b7c0 Auto merge of #22930 - Gankro:entry_3, r=aturon
RFC pending, but this is the patch that does it.

Totally untested. Likely needs some removed imports. std::collections docs should also be updated to provide better examples.

Closes #23508
2015-03-27 12:55:23 +00:00
Alexis Beingessner
1b98f6da7a default => or_insert per RFC 2015-03-27 07:42:03 -04:00
Alexis
93cdf1f278 update everything to use Entry defaults 2015-03-26 21:36:06 -04:00
Alexis
1c35953cf8 entry API v3: replace Entry::get with Entry::default and Entry::default_with 2015-03-26 21:36:06 -04:00
bors
53a183f027 Auto merge of #23359 - erickt:quote, r=pnkfelix
This PR allows the quote macros to unquote trait items, impl items, where clauses, and paths.
2015-03-26 18:43:56 +00:00
bors
199bdcfeff Auto merge of #23680 - erickt:inline, r=cmr
before:

test bench_read_slice  ... bench:        68 ns/iter (+/- 56)
test bench_read_vec    ... bench:        78 ns/iter (+/- 21)
test bench_write_slice ... bench:       133 ns/iter (+/- 46)
test bench_write_vec   ... bench:       308 ns/iter (+/- 69)

after:

test bench_read_slice  ... bench:        32 ns/iter (+/- 10)
test bench_read_vec    ... bench:        32 ns/iter (+/- 8)
test bench_write_slice ... bench:        53 ns/iter (+/- 12)
test bench_write_vec   ... bench:       247 ns/iter (+/- 172)
2015-03-26 16:10:23 +00:00
bors
557d4346a2 Auto merge of #21237 - erickt:derive-assoc-types, r=erickt
This PR adds support for associated types to the `#[derive(...)]` syntax extension. In order to do this, it switches over to using where predicates to apply the type constraints. So now this:

```rust
type Trait {
    type Type;
}

#[derive(Clone)]
struct Foo<A> where A: Trait {
    a: A,
    b: <A as Trait>::Type,
}
```

Gets expended into this impl:

```rust
impl<A: Clone> Clone for Foo<A> where
    A: Trait,
    <A as Trait>::Type: Clone,
{
    fn clone(&self) -> Foo<T> {
        Foo {
            a: self.a.clone(),
            b: self.b.clone(),
        }
    }
}
```
2015-03-26 13:38:41 +00:00
bors
1501f33e76 Auto merge of #23711 - alexcrichton:ip-addr, r=aturon
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
2015-03-26 09:43:35 +00:00
bors
b0fd67b3e7 Auto merge of #23691 - richo:dedup-typeorigin-mergable, r=eddyb
I've started on refactoring the error handling code to avoid the need to reparse generated errors in `span_*`, but would rather land this incrementally as one monolithic PR (and have un-fond memories of merge conflicts from various other monoliths)

r? @eddyb
2015-03-26 05:44:26 +00:00
Richo Healey
c193fe4f3c infer: Drop pointless format! calls 2015-03-25 21:44:22 -07:00
Richo Healey
e15bebfefa infer: Refactor Display impl 2015-03-25 21:44:21 -07:00
Richo Healey
385b5a3a7d infer: Move TypeOrigin formatting onto it's enum
This doesn't actually solve the issue that prompted this, at:

https://github.com/rust-lang/rust/blob/master/src/librustc/session/mod.rs#L262-271

But skimming the cfg it appears that all type information has been
discarded long before that point.
2015-03-25 21:44:21 -07:00
bors
d4ba1caa99 Auto merge of #23718 - alexcrichton:flaky-test, r=huonw
It's considered an error to access stdout while a process is being shut down, so
tweak this test a bit to actually wait for the child thread to exit.

This was discovered with a recent [snap-mac3 failure](http://buildbot.rust-lang.org/builders/snap3-mac/builds/164/steps/test/logs/stdio)
2015-03-26 02:33:36 +00:00
Alex Crichton
8165bc14fb std: Add net::IpAddr, destabilize lookup_host
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
2015-03-25 16:18:31 -07:00
Alex Crichton
02c6f6b049 test: Make a test less flaky
It's considered an error to access stdout while a process is being shut down, so
tweak this test a bit to actually wait for the child thread to exit.
2015-03-25 15:26:39 -07:00
bors
27901849e0 Auto merge of #23695 - sae-bom:mac-android-debuginfo, r=alexcrichton
1. when mac-android cross compile and make-check , make it use gdb instead of lldb so as to it passes debuginfo tests.
2. ignore some tests on aarch64
2015-03-25 21:29:50 +00:00
bors
a3b13610c5 Auto merge of #23434 - alexcrichton:misc-stab, r=aturon
Now that we check the stability of fields, the fields of this struct should also
be stable.
2015-03-25 18:59:00 +00:00
Erick Tryzelaar
92e72ee15e Speed up reading/writing slices with #[inline]
When built with `rustc -O`:

before:

test bench_read_slice  ... bench:        68 ns/iter (+/- 56)
test bench_read_vec    ... bench:        78 ns/iter (+/- 21)
test bench_write_slice ... bench:       133 ns/iter (+/- 46)
test bench_write_vec   ... bench:       308 ns/iter (+/- 69)

after:

test bench_read_slice  ... bench:        32 ns/iter (+/- 10)
test bench_read_vec    ... bench:        32 ns/iter (+/- 8)
test bench_write_slice ... bench:        53 ns/iter (+/- 12)
test bench_write_vec   ... bench:       247 ns/iter (+/- 172)
2015-03-25 09:07:46 -07:00
bors
a923278c62 Auto merge of #23697 - Manishearth:rollup, r=Manishearth
- Successful merges: #23617, #23664, #23680, #23684, #23692, #23693
- Failed merges:
2015-03-25 14:14:04 +00:00
Manish Goregaokar
e962a1d51e Rollup merge of #23702 - dotdash:match_reass, r=eddyb
The reassignment checker effectively only checks whether the last
assignment in a body affects the discriminant, but it should of course
check all the assignments.

Fixes #23698
2015-03-25 19:44:32 +05:30
Manish Goregaokar
2354fc9fac Rollup merge of #23693 - semarie:openbsd-pathbuf-new, r=nikomatsakis
`PathBuf::new` have been changed. Use `PathBuf::from` instead.

Apply the same change for freebsd too, while here.
2015-03-25 19:44:08 +05:30
Manish Goregaokar
4283b2ab50 Rollup merge of #23692 - yjh0502:fix/simd-overflow, r=pnkfelix
Disable overflow checking on SIMD operations, fix #23037
2015-03-25 19:44:08 +05:30
Manish Goregaokar
5a5845dc01 Rollup merge of #23684 - tamird:ios-fallout, r=alexcrichton
r? @aturon cc @alexcrichton
2015-03-25 19:44:08 +05:30
Björn Steinbrink
cc259fb6c3 Always properly copy values into bindings when mutating the match discriminant
The reassignment checker effectively only checks whether the last
assignment in a body affects the discriminant, but it should of course
check all the assignments.

Fixes #23698
2015-03-25 14:50:04 +01:00
Manish Goregaokar
5535767228 Rollup merge of #23664 - bluss:std-docs, r=steveklabnik
Main motivation was to update docs for the removal or "demotion" of certain extension traits. The update to the slice docs was larger, since the text was largely outdated.
2015-03-25 17:12:13 +05:30
Manish Goregaokar
b6783e6b46 Rollup merge of #23617 - steveklabnik:gh23564, r=Manishearth
Fixes #23564
2015-03-25 17:12:13 +05:30
Sae-bom Kim
c66a2b7393 Ignore some tests on aarch64 2015-03-25 18:17:33 +09:00
Sae-bom Kim
a99936b397 make it use gdb instead of lldb when mac-android cross compile 2015-03-25 18:12:35 +09:00
bors
928e2e2394 Auto merge of #23670 - cmr:vec-push-slowpath, r=pcwalton
Makes Vec::push considerably smaller: 25 instructions, rather than 42, on
x86_64.
2015-03-25 07:47:30 +00:00
Sébastien Marie
eefb8e2065 unbreak bitrig/openbsd build after 8389253d
`PathBuf::new` have been changed. Use `PathBuf::from` instead.

Apply the same change for freebsd too, while here.
2015-03-25 08:44:35 +01:00
Jihyun Yu
1663665be0 Fix ICE on SIMD overflow checking
Disable overflow checking on SIMD operations, fix #23037
2015-03-25 15:17:10 +09:00
Tamir Duberstein
eb5ed10330 [iOS] Fallout from 8389253 2015-03-24 18:50:38 -07:00
bors
593db005d4 Auto merge of #23681 - alexcrichton:rollup, r=alexcrichton 2015-03-25 01:42:42 +00:00
Alex Crichton
3021d4c564 Test fixes and rebase conflicts, round 2 2015-03-24 18:37:16 -07:00
Alex Crichton
db2c3ba0cf rollup merge of #23674: nagisa/fallout-1 2015-03-24 16:53:38 -07:00
Alex Crichton
efaef24304 Test fixes and rebase conflicts, round 1 2015-03-24 16:48:50 -07:00
bors
123a754cb8 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
2015-03-24 22:44:33 +00:00
Simonas Kazlauskas
492f07bbda Fix some fallout in librustdoc 2015-03-25 00:39:29 +02:00
Alex Crichton
19cd00094c rollup merge of #23671: steveklabnik/doc_std_clone 2015-03-24 15:27:16 -07:00
Alex Crichton
3b13b9c2b4 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
2015-03-24 15:27:14 -07:00
Alex Crichton
91b633aa03 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
2015-03-24 14:56:00 -07:00
Alex Crichton
eb2f1d925f 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
2015-03-24 14:55:15 -07:00
Alex Crichton
5ed8733ea3 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
2015-03-24 14:50:48 -07:00
Alex Crichton
020efc78f1 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
2015-03-24 14:50:48 -07:00
Alex Crichton
8a0bb42813 rollup merge of #23661: steveklabnik/any_docs
http://www.reddit.com/r/rust/comments/304q00/type_information_in_rust/cpp43lu
2015-03-24 14:50:48 -07:00
Alex Crichton
5c74ed912b rollup merge of #23659: GBGamer/master
For other permissions beside USR permissions, we need these constants.

fixes #23658
2015-03-24 14:50:47 -07:00
Alex Crichton
37d57e76fc rollup merge of #23646: steveklabnik/doc_file
This is pretty basic, but it's nice to have something.

r? @alexcrichton
2015-03-24 14:50:47 -07:00
Alex Crichton
a1d2e62c1f rollup merge of #23630: nrc/coerce-tidy
See notes on the first commit

Closes #18601

r? @nikomatsakis

cc @eddyb
2015-03-24 14:50:46 -07:00
Alex Crichton
6da0b9dedb rollup merge of #23629: liammonahan/master
Found a small typo on the Rust book "ownership" page.

Best,
Liam

r? @steveklabnik
2015-03-24 14:50:45 -07:00