]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoUpdate docs for ToUppercase/ToLowercase structs
Matt Brubeck [Thu, 19 Mar 2015 20:34:18 +0000 (13:34 -0700)]
Update docs for ToUppercase/ToLowercase structs

`uppercase` and `lowercase` are currently named `to_uppercase` and `to_lowercase`.
Also adds a link to the `char` type documentation which has much more detail
on these iterators.

9 years agoAuto merge of #23498 - pcwalton:inline-police, r=cmr
bors [Thu, 19 Mar 2015 13:10:37 +0000 (13:10 +0000)]
Auto merge of #23498 - pcwalton:inline-police, r=cmr

r? @cmr

9 years agoAuto merge of #23507 - jbcrail:fix-comment-spelling, r=alexcrichton
bors [Thu, 19 Mar 2015 09:50:13 +0000 (09:50 +0000)]
Auto merge of #23507 - jbcrail:fix-comment-spelling, r=alexcrichton

I corrected misspelled comments in several crates.

9 years agolibunicode: Partially inline the fast paths in character class checking.
Patrick Walton [Thu, 19 Mar 2015 00:36:34 +0000 (17:36 -0700)]
libunicode: Partially inline the fast paths in character class checking.

9 years agoliballoc: Partially inline the refcount manipulation in the Arc
Patrick Walton [Thu, 19 Mar 2015 00:35:11 +0000 (17:35 -0700)]
liballoc: Partially inline the refcount manipulation in the Arc
destructor.

9 years agoFix spelling errors in comments.
Joseph Crail [Thu, 19 Mar 2015 04:48:08 +0000 (00:48 -0400)]
Fix spelling errors in comments.

I corrected misspelled comments in several crates.

9 years agoAuto merge of #23502 - Manishearth:rollup, r=Manishearth
bors [Thu, 19 Mar 2015 03:19:08 +0000 (03:19 +0000)]
Auto merge of #23502 - Manishearth:rollup, r=Manishearth

9 years agoRm unused feature
Manish Goregaokar [Thu, 19 Mar 2015 01:54:13 +0000 (07:24 +0530)]
Rm unused feature

9 years agoRollup merge of #23428 - Manishearth:ast-doc, r=steveklabnik
Manish Goregaokar [Thu, 19 Mar 2015 01:31:50 +0000 (07:01 +0530)]
Rollup merge of #23428 - Manishearth:ast-doc, r=steveklabnik

 I often have to run `ast-json` or look into the pretty-printer source to figure out what the fields of an AST enum mean. I've tried to document most of what I know (and some semi-obvious stuff).

r? @steveklabnik

f? @eddyb

9 years agoRollup merge of #23497 - steveklabnik:gh21589, r=alexcrichton
Manish Goregaokar [Thu, 19 Mar 2015 00:40:02 +0000 (06:10 +0530)]
Rollup merge of #23497 - steveklabnik:gh21589, r=alexcrichton

 Fixes #21589

9 years agoRollup merge of #23496 - steveklabnik:gh22309, r=nikomatsakis
Manish Goregaokar [Thu, 19 Mar 2015 00:39:56 +0000 (06:09 +0530)]
Rollup merge of #23496 - steveklabnik:gh22309, r=nikomatsakis

 Fixes #22309

I am pretty sure that this is the right way to do this, given the other macros, but I'm not 100% sure.

9 years agoRollup merge of #23495 - pcwalton:inline-cell, r=cmr
Manish Goregaokar [Thu, 19 Mar 2015 00:39:49 +0000 (06:09 +0530)]
Rollup merge of #23495 - pcwalton:inline-cell, r=cmr

 This is a significant performance problem in Servo.

r? @brson

9 years agoRollup merge of #23494 - mdinger:patch-1, r=steveklabnik
Manish Goregaokar [Thu, 19 Mar 2015 00:39:43 +0000 (06:09 +0530)]
Rollup merge of #23494 - mdinger:patch-1, r=steveklabnik

 Typo

9 years agoRollup merge of #23493 - steveklabnik:gh22927, r=alexcrichton
Manish Goregaokar [Thu, 19 Mar 2015 00:39:37 +0000 (06:09 +0530)]
Rollup merge of #23493 - steveklabnik:gh22927, r=alexcrichton

 And do some formatting while I'm here.

9 years agoRollup merge of #23490 - jooert:master, r=steveklabnik
Manish Goregaokar [Thu, 19 Mar 2015 00:39:31 +0000 (06:09 +0530)]
Rollup merge of #23490 - jooert:master, r=steveklabnik

 Update documentation to reflect #21824.

r? @steveklabnik

9 years agoRollup merge of #23483 - semarie:openbsd-threads, r=alexcrichton
Manish Goregaokar [Thu, 19 Mar 2015 00:39:25 +0000 (06:09 +0530)]
Rollup merge of #23483 - semarie:openbsd-threads, r=alexcrichton

 unbreak openbsd/bitrig build
- remove `pub` from `struct` (error: visibility has no effect inside functions)
- move `pthread_main_np` into function

r? @alexcrichton

9 years agoRollup merge of #23474 - nagisa:patch-1, r=steveklabnik
Manish Goregaokar [Thu, 19 Mar 2015 00:39:20 +0000 (06:09 +0530)]
Rollup merge of #23474 - nagisa:patch-1, r=steveklabnik

 r? @steveklabnik

9 years agoRollup merge of #23479 - tamird:fix-ios-build, r=aturon
Manish Goregaokar [Thu, 19 Mar 2015 00:39:02 +0000 (06:09 +0530)]
Rollup merge of #23479 - tamird:fix-ios-build, r=aturon

 r? @aturon

9 years agoRollup merge of #23475 - nikomatsakis:closure-ret-syntax, r=acrichto
Manish Goregaokar [Thu, 19 Mar 2015 00:38:56 +0000 (06:08 +0530)]
Rollup merge of #23475 - nikomatsakis:closure-ret-syntax, r=acrichto

 Require braces when a closure has an explicit return type. This is a [breaking-change]: instead of a closure like `|| -> i32 22`, prefer `|| -> i32 { 22 }`.

Fixes #23420.

9 years agoSpace and punctuation fixes
Manish Goregaokar [Wed, 18 Mar 2015 19:26:37 +0000 (00:56 +0530)]
Space and punctuation fixes

9 years agoNote ::foo::bar() in the crates guide
Steve Klabnik [Thu, 19 Mar 2015 00:24:22 +0000 (20:24 -0400)]
Note ::foo::bar() in the crates guide

Fixes #21589

9 years agoAddress huon's comments
Manish Goregaokar [Wed, 18 Mar 2015 12:36:10 +0000 (18:06 +0530)]
Address huon's comments

9 years agoDocument include!
Steve Klabnik [Wed, 18 Mar 2015 23:49:39 +0000 (19:49 -0400)]
Document include!

Fixes #22309

9 years agocore: Inline most cell methods.
Patrick Walton [Wed, 18 Mar 2015 23:44:37 +0000 (16:44 -0700)]
core: Inline most cell methods.

This is a significant performance problem in Servo.

9 years agoUpdate ast.rs
mdinger [Wed, 18 Mar 2015 23:36:23 +0000 (19:36 -0400)]
Update ast.rs

Typo

9 years agoDocument {:.*}
Steve Klabnik [Wed, 18 Mar 2015 23:15:26 +0000 (19:15 -0400)]
Document {:.*}

Fixes #22927

9 years agoSmall formatting fixes to fmt.rs
Steve Klabnik [Wed, 18 Mar 2015 23:00:51 +0000 (19:00 -0400)]
Small formatting fixes to fmt.rs

9 years agoRename should_fail to should_panic in docs
Johannes Oertel [Wed, 18 Mar 2015 21:34:40 +0000 (22:34 +0100)]
Rename should_fail to should_panic in docs

9 years agoRollup merge of #23468 - sfackler:stdio-panic, r=alexcrichton
Manish Goregaokar [Thu, 19 Mar 2015 00:38:43 +0000 (06:08 +0530)]
Rollup merge of #23468 - sfackler:stdio-panic, r=alexcrichton

 Nothing inside of the read/write interface itself can panic, so any
poison must have been the result of user code which the lock isn't
protecting.

This seems safe to me, but if we don't want to go this route we should update the docs to indicate that these methods can panic.

r? @alexcrichton

9 years agoRollup merge of #23462 - alexcrichton:stabilize-cloned, r=aturon
Manish Goregaokar [Thu, 19 Mar 2015 00:38:37 +0000 (06:08 +0530)]
Rollup merge of #23462 - alexcrichton:stabilize-cloned, r=aturon

 This commit stabilizes the `cloned` iterator after tweaking the signature to
require that the iterator is over `&T` instead of `U: Deref<T>`. This method has
had time to bake for awhile now and it's not clear whether the `Deref` bound is
worth it. Additionally, there aren't clear conventions on when to bound and/or
implement the `Deref` trait, so for now the conservative route is to require
references instead of `U: Deref<T>`.

To change this signature to using `Deref` would technically be a
backwards-incompatible change, but it is doubtful that any code will actually
break in practice.

9 years agoRollup merge of #23457 - nagisa:get-set-resources, r=alexcrichton
Manish Goregaokar [Thu, 19 Mar 2015 00:38:31 +0000 (06:08 +0530)]
Rollup merge of #23457 - nagisa:get-set-resources, r=alexcrichton

 Hopefully didn’t miss or mess up anything.

~~EDIT: ah, as usual, just didn’t bother running build before pushing a submit request button. Build pending.~~

9 years agoAuto merge of #23482 - alexcrichton:snapshots, r=aturon
bors [Thu, 19 Mar 2015 00:17:00 +0000 (00:17 +0000)]
Auto merge of #23482 - alexcrichton:snapshots, r=aturon

9 years agoRequire braces when a closure has an explicit return type. This is a
Niko Matsakis [Wed, 18 Mar 2015 13:22:38 +0000 (09:22 -0400)]
Require braces when a closure has an explicit return type. This is a
[breaking-change]: instead of a closure like `|| -> i32 22`, prefer `||
-> i32 { 22 }`.

Fixes #23420.

9 years agoRegister new snapshots
Alex Crichton [Wed, 18 Mar 2015 16:36:18 +0000 (09:36 -0700)]
Register new snapshots

9 years agoAuto merge of #23473 - Manishearth:rollup, r=Manishearth
bors [Wed, 18 Mar 2015 17:32:13 +0000 (17:32 +0000)]
Auto merge of #23473 - Manishearth:rollup, r=Manishearth

9 years agoRollup merge of #23428 - Manishearth:ast-doc, r=huon
Manish Goregaokar [Wed, 18 Mar 2015 15:02:54 +0000 (20:32 +0530)]
Rollup merge of #23428 - Manishearth:ast-doc, r=huon

 I often have to run `ast-json` or look into the pretty-printer source to figure out what the fields of an AST enum mean. I've tried to document most of what I know (and some semi-obvious stuff).

r? @steveklabnik

f? @eddyb

9 years agoRollup merge of #23455 - Ryman:trim_matches_doc, r=steveklabnik
Manish Goregaokar [Wed, 18 Mar 2015 09:09:43 +0000 (14:39 +0530)]
Rollup merge of #23455 - Ryman:trim_matches_doc, r=steveklabnik

9 years agoRollup merge of #23450 - alexcrichton:fix-sockaddr-storage, r=brson
Manish Goregaokar [Wed, 18 Mar 2015 09:09:34 +0000 (14:39 +0530)]
Rollup merge of #23450 - alexcrichton:fix-sockaddr-storage, r=brson

 The alignment field is actually a \"pointer sized\" type instead of always i64,
requiring that the size of the padding field is also calculated slightly
differently.

Closes #23425

9 years agoRollup merge of #23443 - meqif:ipv6addr-new-documentation-fix, r=steveklabnik
Manish Goregaokar [Wed, 18 Mar 2015 09:09:25 +0000 (14:39 +0530)]
Rollup merge of #23443 - meqif:ipv6addr-new-documentation-fix, r=steveklabnik

 Very minor fix: in `std::net::Ipv6Addr::new`, the documentation had an incomplete representation of the resulting address, missing the last two groups.

9 years agoRollup merge of #23392 - WiSaGaN:bugfix/fix_deprecate_link, r=Manishearth
Manish Goregaokar [Wed, 18 Mar 2015 09:09:16 +0000 (14:39 +0530)]
Rollup merge of #23392 - WiSaGaN:bugfix/fix_deprecate_link, r=Manishearth

 Since module `std::sync::mpsc` is stable now, fix the deprecated link `comm` with `sync::mpsc`.

9 years agoRollup merge of #23467 - andersk:loop-labeled-break-value, r=sanxiyn
Manish Goregaokar [Wed, 18 Mar 2015 09:09:07 +0000 (14:39 +0530)]
Rollup merge of #23467 - andersk:loop-labeled-break-value, r=sanxiyn

 Closes #23451.

9 years agoRollup merge of #23461 - alexcrichton:feat-char-at, r=aturon
Manish Goregaokar [Wed, 18 Mar 2015 09:08:56 +0000 (14:38 +0530)]
Rollup merge of #23461 - alexcrichton:feat-char-at, r=aturon

 This commit clarifies some of the unstable features in the `str` module by
moving them out of the blanket `core` and `collections` features.

The following methods were moved to the `str_char` feature which generally
encompasses decoding specific characters from a `str` and dealing with the
result. It is unclear if any of these methods need to be stabilized for 1.0 and
the most conservative route for now is to continue providing them but to leave
them as unstable under a more specific name.

* `is_char_boundary`
* `char_at`
* `char_range_at`
* `char_at_reverse`
* `char_range_at_reverse`
* `slice_shift_char`

The following methods were moved into the generic `unicode` feature as they are
specifically enabled by the `unicode` crate itself.

* `nfd_chars`
* `nfkd_chars`
* `nfc_chars`
* `graphemes`
* `grapheme_indices`
* `width`

9 years agoAdd a test
Steven Fackler [Wed, 18 Mar 2015 16:03:17 +0000 (09:03 -0700)]
Add a test

9 years agoiOS: fallout from 1d5983a
Tamir Duberstein [Wed, 18 Mar 2015 15:15:53 +0000 (08:15 -0700)]
iOS: fallout from 1d5983a

9 years agoMake it clear which value is discarded
Simonas Kazlauskas [Wed, 18 Mar 2015 12:36:23 +0000 (14:36 +0200)]
Make it clear which value is discarded

9 years agoAddress huon's comments
Manish Goregaokar [Wed, 18 Mar 2015 12:36:10 +0000 (18:06 +0530)]
Address huon's comments

9 years agoClarify Expr
Manish Goregaokar [Tue, 17 Mar 2015 12:12:20 +0000 (17:42 +0530)]
Clarify Expr

9 years agoast: Document Item and ForeignItem
Manish Goregaokar [Mon, 16 Mar 2015 23:36:13 +0000 (05:06 +0530)]
ast: Document Item and ForeignItem

9 years agoast: Document Lit
Manish Goregaokar [Mon, 16 Mar 2015 23:02:58 +0000 (04:32 +0530)]
ast: Document Lit

9 years agoast: Document Pat and Block
Manish Goregaokar [Mon, 16 Mar 2015 22:49:27 +0000 (04:19 +0530)]
ast: Document Pat and Block

9 years agoast: Document paths and `where` clauses
Manish Goregaokar [Mon, 16 Mar 2015 22:32:29 +0000 (04:02 +0530)]
ast: Document paths and `where` clauses

9 years agoast: Document Expr_, UnOp, and BinOp
Manish Goregaokar [Mon, 16 Mar 2015 22:11:23 +0000 (03:41 +0530)]
ast: Document Expr_, UnOp, and BinOp

9 years agoAdd {get,set}rlimit and getrusage to libc
Simonas Kazlauskas [Tue, 17 Mar 2015 21:00:55 +0000 (23:00 +0200)]
Add {get,set}rlimit and getrusage to libc

9 years agoopenbsd/bitrig threads
Sébastien Marie [Wed, 18 Mar 2015 09:59:09 +0000 (10:59 +0100)]
openbsd/bitrig threads

- remove `pub` from `struct` (visibility has no effect inside functions)
- move `pthread_main_np` into function

9 years agoAuto merge of #22838 - petrochenkov:bytelit, r=alexcrichton
bors [Wed, 18 Mar 2015 08:27:22 +0000 (08:27 +0000)]
Auto merge of #22838 - petrochenkov:bytelit, r=alexcrichton

This patch changes the type of byte string literals from `&[u8]` to `&[u8; N]`.
It also implements some necessary traits (`IntoBytes`, `Seek`, `Read`, `BufRead`) for fixed-size arrays (also related to #21725) and adds test for #17233, which seems to be resolved.

Fixes #18465
[breaking-change]

9 years agoRemove the newly introduced trait impls for fixed-size arrays and use &b"..."[.....
Vadim Petrochenkov [Wed, 18 Mar 2015 06:16:08 +0000 (09:16 +0300)]
Remove the newly introduced trait impls for fixed-size arrays and use &b"..."[..] instead.

9 years agoIgnore stdio mutex poison state
Steven Fackler [Wed, 18 Mar 2015 06:05:44 +0000 (23:05 -0700)]
Ignore stdio mutex poison state

Nothing inside of the read/write interface itself can panic, so any
poison must have been the result of user code which the lock isn't
protecting.

9 years agoAuto merge of #23290 - nrc:pub_priv_mod, r=nikomatsakis
bors [Wed, 18 Mar 2015 05:55:19 +0000 (05:55 +0000)]
Auto merge of #23290 - nrc:pub_priv_mod, r=nikomatsakis

Closes #22261

r? @nikomatsakis

(+ a new test coming soon...)

9 years agoInfer type ! for a loop that can only break out of other loops
Anders Kaseorg [Wed, 18 Mar 2015 05:19:53 +0000 (01:19 -0400)]
Infer type ! for a loop that can only break out of other loops

Closes #23451.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
9 years agoFix private module loophole in the 'private type in public item' check
Nick Cameron [Wed, 11 Mar 2015 21:44:56 +0000 (10:44 +1300)]
Fix private module loophole in the 'private type in public item' check

9 years agoAuto merge of #23452 - nikomatsakis:unsafety-subtyping, r=nrc
bors [Wed, 18 Mar 2015 03:22:12 +0000 (03:22 +0000)]
Auto merge of #23452 - nikomatsakis:unsafety-subtyping, r=nrc

Safe fns are no longer subtypes of unsafe fns, but you can coerce from one to the other.

This is a [breaking-change] in that impl fns must now be declared `unsafe` if the trait is declared `unsafe`. In some rare cases, the subtyping change may also direct affect you, but no such cases were encountered in practice.

Fixes #23449.

r? @nrc

9 years agostd: Stabilize `IteratorExt::cloned`
Alex Crichton [Tue, 17 Mar 2015 23:45:56 +0000 (16:45 -0700)]
std: Stabilize `IteratorExt::cloned`

This commit stabilizes the `cloned` iterator after tweaking the signature to
require that the iterator is over `&T` instead of `U: Deref<T>`. This method has
had time to bake for awhile now and it's not clear whether the `Deref` bound is
worth it. Additionally, there aren't clear conventions on when to bound and/or
implement the `Deref` trait, so for now the conservative route is to require
references instead of `U: Deref<T>`.

To change this signature to using `Deref` would technically be a
backwards-incompatible change, but it is doubtful that any code will actually
break in practice.

9 years agostd: Tweak some unstable features of `str`
Alex Crichton [Tue, 10 Mar 2015 23:29:02 +0000 (16:29 -0700)]
std: Tweak some unstable features of `str`

This commit clarifies some of the unstable features in the `str` module by
moving them out of the blanket `core` and `collections` features.

The following methods were moved to the `str_char` feature which generally
encompasses decoding specific characters from a `str` and dealing with the
result. It is unclear if any of these methods need to be stabilized for 1.0 and
the most conservative route for now is to continue providing them but to leave
them as unstable under a more specific name.

* `is_char_boundary`
* `char_at`
* `char_range_at`
* `char_at_reverse`
* `char_range_at_reverse`
* `slice_shift_char`

The following methods were moved into the generic `unicode` feature as they are
specifically enabled by the `unicode` crate itself.

* `nfd_chars`
* `nfkd_chars`
* `nfc_chars`
* `graphemes`
* `grapheme_indices`
* `width`

9 years agoAuto merge of #23438 - nikomatsakis:issue-23435-default-methods-with-where-clauses...
bors [Wed, 18 Mar 2015 00:51:03 +0000 (00:51 +0000)]
Auto merge of #23438 - nikomatsakis:issue-23435-default-methods-with-where-clauses, r=nrc

Fixes #23435

9 years agoFix byte string literal patterns in match
Vadim Petrochenkov [Mon, 9 Mar 2015 19:19:11 +0000 (22:19 +0300)]
Fix byte string literal patterns in match

9 years agoAvoid metadata bloat by using trait FixedSizeArray
Vadim Petrochenkov [Fri, 27 Feb 2015 19:48:51 +0000 (22:48 +0300)]
Avoid metadata bloat by using trait FixedSizeArray

9 years agoAdd and fix more tests
Vadim Petrochenkov [Thu, 26 Feb 2015 15:00:41 +0000 (18:00 +0300)]
Add and fix more tests

9 years agoFixed-size byte string literals (RFC 339)
Vadim Petrochenkov [Thu, 26 Feb 2015 08:25:16 +0000 (11:25 +0300)]
Fixed-size byte string literals (RFC 339)

9 years agoMove unsafety out of the subtyping relation and into coercion.
Niko Matsakis [Tue, 17 Mar 2015 19:22:11 +0000 (15:22 -0400)]
Move unsafety out of the subtyping relation and into coercion.

9 years agoAuto merge of #23376 - eddyb:die-tydesc-die, r=nikomatsakis
bors [Tue, 17 Mar 2015 21:23:02 +0000 (21:23 +0000)]
Auto merge of #23376 - eddyb:die-tydesc-die, r=nikomatsakis

Final remnant of reflection is gone. Also, virtual `Trait` destructors are no longer tied to `Box`.
That means they can be used to drop any instance of the type (used in libarena to replace TyDesc).

This is [breaking-change] for direct users of intrinsics:
* use `intrinsics::type_name::<T>()` instead of `(*intrinsics::get_tydesc::<T>()).name`
* the only way to get the destructor is from a trait object's vtable (see libarena changes)

r? @pcwalton f? @dotdash

9 years agoFix documentation for StrExt::trim_matches
Kevin Butler [Tue, 17 Mar 2015 20:23:42 +0000 (20:23 +0000)]
Fix documentation for StrExt::trim_matches

9 years agoExtract out `mts` into `combine` using `tys_with_variance`
Niko Matsakis [Tue, 17 Mar 2015 14:23:13 +0000 (10:23 -0400)]
Extract out `mts` into `combine` using `tys_with_variance`

9 years agoReplace TyDesc and its uses with trait vtables and a type_name intrinsic.
Eduard Burtescu [Sun, 15 Mar 2015 02:01:57 +0000 (04:01 +0200)]
Replace TyDesc and its uses with trait vtables and a type_name intrinsic.

9 years agorustc_trans: use the drop glue of T instead of Box<T> in Trait's vtable, be it &Trait...
Eduard Burtescu [Sat, 14 Mar 2015 00:36:41 +0000 (02:36 +0200)]
rustc_trans: use the drop glue of T instead of Box<T> in Trait's vtable, be it &Trait or Box<Trait>.

9 years agolibc: Fix definition of sockaddr_storage on 32-bit linux
Alex Crichton [Tue, 17 Mar 2015 17:32:00 +0000 (10:32 -0700)]
libc: Fix definition of sockaddr_storage on 32-bit linux

The alignment field is actually a "pointer sized" type instead of always i64,
requiring that the size of the padding field is also calculated slightly
differently.

Closes #23425

9 years agoAuto merge of #23330 - alexcrichton:thread-sleep, r=aturon
bors [Tue, 17 Mar 2015 17:15:54 +0000 (17:15 +0000)]
Auto merge of #23330 - alexcrichton:thread-sleep, r=aturon

This function is the current replacement for `std::old_io::timer` which will
soon be deprecated. This function is unstable and has its own feature gate as it
does not yet have an RFC nor has it existed for very long.

9 years agostd: Implement `thread::sleep`
Alex Crichton [Fri, 13 Mar 2015 03:36:31 +0000 (20:36 -0700)]
std: Implement `thread::sleep`

This function is the current replacement for `std::old_io::timer` which will
soon be deprecated. This function is unstable and has its own feature gate as it
does not yet have an RFC nor has it existed for very long.

9 years agoFix IPv6 address format in documentation
Ricardo Martins [Tue, 17 Mar 2015 14:51:47 +0000 (14:51 +0000)]
Fix IPv6 address format in documentation

Very minor fix: in `std::net::Ipv6Addr::new`, the documentation had an incomplete representation of the resulting address, missing the last two groups.

9 years agoAuto merge of #23423 - nikomatsakis:issue-18737-trait-subtyping, r=nrc
bors [Tue, 17 Mar 2015 13:29:48 +0000 (13:29 +0000)]
Auto merge of #23423 - nikomatsakis:issue-18737-trait-subtyping, r=nrc

This upcast coercion currently never requires vtable changes. It should be generalized.

This is a [breaking-change] -- if you have an impl on an object type like `impl SomeTrait`, then this will no longer be applicable to object types like `SomeTrait+Send`. In the standard library, this primarily affected `Any`, and this PR adds impls for `Any+Send` as to keep the API the same in practice. An alternate workaround is to use UFCS form or standalone fns. For more details, see <https://github.com/rust-lang/rust/issues/18737#issuecomment-78450798>.

r? @nrc

9 years agoFix soundness hole when unsizing boxes.
Niko Matsakis [Mon, 16 Mar 2015 20:26:28 +0000 (16:26 -0400)]
Fix soundness hole when unsizing boxes.

9 years agoRemove subtyping for object types and replace with an *upcast* coercion.
Niko Matsakis [Tue, 17 Feb 2015 10:17:19 +0000 (05:17 -0500)]
Remove subtyping for object types and replace with an *upcast* coercion.
This upcast coercion currently preserves the vtable for the object, but
eventually it can be used to create a derived vtable. The upcast
coercion is not introduced into method dispatch; see comment on #18737
for information about why. Fixes #18737.

9 years agoOnly test predicates if this is a default method, as a simple optimization.
Niko Matsakis [Tue, 17 Mar 2015 11:36:42 +0000 (07:36 -0400)]
Only test predicates if this is a default method, as a simple optimization.

9 years agoAuto merge of #23436 - Manishearth:rollup, r=Manishearth
bors [Tue, 17 Mar 2015 10:54:50 +0000 (10:54 +0000)]
Auto merge of #23436 - Manishearth:rollup, r=Manishearth

r? @Manishearth

9 years agoRe-bork whitespace for text file (fixup #23385)
Manish Goregaokar [Tue, 17 Mar 2015 10:30:39 +0000 (16:00 +0530)]
Re-bork whitespace for text file (fixup #23385)

9 years agoCheck that predicates hold before emitting an entry for the vtable.
Niko Matsakis [Tue, 17 Mar 2015 10:24:11 +0000 (06:24 -0400)]
Check that predicates hold before emitting an entry for the vtable.
Fixes #23435.

9 years agoRollup merge of #23432 - mzabaluev:io-into-inner-doc, r=alexcrichton
Manish Goregaokar [Tue, 17 Mar 2015 09:51:56 +0000 (15:21 +0530)]
Rollup merge of #23432 - mzabaluev:io-into-inner-doc, r=alexcrichton

 Resolves #23386.

9 years agoRollup merge of #23385 - tamird:cleanup-whitespace, r=alexcrichton
Manish Goregaokar [Tue, 17 Mar 2015 09:51:22 +0000 (15:21 +0530)]
Rollup merge of #23385 - tamird:cleanup-whitespace, r=alexcrichton

 r? @alexcrichton

Conflicts:
src/test/run-pass/test-fn-signature-verification-for-explicit-return-type.rs

9 years agoRollup merge of #23329 - jbcrail:rm-syntax-highlight, r=sanxiyn
Manish Goregaokar [Tue, 17 Mar 2015 09:50:27 +0000 (15:20 +0530)]
Rollup merge of #23329 - jbcrail:rm-syntax-highlight, r=sanxiyn

 As suggested by @steveklabnik in #23254, I removed the redundant Rust syntax highlighting from the documentation.

9 years agoRollup merge of #23427 - tshepang:dur-becomes-duration, r=steveklabnik
Manish Goregaokar [Tue, 17 Mar 2015 09:50:19 +0000 (15:20 +0530)]
Rollup merge of #23427 - tshepang:dur-becomes-duration, r=steveklabnik

 Also:

- italize the binding name
- complete a sentence

9 years agoRollup merge of #23417 - padenot:patch-1, r=steveklabnik
Manish Goregaokar [Tue, 17 Mar 2015 09:50:11 +0000 (15:20 +0530)]
Rollup merge of #23417 - padenot:patch-1, r=steveklabnik

 This looks like the most logical target to give to this link, or at least what I would expect as someone that want to integrate with a native library.

r? @steveklabnik

9 years agoRollup merge of #23415 - alexcrichton:stabilize-flush, r=aturon
Manish Goregaokar [Tue, 17 Mar 2015 09:50:03 +0000 (15:20 +0530)]
Rollup merge of #23415 - alexcrichton:stabilize-flush, r=aturon

 The [associated RFC][rfc] for possibly splitting out `flush` has been closed and
as a result there are no more blockers for stabilizing this method, so this
commit marks the method as such.

[rfc]: https://github.com/rust-lang/rfcs/pull/950

9 years agoRollup merge of #23409 - GBGamer:patch-2, r=alexcrichton
Manish Goregaokar [Tue, 17 Mar 2015 09:49:57 +0000 (15:19 +0530)]
Rollup merge of #23409 - GBGamer:patch-2, r=alexcrichton

 To the correct MAP_NORESERVE. Every other instance is known as MAP_NORESERVE, so this is just a basic typo.

I really doubt this will break anybody's but my own code.

[breaking-change]

9 years agoRollup merge of #23402 - tamird:needstest-tests, r=jakub-
Manish Goregaokar [Tue, 17 Mar 2015 09:49:51 +0000 (15:19 +0530)]
Rollup merge of #23402 - tamird:needstest-tests, r=jakub-

 @alexcrichton @jakub-

9 years agoRollup merge of #23400 - nrc:pub_use, r=eddyb
Manish Goregaokar [Tue, 17 Mar 2015 09:49:45 +0000 (15:19 +0530)]
Rollup merge of #23400 - nrc:pub_use, r=eddyb

 r? @eddyb

9 years agoRollup merge of #23399 - tbu-:pr_libflate_error, r=huonw
Manish Goregaokar [Tue, 17 Mar 2015 09:49:38 +0000 (15:19 +0530)]
Rollup merge of #23399 - tbu-:pr_libflate_error, r=huonw

 This removes the error case of the compression functions, the only errors that
can occur are incorrect parameters or an out-of-memory condition, both of which
are handled with panics in Rust.

Also introduces an extensible `Error` type instead of returning an `Option`.
The type implements a destructor so you can't destructure it.

9 years agoRefactor the emit_vtable_methods code to be a bit cleaner in its use of
Niko Matsakis [Tue, 17 Mar 2015 09:18:01 +0000 (05:18 -0400)]
Refactor the emit_vtable_methods code to be a bit cleaner in its use of
iterators.

9 years agoAuto merge of #23429 - rprichard:fix-linux-build, r=alexcrichton
bors [Tue, 17 Mar 2015 05:57:14 +0000 (05:57 +0000)]
Auto merge of #23429 - rprichard:fix-linux-build, r=alexcrichton

The RUST_TARGET_STAGE_N rule uses LLVM_LIBDIR_RUSTFLAGS_<target-triple>,
which expands to -L "$(llvm-config --libdir)" when the target-triple is
also a host-triple. Rather than expand to -L "" if llvm-config has not yet
been built, add a dependency on the target llvm-config.

When the target-triple is not a host-triple, the new LLVM_CONFIG_$(2)
dependency should expand to nothing.

r? alexcrichton

9 years agostd::io::buffered: Don't use 'flush' in documentation of into_inner
Mikhail Zabaluev [Tue, 17 Mar 2015 04:17:52 +0000 (06:17 +0200)]
std::io::buffered: Don't use 'flush' in documentation of into_inner

The word 'flush' may be misinterpreted as if `flush` is called on the
underlying writer, which is not the case.

9 years agoFix the Linux nightly build by adding a LLVM_CONFIG_<target-triple> dep.
Ryan Prichard [Tue, 17 Mar 2015 04:13:36 +0000 (21:13 -0700)]
Fix the Linux nightly build by adding a LLVM_CONFIG_<target-triple> dep.

The RUST_TARGET_STAGE_N rule uses LLVM_LIBDIR_RUSTFLAGS_<target-triple>,
which expands to -L "$(llvm-config --libdir)" when the target-triple is
also a host-triple. Rather than expand to -L "" if llvm-config has not yet
been built, add a dependency on the target llvm-config.

When the target-triple is not a host-triple, the new LLVM_CONFIG_$(2)
dependency should expand to nothing.

9 years agoAuto merge of #23104 - japaric:inherent, r=nikomatsakis
bors [Tue, 17 Mar 2015 03:23:50 +0000 (03:23 +0000)]
Auto merge of #23104 - japaric:inherent, r=nikomatsakis

- Allow inherent implementations on `char`, `str`, `[T]`, `*const T`, `*mut T` and all the numeric primitives.
- copy `unicode::char::CharExt` methods into `impl char`
- remove `unicode::char::CharExt`, its re-export `std::char::CharExt` and `CharExt` from the prelude
- copy `collections::str::StrExt` methods into `impl str`
- remove `collections::str::StrExt` its re-export `std::str::StrExt`, and `StrExt` from the prelude
- copy `collections::slice::SliceExt` methods into `impl<T> [T]`
- remove `collections::slice::SliceExt` its re-export `std::slice::SliceExt`, and `SliceExt` from the prelude
- copy `core::ptr::PtrExt` methods into `impl<T> *const T`
- remove `core::ptr::PtrExt` its re-export `std::ptr::PtrExt`, and `PtrExt` from the prelude
- copy `core::ptr::PtrExt` and `core::ptr::MutPtrExt` methods into `impl<T> *mut T`
- remove `core::ptr::MutPtrExt` its re-export `std::ptr::MutPtrExt`, and `MutPtrExt` from the prelude
- copy `core::num::Int` and `core::num::SignedInt` methods into `impl i{8,16,32,64,size}`
- copy `core::num::Int` and `core::num::UnsignedInt` methods into `impl u{8,16,32,64,size}`
- remove `core::num::UnsignedInt` and its re-export `std::num::UnsignedInt`
- move `collections` tests into its own crate: `collectionstest`
- copy `core::num::Float` methods into `impl f{32,64}`

Because this PR removes several traits, this is a [breaking-change], however functionality remains unchanged and breakage due to unresolved imports should be minimal. If you encounter an error due to an unresolved import, simply remove the import:

``` diff
  fn main() {
-     use std::num::UnsignedInt;  //~ error: unresolved import `std::num::UnsignedInt`.
-
      println!("{}", 8_usize.is_power_of_two());
  }
```

---

cc  #16862
[preview docs](http://japaric.github.io/inherent/std/index.html)
[unicode::char](http://japaric.github.io/inherent/unicode/primitive.char.html)
[collections::str](http://japaric.github.io/inherent/collections/primitive.str.html)
[std::f32](http://japaric.github.io/inherent/std/primitive.f32.html)