]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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)

9 years agobetter document the hacks required to test libcollections
Jorge Aparicio [Sat, 14 Mar 2015 00:44:02 +0000 (19:44 -0500)]
better document the hacks required to test libcollections

9 years agoimpl f{32,64}
Jorge Aparicio [Sat, 14 Mar 2015 00:13:35 +0000 (19:13 -0500)]
impl f{32,64}

9 years agojoin lines in makefile
Jorge Aparicio [Fri, 13 Mar 2015 23:32:42 +0000 (18:32 -0500)]
join lines in makefile

9 years agofix after rebase
Jorge Aparicio [Thu, 12 Mar 2015 05:41:10 +0000 (00:41 -0500)]
fix after rebase

9 years agopreemptively fix windows compilation errors
Jorge Aparicio [Thu, 12 Mar 2015 05:25:33 +0000 (00:25 -0500)]
preemptively fix windows compilation errors

9 years agomove some tests back to libcollections
Jorge Aparicio [Thu, 12 Mar 2015 00:44:02 +0000 (19:44 -0500)]
move some tests back to libcollections

9 years agoenable enum_set tests
Jorge Aparicio [Thu, 12 Mar 2015 00:28:58 +0000 (19:28 -0500)]
enable enum_set tests

9 years agoremove imports
Jorge Aparicio [Wed, 11 Mar 2015 16:42:57 +0000 (11:42 -0500)]
remove imports

9 years agoextract libcollections tests into libcollectionstest
Jorge Aparicio [Wed, 11 Mar 2015 04:58:16 +0000 (23:58 -0500)]
extract libcollections tests into libcollectionstest

9 years agoimpl {i,u}{8,16,32,64,size}
Jorge Aparicio [Wed, 11 Mar 2015 04:13:40 +0000 (23:13 -0500)]
impl {i,u}{8,16,32,64,size}

9 years agoimpl<T> *const T, impl<T> *mut T
Jorge Aparicio [Wed, 11 Mar 2015 04:13:36 +0000 (23:13 -0500)]
impl<T> *const T, impl<T> *mut T

9 years agoimpl<T> [T]
Jorge Aparicio [Wed, 11 Mar 2015 04:13:29 +0000 (23:13 -0500)]
impl<T> [T]

9 years agoimpl str
Jorge Aparicio [Wed, 11 Mar 2015 04:13:24 +0000 (23:13 -0500)]
impl str

9 years agoimpl char
Jorge Aparicio [Wed, 11 Mar 2015 04:13:16 +0000 (23:13 -0500)]
impl char

9 years agoallow inherent implementations on primitives
Jorge Aparicio [Wed, 11 Mar 2015 04:12:55 +0000 (23:12 -0500)]
allow inherent implementations on primitives

9 years agoAuto merge of #23352 - alexcrichton:stabilize-net, r=aturon
bors [Tue, 17 Mar 2015 00:50:26 +0000 (00:50 +0000)]
Auto merge of #23352 - alexcrichton:stabilize-net, r=aturon

This commit performs a stabilization pass over the std::net module,
incorporating the changes from RFC 923. Specifically, the following actions were
taken:

Stable functionality:

* `net` (the name)
* `Shutdown`
* `Shutdown::{Read, Write, Both}`
* `lookup_host`
* `LookupHost`
* `SocketAddr`
* `SocketAddr::{V4, V6}`
* `SocketAddr::port`
* `SocketAddrV4`
* `SocketAddrV4::{new, ip, port}`
* `SocketAddrV6`
* `SocketAddrV4::{new, ip, port, flowinfo, scope_id}`
* Common trait impls for socket addr structures
* `ToSocketAddrs`
* `ToSocketAddrs::Iter`
* `ToSocketAddrs::to_socket_addrs`
* `ToSocketAddrs for {SocketAddr*, (Ipv*Addr, u16), str, (str, u16)}`
* `Ipv4Addr`
* `Ipv4Addr::{new, octets, to_ipv6_compatible, to_ipv6_mapped}`
* `Ipv6Addr`
* `Ipv6Addr::{new, segments, to_ipv4}`
* `TcpStream`
* `TcpStream::connect`
* `TcpStream::{peer_addr, local_addr, shutdown, try_clone}`
* `{Read,Write} for {TcpStream, &TcpStream}`
* `TcpListener`
* `TcpListener::bind`
* `TcpListener::{local_addr, try_clone, accept, incoming}`
* `Incoming`
* `UdpSocket`
* `UdpSocket::bind`
* `UdpSocket::{recv_from, send_to, local_addr, try_clone}`

Unstable functionality:

* Extra methods on `Ipv{4,6}Addr` for various methods of inspecting the address
  and determining qualities of it.
* Extra methods on `TcpStream` to configure various protocol options.
* Extra methods on `UdpSocket` to configure various protocol options.

Deprecated functionality:

* The `socket_addr` method has been renamed to `local_addr`

This commit is a breaking change due to the restructuring of the `SocketAddr`
type as well as the renaming of the `socket_addr` method. Migration should be
fairly straightforward, however, after accounting for the new level of
abstraction in `SocketAddr` (protocol distinction at the socket address level,
not the IP address).

[breaking-change]

9 years agoAuto merge of #23331 - eddyb:attr-lookahead, r=nikomatsakis
bors [Mon, 16 Mar 2015 22:13:52 +0000 (22:13 +0000)]
Auto merge of #23331 - eddyb:attr-lookahead, r=nikomatsakis

Most of the changes are cleanup facilitated by straight-forward attribute handling.
This is a minor [breaking-change] for users of `quote_stmt!` (returns `Option<P<Stmt>>` now) and some of the public methods in `Parser` (a few `Vec<Attribute>` arguments/returns were removed).

r? @nikomatsakis

9 years agothread: 'dur' -> 'duration'
Tshepang Lekhonkhobe [Mon, 16 Mar 2015 21:23:39 +0000 (23:23 +0200)]
thread: 'dur' -> 'duration'

Also:

- italize the binding name
- complete a sentence

9 years agoAuto merge of #23342 - apasel422:23327, r=alexcrichton
bors [Mon, 16 Mar 2015 19:35:42 +0000 (19:35 +0000)]
Auto merge of #23342 - apasel422:23327, r=alexcrichton

closes #23327

9 years agoFix 404 to crates.io's doc on integrating with a native toolchain
Paul ADENOT [Mon, 16 Mar 2015 18:56:14 +0000 (19:56 +0100)]
Fix 404 to crates.io's doc on integrating with a native toolchain

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 agostd: Stabilize the Write::flush method
Alex Crichton [Mon, 16 Mar 2015 17:56:08 +0000 (10:56 -0700)]
std: Stabilize the Write::flush method

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 agoImprove error handling in libflate
Tobias Bucher [Sun, 15 Mar 2015 20:35:48 +0000 (21:35 +0100)]
Improve error handling in libflate

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`.

9 years agoAuto merge of #23347 - aturon:stab-misc, r=alexcrichton
bors [Mon, 16 Mar 2015 17:02:11 +0000 (17:02 +0000)]
Auto merge of #23347 - aturon:stab-misc, r=alexcrichton

This commit deprecates the `count`, `range` and `range_step` functions
in `iter`, in favor of range notation. To recover all existing
functionality, a new `step_by` adapter is provided directly on `ops::Range`
and `ops::RangeFrom`.

[breaking-change]

r? @alexcrichton

9 years agoRegression test for #13077
Tamir Duberstein [Sun, 15 Mar 2015 20:30:37 +0000 (13:30 -0700)]
Regression test for #13077

Closes #13077.

9 years agoRegression test for #16922
Tamir Duberstein [Sun, 15 Mar 2015 20:30:37 +0000 (13:30 -0700)]
Regression test for #16922

Closes #16922.

9 years agoRegression test for #20714
Tamir Duberstein [Sun, 15 Mar 2015 20:30:37 +0000 (13:30 -0700)]
Regression test for #20714

Closes #20714.

9 years agoRegression test for #20396
Tamir Duberstein [Sun, 15 Mar 2015 20:30:37 +0000 (13:30 -0700)]
Regression test for #20396

Closes #20396.

9 years agoRegression test for #20261
Tamir Duberstein [Sun, 15 Mar 2015 20:30:37 +0000 (13:30 -0700)]
Regression test for #20261

Closes #20261.

9 years agoConsistent spacing
Tamir Duberstein [Sun, 15 Mar 2015 20:30:04 +0000 (13:30 -0700)]
Consistent spacing

9 years agoRegression test for #20225
Tamir Duberstein [Sun, 15 Mar 2015 20:25:46 +0000 (13:25 -0700)]
Regression test for #20225

Closes #20225.

9 years agoRegression test for #19982
Tamir Duberstein [Sun, 15 Mar 2015 19:44:37 +0000 (12:44 -0700)]
Regression test for #19982

Closes #17165, #19982.

9 years agoRegression test for #18919
Tamir Duberstein [Sun, 15 Mar 2015 20:14:15 +0000 (13:14 -0700)]
Regression test for #18919

Closes #18919.

9 years agoRegression test for #13407
Tamir Duberstein [Sun, 15 Mar 2015 19:05:10 +0000 (12:05 -0700)]
Regression test for #13407

Closes #13407.

9 years agoRegression test for #11820
Tamir Duberstein [Sun, 15 Mar 2015 18:57:33 +0000 (11:57 -0700)]
Regression test for #11820

Closes #11820.

9 years agoRegression test for #9951
Tamir Duberstein [Sun, 15 Mar 2015 18:46:51 +0000 (11:46 -0700)]
Regression test for #9951

Closes #9951.

9 years agoAuto merge of #23395 - bluss:tuple-macro, r=alexcrichton
bors [Mon, 16 Mar 2015 14:29:13 +0000 (14:29 +0000)]
Auto merge of #23395 - bluss:tuple-macro, r=alexcrichton

Remove the unused parts of the tuple macro in libcore (for `val0` and similar removed methods). Also adjust the module docs accordingly.

9 years agodocument undefined collection behavior with interior mutability
Andrew Paseltiner [Fri, 13 Mar 2015 17:47:55 +0000 (13:47 -0400)]
document undefined collection behavior with interior mutability

closes #23327

9 years agoAuto merge of #23404 - richo:ppc-configure, r=sanxiyn
bors [Mon, 16 Mar 2015 11:55:39 +0000 (11:55 +0000)]
Auto merge of #23404 - richo:ppc-configure, r=sanxiyn

Finally making progress on a fully native toolchain. Specifically, this makes it possible to move forward by building librustllvm on the target platform.

9 years agoAuto merge of #23411 - cmr:test-7950, r=huonw
bors [Mon, 16 Mar 2015 07:37:27 +0000 (07:37 +0000)]
Auto merge of #23411 - cmr:test-7950, r=huonw

Closes #7950

9 years agoAdd test for #7950
Corey Richardson [Mon, 16 Mar 2015 07:33:12 +0000 (03:33 -0400)]
Add test for #7950

Closes #7950

9 years ago[BREAKING] Rename two instances of MAP_NONRESERVE
Nicholas [Mon, 16 Mar 2015 06:03:18 +0000 (23:03 -0700)]
[BREAKING] Rename two instances of MAP_NONRESERVE

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

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

9 years agoReviewer changes
Nick Cameron [Mon, 16 Mar 2015 04:01:12 +0000 (17:01 +1300)]
Reviewer changes

9 years agoAuto merge of #23394 - tanadeau:remove-old_io-notes, r=alexcrichton
bors [Mon, 16 Mar 2015 03:55:13 +0000 (03:55 +0000)]
Auto merge of #23394 - tanadeau:remove-old_io-notes, r=alexcrichton

r? @alexcrichton

9 years agopowerpc: Support configure on native ppc[64] hosts
Richo Healey [Mon, 16 Mar 2015 03:04:04 +0000 (20:04 -0700)]
powerpc: Support configure on native ppc[64] hosts

9 years agoAuto merge of #23396 - semarie:remove-sized-bounds, r=sfackler
bors [Mon, 16 Mar 2015 01:23:30 +0000 (01:23 +0000)]
Auto merge of #23396 - semarie:remove-sized-bounds, r=sfackler

cc @alexcrichton

9 years agoresolve: factor out resolve imports to its own module
Nick Cameron [Sun, 15 Mar 2015 21:44:19 +0000 (10:44 +1300)]
resolve: factor out resolve imports to its own module

9 years agoFallout in testing.
Nick Cameron [Sun, 15 Mar 2015 20:00:41 +0000 (09:00 +1300)]
Fallout in testing.

9 years agoError if `pub use` references a private item.
Nick Cameron [Sun, 15 Mar 2015 05:47:00 +0000 (18:47 +1300)]
Error if `pub use` references a private item.

[breaking-change]

Closes #23266

9 years agoMisc tidy ups in resolve
Nick Cameron [Sun, 15 Mar 2015 05:46:44 +0000 (18:46 +1300)]
Misc tidy ups in resolve

9 years agoAuto merge of #23206 - nagisa:print-io, r=alexcrichton
bors [Sun, 15 Mar 2015 21:16:04 +0000 (21:16 +0000)]
Auto merge of #23206 - nagisa:print-io, r=alexcrichton

r? @alexcrichton or @aturon

This still needs to somehow figure out how to avoid unstable warnings arising from the use of unstable functions. I tried to use `#[allow_internal_unstable]` but it still spits out warnings as far as I can see. @huonw (I think you implemented it) does `#[allow_internal_unstable]` not work for some reason or am I using it incorrectly?

9 years agoAuto merge of #23353 - alexcrichton:stabilize-os, r=aturon
bors [Sun, 15 Mar 2015 18:42:54 +0000 (18:42 +0000)]
Auto merge of #23353 - alexcrichton:stabilize-os, r=aturon

This commit starts to organize the `std::os::$platform` modules and in the
process stabilizes some of the functionality contained within. The organization
of these modules will reflect the organization of the standard library itself
with extension traits for primitives in the same corresponding module.

The OS-specific modules will grow more functionality over time including
concrete types that are not extending functionality of other structures, and
these will either go into the closest module in `std::os::$platform` or they
will grow a new module in the hierarchy.

The following items are now stable:

* `os::{unix, windows}`
* `unix::ffi`
* `unix::ffi::OsStrExt`
* `unix::ffi::OsStrExt::{from_bytes, as_bytes, to_cstring}`
* `unix::ffi::OsString`
* `unix::ffi::OsStringExt::{from_vec, into_vec}`
* `unix::process`
* `unix::process::CommandExt`
* `unix::process::CommandExt::{uid, gid}`
* `unix::process::ExitStatusExt`
* `unix::process::ExitStatusExt::signal`
* `unix::prelude`
* `windows::ffi`
* `windows::ffi::OsStringExt`
* `windows::ffi::OsStringExt::from_wide`
* `windows::ffi::OsStrExt`
* `windows::ffi::OsStrExt::encode_wide`
* `windows::prelude`

The following items remain unstable:

* `unix::io`
* `unix::io::{Fd, AsRawFd}`
* `unix::fs::{PermissionsExt, OpenOptionsExt}`
* `windows::io`
* `windows::io::{Handle, AsRawHandle}`
* `windows::io::{Socket, AsRawSocket}`
* `windows::fs`
* `windows::fs::OpenOptionsExt`

Due to the reorgnization of the platform extension modules, this commit is a
breaking change. Most imports can be fixed by adding the relevant libstd module
in the `use` path (such as `ffi` or `fs`).

[breaking-change]

9 years agoStrip trailing whitespace
Tamir Duberstein [Sat, 14 Mar 2015 23:09:26 +0000 (16:09 -0700)]
Strip trailing whitespace

9 years agostd: Clean up the sys::thread modules
Alex Crichton [Fri, 13 Mar 2015 03:21:17 +0000 (20:21 -0700)]
std: Clean up the sys::thread modules

This module had become a #[cfg] jungle, try to bring at least a small semblance
of order to it!

9 years agounbreak freebsd/openbsd/bitrig build after #23316
Sébastien Marie [Sun, 15 Mar 2015 17:30:43 +0000 (18:30 +0100)]
unbreak freebsd/openbsd/bitrig build after #23316

9 years agostd: Stabilize portions of `std::os::$platform`
Alex Crichton [Sat, 14 Mar 2015 00:12:38 +0000 (17:12 -0700)]
std: Stabilize portions of `std::os::$platform`

This commit starts to organize the `std::os::$platform` modules and in the
process stabilizes some of the functionality contained within. The organization
of these modules will reflect the organization of the standard library itself
with extension traits for primitives in the same corresponding module.

The OS-specific modules will grow more functionality over time including
concrete types that are not extending functionality of other structures, and
these will either go into the closest module in `std::os::$platform` or they
will grow a new module in the hierarchy.

The following items are now stable:

* `os::{unix, windows}`
* `unix::ffi`
* `unix::ffi::OsStrExt`
* `unix::ffi::OsStrExt::{from_bytes, as_bytes, to_cstring}`
* `unix::ffi::OsString`
* `unix::ffi::OsStringExt::{from_vec, into_vec}`
* `unix::process`
* `unix::process::CommandExt`
* `unix::process::CommandExt::{uid, gid}`
* `unix::process::ExitStatusExt`
* `unix::process::ExitStatusExt::signal`
* `unix::prelude`
* `windows::ffi`
* `windows::ffi::OsStringExt`
* `windows::ffi::OsStringExt::from_wide`
* `windows::ffi::OsStrExt`
* `windows::ffi::OsStrExt::encode_wide`
* `windows::prelude`

The following items remain unstable:

* `unix::io`
* `unix::io::{Fd, AsRawFd}`
* `unix::fs::{PermissionsExt, OpenOptionsExt}`
* `windows::io`
* `windows::io::{Handle, AsRawHandle}`
* `windows::io::{Socket, AsRawSocket}`
* `windows::fs`
* `windows::fs::OpenOptionsExt`

Due to the reorgnization of the platform extension modules, this commit is a
breaking change. Most imports can be fixed by adding the relevant libstd module
in the `use` path (such as `ffi` or `fs`).

[breaking-change]

9 years agocore: Update tuple doc
Ulrik Sverdrup [Sun, 15 Mar 2015 17:15:17 +0000 (18:15 +0100)]
core: Update tuple doc

Remove mention of removed methods `.val0` etc.

9 years agocore: Remove unused parts of tuple macro
Ulrik Sverdrup [Sun, 15 Mar 2015 17:15:38 +0000 (18:15 +0100)]
core: Remove unused parts of tuple macro

9 years agoStrip all leading/trailing newlines
Tamir Duberstein [Sat, 14 Mar 2015 23:29:28 +0000 (16:29 -0700)]
Strip all leading/trailing newlines

9 years agoAuto merge of #23387 - Manishearth:rollup, r=Manishearth
bors [Sun, 15 Mar 2015 16:06:04 +0000 (16:06 +0000)]
Auto merge of #23387 - Manishearth:rollup, r=Manishearth

- Successful merges: #23375, #23379, #23382, #23384
- Failed merges:

9 years agoRemoved old_io note from std::net
Trent Nadeau [Sun, 15 Mar 2015 15:31:38 +0000 (11:31 -0400)]
Removed old_io note from std::net

9 years agoAuto merge of #23372 - tamird:fix-ios-compilation, r=alexcrichton
bors [Sun, 15 Mar 2015 13:32:21 +0000 (13:32 +0000)]
Auto merge of #23372 - tamird:fix-ios-compilation, r=alexcrichton

r? @alexcrichton cc @vhbit

9 years agoRollup merge of #23384 - daboross:patch-2, r=alexcrichton
Manish Goregaokar [Sun, 15 Mar 2015 10:10:18 +0000 (15:40 +0530)]
Rollup merge of #23384 - daboross:patch-2, r=alexcrichton

This changed `an String` to `a String`. Very minor change!

The usage of `an String` was introduced in https://github.com/rust-lang/rust/commit/a828e7948069f310dc5b33be8edb65e5e8e0cf9a#diff-b596503c7c33ce457b6d047e351ac12bR423, which changed `an OsString` to `an String`.

9 years agoRollup merge of #23382 - FuGangqiang:typos, r=alexcrichton
Manish Goregaokar [Sun, 15 Mar 2015 10:10:18 +0000 (15:40 +0530)]
Rollup merge of #23382 - FuGangqiang:typos, r=alexcrichton

9 years agoRollup merge of #23379 - kballard:tweak-stdio-docs-no-raw-constructors, r=alexcrichton
Manish Goregaokar [Sun, 15 Mar 2015 10:10:18 +0000 (15:40 +0530)]
Rollup merge of #23379 - kballard:tweak-stdio-docs-no-raw-constructors, r=alexcrichton

`std::io` does not currently expose the `stdin_raw`, `stdout_raw`, or
`stderr_raw` functions. According to the current plans for stdio (see
rust-lang/rfcs#517), raw access will likely be provided using the
platform-specific `std::os::{unix,windows}` modules. At the moment we
don't expose any way to do this. As such, delete all mention of the
`*_raw` functions from the `stdin`/`stdout`/`stderr` function
documentation.

While we're at it, remove a few `pub`s from items that aren't exposed.
This is done just to lessen the confusion experienced by anyone who
looks at the source in an attempt to find the `*_raw` functions.

9 years agoRollup merge of #23375 - kballard:remove-old_io-recommendation-from-io, r=huonw
Manish Goregaokar [Sun, 15 Mar 2015 10:10:18 +0000 (15:40 +0530)]
Rollup merge of #23375 - kballard:remove-old_io-recommendation-from-io, r=huonw

Now that `old_io` is deprecated and `std::io` is stable, we should stop
recommending the use of `old_io` in the module documentation.

9 years agoAuto merge of #23316 - alexcrichton:less-question-sized, r=aturon
bors [Sun, 15 Mar 2015 09:18:42 +0000 (09:18 +0000)]
Auto merge of #23316 - alexcrichton:less-question-sized, r=aturon

It is a frequent pattern among I/O functions to take `P: AsPath + ?Sized` or
`AsOsStr` instead of `AsPath`. Most of these functions do not need to take
ownership of their argument, but for libraries in general it's much more
ergonomic to not deal with `?Sized` at all and simply require an argument `P`
instead of `&P`.

This change is aimed at removing unsightly `?Sized` bounds while retaining the
same level of usability as before. All affected functions now take ownership of
their arguments instead of taking them by reference, but due to the forwarding
implementations of `AsOsStr` and `AsPath` all code should continue to work as it
did before.

This is strictly speaking a breaking change due to the signatures of these
functions changing, but normal idiomatic usage of these APIs should not break in
practice.

[breaking-change]

9 years agoImplement `winsize()` for {ios,dragonfly}
Tamir Duberstein [Sat, 14 Mar 2015 22:39:46 +0000 (15:39 -0700)]
Implement `winsize()` for {ios,dragonfly}

`sys/ttycom.h` in both:
`#define TIOCGWINSZ  _IOR('t', 104, struct winsize)  /* get window size */`

9 years agoFallout of c933d44f7bb9
Tamir Duberstein [Sat, 14 Mar 2015 22:38:59 +0000 (15:38 -0700)]
Fallout of c933d44f7bb9

9 years agoFix an String -> a String in env.rs documentation
Dabo Ross [Sun, 15 Mar 2015 07:00:26 +0000 (00:00 -0700)]
Fix an String -> a String in env.rs documentation

Super minor change!

The `an String` was introduced in https://github.com/rust-lang/rust/commit/a828e7948069f310dc5b33be8edb65e5e8e0cf9a#diff-b596503c7c33ce457b6d047e351ac12bR423, which changed `an OsString` to `an String`.

9 years agostd: Remove ?Sized bounds from many I/O functions
Alex Crichton [Thu, 12 Mar 2015 19:59:53 +0000 (12:59 -0700)]
std: Remove ?Sized bounds from many I/O functions

It is a frequent pattern among I/O functions to take `P: AsPath + ?Sized` or
`AsOsStr` instead of `AsPath`. Most of these functions do not need to take
ownership of their argument, but for libraries in general it's much more
ergonomic to not deal with `?Sized` at all and simply require an argument `P`
instead of `&P`.

This change is aimed at removing unsightly `?Sized` bounds while retaining the
same level of usability as before. All affected functions now take ownership of
their arguments instead of taking them by reference, but due to the forwarding
implementations of `AsOsStr` and `AsPath` all code should continue to work as it
did before.

This is strictly speaking a breaking change due to the signatures of these
functions changing, but normal idiomatic usage of these APIs should not break in
practice.

[breaking-change]

9 years agofix typos
FuGangqiang [Sun, 15 Mar 2015 05:47:34 +0000 (13:47 +0800)]
fix typos

9 years agoAuto merge of #23381 - Manishearth:rollup, r=Manishearth
bors [Sun, 15 Mar 2015 05:42:41 +0000 (05:42 +0000)]
Auto merge of #23381 - Manishearth:rollup, r=Manishearth

r? @Manishearth

9 years agoRollup merge of #23368 - EduardoBautista:fix-closures-chapter, r=steveklabnik
Manish Goregaokar [Sat, 14 Mar 2015 23:44:55 +0000 (05:14 +0530)]
Rollup merge of #23368 - EduardoBautista:fix-closures-chapter, r=steveklabnik

   "body": null,

9 years agoRollup merge of #23367 - EduardoBautista:fix-indentation-in-book, r=steveklabnik
Manish Goregaokar [Sat, 14 Mar 2015 23:44:46 +0000 (05:14 +0530)]
Rollup merge of #23367 - EduardoBautista:fix-indentation-in-book, r=steveklabnik

 It was using tabs.

9 years agoRollup merge of #23365 - dotdash:array_loop_panic, r=eddyb
Manish Goregaokar [Sat, 14 Mar 2015 23:44:36 +0000 (05:14 +0530)]
Rollup merge of #23365 - dotdash:array_loop_panic, r=eddyb

 [expr; 0] currently exhibits inconsistent behaviour and [expr; n] with n > 1 triggers an LLVM assertion in case that \"expr\" diverges.