]> git.lizzy.rs Git - rust.git/log
rust.git
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 agoFix deprecated `comm` link.
Wangshan Lu [Sun, 15 Mar 2015 13:42:58 +0000 (21:42 +0800)]
Fix deprecated `comm` link.

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.

9 years agoRollup merge of #23363 - meqif:master, r=alexcrichton
Manish Goregaokar [Sat, 14 Mar 2015 23:44:22 +0000 (05:14 +0530)]
Rollup merge of #23363 - meqif:master, r=alexcrichton

 There was a minor typo in the book's concurrency section (\"recieve\" instead of \"receive\").

9 years agoRollup merge of #23362 - dotdash:llvm_req, r=alexcrichton
Manish Goregaokar [Sat, 14 Mar 2015 23:44:11 +0000 (05:14 +0530)]
Rollup merge of #23362 - dotdash:llvm_req, r=alexcrichton

 LLVM older that 3.6 has a bug that cause assertions when compiling certain
constructs. For 3.5 there's still a chance that the bug might get fixed
in 3.5.2, so let's keep allowing to compile with it for it for now.

9 years agoRollup merge of #23358 - rprichard:reject-empty-L, r=alexcrichton
Manish Goregaokar [Sat, 14 Mar 2015 23:44:02 +0000 (05:14 +0530)]
Rollup merge of #23358 - rprichard:reject-empty-L, r=alexcrichton

 This change closes #23303 by rejecting an empty search path.

9 years agoRollup merge of #23356 - bombless:camelcase, r=alexcrichton
Manish Goregaokar [Sat, 14 Mar 2015 23:43:52 +0000 (05:13 +0530)]
Rollup merge of #23356 - bombless:camelcase, r=alexcrichton

 non_camel_case_types lint suggests `ONETWOTHREE` for non-camel type `ONE_TWO_THREE`, which doesn't look good.
This patch fixes it.

9 years agoRollup merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichton
Manish Goregaokar [Sat, 14 Mar 2015 23:43:44 +0000 (05:13 +0530)]
Rollup merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichton

 Previously it would fail on a trivial case like

    /// Summary line
    /// <trailing space>
    /// Regular content

Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line
extractor interprets both lines as the same paragraph and includes both into the short summary resulting in
![screenshot from 2015-03-13 22 47 08](https://cloud.githubusercontent.com/assets/679122/6648596/7ef792b2-c9e4-11e4-9c19-704c288ec4de.png)

9 years agoAuto merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichton
bors [Sun, 15 Mar 2015 03:11:14 +0000 (03:11 +0000)]
Auto merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichton

Previously it would fail on a trivial case like

    /// Summary line
    /// <trailing space>
    /// Regular content

Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line
extractor interprets both lines as the same paragraph and includes both into the short summary resulting in
![screenshot from 2015-03-13 22 47 08](https://cloud.githubusercontent.com/assets/679122/6648596/7ef792b2-c9e4-11e4-9c19-704c288ec4de.png)

9 years agoRemove incorrect references to _raw stdio functions
Kevin Ballard [Sun, 15 Mar 2015 01:08:09 +0000 (18:08 -0700)]
Remove incorrect references to _raw stdio functions

std::io does not currently expose the stdin_raw, stdout_raw, or
stderr_raw functions. According to the current plans for stdio (see RFC
#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 agoAuto merge of #23313 - barosl:match-specialize-ice, r=jakub-
bors [Sun, 15 Mar 2015 00:39:54 +0000 (00:39 +0000)]
Auto merge of #23313 - barosl:match-specialize-ice, r=jakub-

The arity of `ref x` is always 1, so it needs to be dereferenced before being compared with some other type whose arity is not 1.

Fixes #23009.

9 years agoStop recommending old_io in the module doc for std::io
Kevin Ballard [Sun, 15 Mar 2015 00:36:36 +0000 (17:36 -0700)]
Stop recommending old_io in the module doc for std::io

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 agoUse new io in print and println macroses
Simonas Kazlauskas [Sun, 8 Mar 2015 22:30:15 +0000 (00:30 +0200)]
Use new io in print and println macroses

9 years agoAuto merge of #23289 - mihneadb:rustdoc-search-by-type, r=alexcrichton
bors [Sat, 14 Mar 2015 22:07:25 +0000 (22:07 +0000)]
Auto merge of #23289 - mihneadb:rustdoc-search-by-type, r=alexcrichton

This adds search by type (for functions/methods) support to Rustdoc. Target issue is at https://github.com/rust-lang/rfcs/issues/658.

I've described my approach here: https://github.com/rust-lang/rfcs/issues/658#issuecomment-76484200. I'll copy the text in here as well:

---

Hi, it took me longer than I wished, but I have implemented this in a not-too-complex way that I think can be extended to support more complex features (like the ones mentioned [here](https://github.com/rust-lang/rust/issues/12866#issuecomment-66945317)).

The idea is to generate a JSON representation of the types of methods/functions in the existing index, and then make the JS understand when it should look by type (and not by name).

I tried to come up with a JSON representation that can be extended to support generics, bounds, ref/mut annotations and so on. Here are a few samples:

Function:

```rust
fn to_uppercase(c: char) -> char
```

```json
{
    "inputs": [
        {"name": "char"}
    ],
    "output": {
        "name": "char",
    }
}
```

Method (implemented or defined in trait):

```rust
// in struct Vec
// self is considered an argument as well
fn capacity(&self) -> usize
```

```json
{
    "inputs": [
        {"name": "vec"}
    ],
    "output": {
        "name": "usize"
    }
}
```

This simple format can be extended by adding more fields, like `generic: bool`, a `bounds` mapping and so on.

I have a working implementation in https://github.com/rust-lang/rust/compare/master...mihneadb:rustdoc-search-by-type. You can check out a live demo [here](http://data.mihneadb.net/doc/std/index.html?search=charext%20-%3E%20char).

![screenshot from 2015-02-28 00 54 00](https://cloud.githubusercontent.com/assets/643127/6422722/7e5374ee-bee4-11e4-99a6-9aac3c9d5068.png)

The feature list is not that long:
- search by types (you *can* use generics as well, as long as you use the exact name - e.g. [`vec,t -> `](http://data.mihneadb.net/doc/std/index.html?search=vec%2C%20t%20-%3E))
- order of arguments does not matter
- `self` is took into account as well (e.g. search for `vec -> usize`)
- does not use "complex" annotations (e.g. you don't search for `&char -> char` but for `char -> char`)

My goal is to get a working, minimal "base" merged so that others can build upon it. How should I proceed? Do I open a PR (badly in need of code review since this is my first non "hello world"-ish rust code)?

---

9 years agoConcurrency is now in the "Concurrency" chapter
Eduardo Bautista [Sat, 14 Mar 2015 20:05:59 +0000 (14:05 -0600)]
Concurrency is now in the "Concurrency" chapter

9 years agoFix indentation in the "Method Syntax" chapter
Eduardo Bautista [Sat, 14 Mar 2015 19:27:44 +0000 (13:27 -0600)]
Fix indentation in the "Method Syntax" chapter

9 years agoAdd support to search functions by type to rustdoc.
Mihnea Dobrescu-Balaur [Wed, 25 Feb 2015 23:03:06 +0000 (01:03 +0200)]
Add support to search functions by type to rustdoc.

9 years agoAuto merge of #23357 - Manishearth:oops, r=Manishearth
bors [Sat, 14 Mar 2015 16:59:06 +0000 (16:59 +0000)]
Auto merge of #23357 - Manishearth:oops, r=Manishearth

Oops, merged #21468 by accident.

9 years agocheck_match: Dereference `ref x` before comparing it and some other type
Barosl Lee [Wed, 11 Mar 2015 16:36:52 +0000 (01:36 +0900)]
check_match: Dereference `ref x` before comparing it and some other type

The arity of `ref x` is always 1, so it needs to be dereferenced before
being compared with some other type whose arity is not 1.

Fixes #23009.

9 years agoFix broken codegen for [expr; n] where "expr" diverges
Björn Steinbrink [Sat, 14 Mar 2015 13:21:43 +0000 (14:21 +0100)]
Fix broken codegen for [expr; n] where "expr" diverges

9 years agoAlways evaluate the expression in [expr; n]
Björn Steinbrink [Sat, 14 Mar 2015 13:19:29 +0000 (14:19 +0100)]
Always evaluate the expression in [expr; n]

In case that there is a destination for the array, like in
"let x = [expr; n]", we currently don't evaluate the given expression if
n is zero. That's inconsistent with all other cases, including "[expr;
0]" without a destination.

Fixes #23354

9 years agoFix a typo in the documentation.
Ricardo Martins [Sat, 14 Mar 2015 12:42:12 +0000 (12:42 +0000)]
Fix a typo in the documentation.

9 years agoDrop support for LLVM < 3.5 and fix compile errors with 3.5
Björn Steinbrink [Sat, 14 Mar 2015 12:14:04 +0000 (13:14 +0100)]
Drop support for LLVM < 3.5 and fix compile errors with 3.5

LLVM older that 3.6 has a bug that cause assertions when compiling certain
constructs. For 3.5 there's still a chance that the bug might get fixed
in 3.5.2, so let's keep allowing to compile with it for it for now.

9 years agoSplit rustdoc summary lines in a smarter way
Simonas Kazlauskas [Fri, 13 Mar 2015 22:45:39 +0000 (00:45 +0200)]
Split rustdoc summary lines in a smarter way

Previously it would fail on a trivial case like

    /// Summary line
    /// <trailing space>
    /// Regular content

Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line
extractor would interpret both lines as the same paragraph and include both into the short summary.

9 years agoAuto merge of #23333 - oli-obk:slice_from_raw_parts, r=alexcrichton
bors [Sat, 14 Mar 2015 08:55:31 +0000 (08:55 +0000)]
Auto merge of #23333 - oli-obk:slice_from_raw_parts, r=alexcrichton

at least that's what the docs say: http://doc.rust-lang.org/std/slice/fn.from_raw_parts.html

A few situations got prettier. In some situations the mutability of the resulting and source pointers differed (and was cast away by transmute), the mutability matches now.

9 years agoReject `-L ""`, `-L native=`, and other empty search paths.
Ryan Prichard [Sat, 14 Mar 2015 06:49:44 +0000 (23:49 -0700)]
Reject `-L ""`, `-L native=`, and other empty search paths.

It wasn't clear to me that early_error was correct here, but it seems to
work. This code is reachable from `rustdoc`, which is problematic, because
early_error panics. rustc handles the panics gracefully (without ICEing or
crashing), but rustdoc does not. It's not the first such rustdoc problem,
though:

    $ rustdoc hello.rs --extern std=bad-std
    error: extern location for std does not exist: bad-std
    hello.rs:1:1: 1:1 error: can't find crate for `std`
    hello.rs:1
           ^
    error: aborting due to 2 previous errors
    thread '<unnamed>' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:151
    thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "rustc failed"', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:744
    thread '<main>' panicked at 'child thread None panicked', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/thread.rs:661

9 years agoRevert "Extend dead code lint to detect more unused enum variants"
Manish Goregaokar [Sat, 14 Mar 2015 06:44:32 +0000 (12:14 +0530)]
Revert "Extend dead code lint to detect more unused enum variants"

This reverts commit b042ffc4a768c2bd6d7588b1b2f47af22669c2cb.

Conflicts:
src/librustc/middle/pat_util.rs