Commit Graph

33682 Commits

Author SHA1 Message Date
Alex Crichton
67840513f4 rollup merge of #18509 : cakebaker/missing_ofs 2014-11-03 08:31:45 -08:00
Alex Crichton
048902db52 rollup merge of #18508 : cakebaker/fix_variable_name 2014-11-03 08:31:45 -08:00
Alex Crichton
02c234cc52 rollup merge of #18505 : bkoropoff/issue-18487 2014-11-03 08:31:45 -08:00
Alex Crichton
82efef76c3 rollup merge of #18500 : adrientetar/fonts 2014-11-03 08:31:45 -08:00
Alex Crichton
ceb5404ee8 rollup merge of #18495 : rolfvandekrol/intro-fix 2014-11-03 08:31:44 -08:00
Alex Crichton
fab6c74cf3 rollup merge of #18494 : nikomatsakis/issue-18453 2014-11-03 08:31:44 -08:00
Alex Crichton
0f4d7f248d rollup merge of #18493 : jakub-/issue-18464 2014-11-03 08:31:44 -08:00
Alex Crichton
68e7dd0ffe rollup merge of #18476 : vadimcn/17982 2014-11-03 08:31:44 -08:00
Alex Crichton
6478fcfafe rollup merge of #18470 : alexcrichton/dash-l 2014-11-03 08:31:44 -08:00
Alex Crichton
566ee9ecb3 rollup merge of #18460 : gamazeps/issue18451 2014-11-03 08:31:44 -08:00
bors
2790505c19 auto merge of #18468 : jakub-/rust/iter-repeat, r=alexcrichton
Implements a part of RFC 235.

[breaking-change]
2014-11-03 14:17:26 +00:00
bors
b9b396cd75 auto merge of #18463 : japaric/rust/bytes2, r=alexcrichton
- The `BytesContainer::container_into_owned_bytes` method has been removed

- Methods that used to take `BytesContainer` implementors by value, now take them by reference. In particular, this breaks some uses of Path:

``` rust
Path::new("foo")  // Still works
path.join(another_path) -> path.join(&another_path)
```

[breaking-change]

---

Re: `container_into_owned_bytes`, I've removed it because

- Nothing in the whole repository uses it
- Takes `self` by value, which is incompatible with unsized types (`str`)

The alternative to removing this method is to split `BytesContainer` into `BytesContainer for Sized?` and `SizedBytesContainer: BytesContainer + Sized`, where the second trait only contains the `container_into_owned_bytes` method. I tried this alternative [in another branch](https://github.com/japaric/rust/commits/bytes) and it works, but it seemed better not to create a new trait for an unused method.

Re: Breakage of `Path` methods

We could use the idea that @alexcrichton proposed in #18457 (add blanket `impl BytesContainer for &T where T: BytesContainer` + keep taking `T: BytesContainer` by value in `Path` methods) to avoid breaking any code.

r? @aturon 
cc #16918
2014-11-03 12:12:24 +00:00
bors
851799d09e auto merge of #18206 : hirschenberger/rust/issue-17713, r=thestinger
Add lint for checking exceeding bitshifts #17713

It also const-evaluates the shift width (RHS) to check more complex shifts like `1u8 << (4+5)`.
The lint-level is set to `Warn` but perhaps it must be `Deny` as in llvm exceeding bitshifts are undefined as @ben0x539 stated in #17713
2014-11-03 07:37:23 +00:00
bors
ff50f24feb auto merge of #17753 : aturon/rust/error-interop, r=alexcrichton
This PR:

* Adds the error interoperation traits (`Error` and `FromError`) to a new module, `std::error`, as per [RFC 70](https://github.com/rust-lang/rfcs/blob/master/active/0070-error-chaining.md). Note that this module must live in `std` in order to refer to `String`.

    Note that, until multidispatch lands, the `FromError` trait cannot be
usefully implemented outside of the blanket impl given here.

* Incorporates `std::error::FromError` into the `try!` macro.

* Implements `Error` for most existing error enumerations.

Closes #17747
2014-11-03 03:57:18 +00:00
bors
dcc5c3b31b auto merge of #18554 : sfackler/rust/jemalloc-fix, r=thestinger 2014-11-03 01:27:18 +00:00
Steven Fackler
711a955e0c Work around jemalloc/jemalloc#161 2014-11-02 15:52:16 -08:00
Aaron Turon
38e0745e3f Add type annotation to deal with fallout 2014-11-02 15:31:52 -08:00
Aaron Turon
7c152f870d Add Error impls to a few key error types 2014-11-02 15:31:52 -08:00
bors
b87619e274 auto merge of #18456 : gamazeps/rust/issue18449, r=thestinger
Made the fact that rodata is a section of the executable more explicit
Closes #18449
2014-11-02 23:27:10 +00:00
Aaron Turon
6815c2e8e8 Add error module with Error and FromError traits
As per [RFC 70](https://github.com/rust-lang/rfcs/blob/master/active/0070-error-chaining.md)

Closes #17747

Note that the `error` module must live in `std` in order to refer to `String`.

Note that, until multidispatch lands, the `FromError` trait cannot be
usefully implemented outside of the blanket impl given here.
2014-11-02 15:25:38 -08:00
bors
a294b35060 auto merge of #18406 : thestinger/rust/oom, r=cmr
This makes the low-level allocation API suitable for use cases where
out-of-memory conditions need to be handled.

Closes #18292

[breaking-change]
2014-11-02 21:22:14 +00:00
bors
0c1268451b auto merge of #18481 : sfackler/rust/enum-namespace, r=pcwalton
After a snapshot, everything can be switched over and the small bit of hackery in resolve dealing with `ENUM_STAGING_HACK` can be removed.

cc #18478
2014-11-02 19:22:16 +00:00
Jorge Aparicio
fe256f8140 Remove unnecessary allocations 2014-11-01 19:56:07 -05:00
Jorge Aparicio
423e17b9df DSTify BytesContainer 2014-11-01 19:56:07 -05:00
Daniel Micay
fea985a0b5 bubble up out-of-memory errors from liballoc
This makes the low-level allocation API suitable for use cases where
out-of-memory conditions need to be handled.

Closes #18292

[breaking-change]
2014-11-01 19:23:20 -04:00
bors
3327ecca42 auto merge of #17595 : danburkert/rust/tuple-index-deserialization, r=alexcrichton
Currently `Decoder` implementations are not provided the tuple arity as
a parameter to `read_tuple`. This forces all encoder/decoder combos to
serialize the arity along with the elements. Tuple-arity is always known
statically at the decode site, because it is part of the type of the
tuple, so it could instead be provided as an argument to `read_tuple`,
as it is to `read_struct`.

The upside to this is that serialized tuples could become smaller in
encoder/decoder implementations which choose not to serialize type
(arity) information. For example, @TyOverby's
[binary-encode](https://github.com/TyOverby/binary-encode) format is
currently forced to serialize the tuple-arity along with every tuple,
despite the information being statically known at the decode site.

A downside to this change is that the tuple-arity of serialized tuples
can no longer be automatically checked during deserialization. However,
for formats which do serialize the tuple-arity, either explicitly (rbml)
or implicitly (json), this check can be added to the `read_tuple` method.

The signature of `Deserialize::read_tuple` and
`Deserialize::read_tuple_struct` are changed, and thus binary
backwards-compatibility is broken. This change does *not* force
serialization formats to change, and thus does not break decoding values
serialized prior to this change.

[breaking-change]
2014-11-01 22:41:48 +00:00
bors
39f90aead4 auto merge of #18474 : alexcrichton/rust/no-more-traits, r=aturon
As part of the collections reform RFC, this commit removes all collections
traits in favor of inherent methods on collections themselves. All methods
should continue to be available on all collections.

This is a breaking change with all of the collections traits being removed and
no longer being in the prelude. In order to update old code you should move the
trait implementations to inherent implementations directly on the type itself.

Note that some traits had default methods which will also need to be implemented
to maintain backwards compatibility.

[breaking-change]
cc #18424
2014-11-01 20:21:47 +00:00
Alex Crichton
21ac985af4 collections: Remove all collections traits
As part of the collections reform RFC, this commit removes all collections
traits in favor of inherent methods on collections themselves. All methods
should continue to be available on all collections.

This is a breaking change with all of the collections traits being removed and
no longer being in the prelude. In order to update old code you should move the
trait implementations to inherent implementations directly on the type itself.

Note that some traits had default methods which will also need to be implemented
to maintain backwards compatibility.

[breaking-change]
cc #18424
2014-11-01 11:37:04 -07:00
Dan Burkert
05f6bdaefc Tuple deserialization should not fail 2014-11-01 10:54:34 -07:00
Dan Burkert
ca6b082c05 libserialize: tuple-arity should be provided to Decoder::read_tuple
Currently `Decoder` implementations are not provided the tuple arity as
a parameter to `read_tuple`. This forces all encoder/decoder combos to
serialize the arity along with the elements. Tuple-arity is always known
statically at the decode site, because it is part of the type of the
tuple, so it could instead be provided as an argument to `read_tuple`,
as it is to `read_struct`.

The upside to this is that serialized tuples could become smaller in
encoder/decoder implementations which choose not to serialize type
(arity) information. For example, @TyOverby's
[binary-encode](https://github.com/TyOverby/binary-encode) format is
currently forced to serialize the tuple-arity along with every tuple,
despite the information being statically known at the decode site.

A downside to this change is that the tuple-arity of serialized tuples
can no longer be automatically checked during deserialization. However,
for formats which do serialize the tuple-arity, either explicitly (rbml)
or implicitly (json), this check can be added to the `read_tuple` method.

The signature of `Deserialize::read_tuple` and
`Deserialize::read_tuple_struct` are changed, and thus binary
backwards-compatibility is broken. This change does *not* force
serialization formats to change, and thus does not break decoding values
serialized prior to this change.

[breaking-change]
2014-11-01 10:54:34 -07:00
Daniel Hofstetter
83225cc38d Reference: Add missing of's 2014-11-01 15:34:01 +01:00
Daniel Hofstetter
88d7f0a8da Guide: Fix variable name 2014-11-01 14:56:48 +01:00
bors
0547a407aa auto merge of #18457 : japaric/rust/tocstr, r=alexcrichton
Methods that used to take `ToCStr` implementors by value, now take them by reference. In particular, this breaks some uses of `Command`:

``` rust
Command::new("foo");  // Still works
Command::new(path) -> Command::new(&path)
cmd.arg(string) -> cmd.arg(&string) or cmd.arg(string.as_slice())
```

[breaking-change]

---

It may be sensible to remove `impl ToCstr for String` since:
- We're getting `impl Deref<str> for String`, so `string.to_cstr()` would still work
- `Command` methods would still be able to use `cmd.arg(string[..])` instead of `cmd.arg(&string)`.

But, I'm leaving that up to the library stabilization process.

r? @aturon 
cc #16918
2014-11-01 11:21:47 +00:00
Brian Koropoff
205f84f13c Add compile-fail test of DST rvalues resulting from overloaded index 2014-11-01 01:56:09 -07:00
Falco Hirschenberger
e5058a8f0c Add lint for checking exceeding bitshifts #17713 2014-11-01 09:10:10 +01:00
Brian Koropoff
6b93b4eb7c Add regression test for #18487 2014-10-31 23:42:48 -07:00
Brian Koropoff
8a9ced1551 Fix trans of index overload expressions with DST result types
Closes #18487
2014-10-31 23:31:16 -07:00
bors
51a25c7f96 auto merge of #18422 : michaelwoerister/rust/windows-freeze-fix, r=alexcrichton
On some Windows versions of GDB this is more stable than setting breakpoints via function names. This is also something I wanted to do for some time now because it makes the tests more consistent.

@brson:
These changes are in response to issue #17540. It works on my machine with the toolchain mentioned in the issue. In order to find out if the problem is really worked around, we also need to make the build bots use the newer GDB version again.
2014-11-01 03:56:44 +00:00
Steven Fackler
d7ff7da65a First stage of enum namespacing changes 2014-10-31 20:43:35 -07:00
bors
1442235d3f auto merge of #18371 : nikomatsakis/rust/issue-18262, r=pcwalton
Teach variance checker about the lifetime bounds that appear in trait object types.

[breaking-change] This patch fixes a hole in the type system which resulted in lifetime parameters that were only used in trait objects not being checked. It's hard to characterize precisely the changes that might be needed to fix target code.

cc #18262 (this fixes the test case by @jakub- but I am not sure if this is the same issue that @alexcrichton was reporting)

r? @pnkfelix 

Fixes #18205
2014-11-01 01:41:45 +00:00
bors
88b6e93d35 auto merge of #18177 : nick29581/rust/ufcs2, r=nikomatsakis
r?

closes #18061
2014-10-31 23:36:48 +00:00
Adrien Tétar
f4fb57b110 doc: enable OpenType kerning and ligatures 2014-11-01 00:16:48 +01:00
Adrien Tétar
c809a4ff01 Update one corrupt webfont
As with last time (where I marked .woff files as binary so that git does
not perform newline normalization), it's unclear how it got corrupted in
the first place.
2014-11-01 00:15:35 +01:00
Adrien Tétar
3a72bc3f1c rustdoc: stop trying to use font-variants we don't have
Browser-generated weights or slants is the last thing we want...
2014-11-01 00:06:49 +01:00
Nick Cameron
060566f08a Fix RustDoc bug 2014-11-01 11:05:12 +13:00
Nick Cameron
2474d7d2c4 Rebasing and review changes 2014-11-01 11:05:12 +13:00
Nick Cameron
318472bea9 test 2014-11-01 11:05:12 +13:00
Nick Cameron
1397f990fe Cross crait inherant impls 2014-11-01 11:05:12 +13:00
Nick Cameron
d416d16cce Remove FnStyle from DefFn and DefStaticMethod 2014-11-01 11:05:12 +13:00
Nick Cameron
4e7d86c079 Resolve methods called as functions and...
...defined in another crate.

Fixes #18061
2014-11-01 11:03:50 +13:00