]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoSome more default implementations for the compiler driver callbacks.
Nick Cameron [Tue, 14 Jul 2015 23:38:24 +0000 (11:38 +1200)]
Some more default implementations for the compiler driver callbacks.

9 years agoAuto merge of #26895 - jroesch:modernize-typeck-names, r=nikomatsakis
bors [Sun, 12 Jul 2015 19:22:11 +0000 (19:22 +0000)]
Auto merge of #26895 - jroesch:modernize-typeck-names, r=nikomatsakis

This PR modernizes some names in the type checker. The only remaining snake_case name in ty.rs is `ctxt` which should be resolved by @eddyb's pending refactor. We can bike shed over the names, it would just be nice to bring the type checker inline with modern Rust.

r? @eddyb

cc @nikomatsakis

9 years agoAuto merge of #26966 - nagisa:tail-init, r=alexcrichton
bors [Sun, 12 Jul 2015 13:16:24 +0000 (13:16 +0000)]
Auto merge of #26966 - nagisa:tail-init, r=alexcrichton

Fixes #26906

9 years agoAuto merge of #26965 - bluss:cstring-debug, r=alexcrichton
bors [Sun, 12 Jul 2015 11:45:23 +0000 (11:45 +0000)]
Auto merge of #26965 - bluss:cstring-debug, r=alexcrichton

Use escaped byte string representation for CString Debug

Faithfully represent the contents of the CString and CStr in their Debug
impl, by treating them as byte strings with our default escaping to
ascii representation.

Add impl Debug for CStr.

Fixes #26964.

9 years agoAuto merge of #26985 - Manishearth:rollup, r=Manishearth
bors [Sun, 12 Jul 2015 09:50:13 +0000 (09:50 +0000)]
Auto merge of #26985 - Manishearth:rollup, r=Manishearth

- Successful merges: #26881, #26967, #26973, #26974, #26976, #26979
- Failed merges:

9 years agoRollup merge of #26979 - tshepang:trim, r=Gankro
Manish Goregaokar [Sun, 12 Jul 2015 13:05:55 +0000 (18:35 +0530)]
Rollup merge of #26979 - tshepang:trim, r=Gankro

- It is clear that what follows are re-exports
- There aren't so many re-exports that examples should be given

9 years agoRollup merge of #26976 - tshepang:more-simple-explanation, r=gankro
Manish Goregaokar [Sun, 12 Jul 2015 13:05:55 +0000 (18:35 +0530)]
Rollup merge of #26976 - tshepang:more-simple-explanation, r=gankro

That sentence make me read it a few times before properly understanding it

9 years agoRollup merge of #26974 - tshepang:trailing-comma, r=Gankro
Manish Goregaokar [Sun, 12 Jul 2015 13:05:55 +0000 (18:35 +0530)]
Rollup merge of #26974 - tshepang:trailing-comma, r=Gankro

9 years agoRollup merge of #26973 - tshepang:repetition, r=Gankro
Manish Goregaokar [Sun, 12 Jul 2015 13:05:54 +0000 (18:35 +0530)]
Rollup merge of #26973 - tshepang:repetition, r=Gankro

9 years agoRollup merge of #26967 - tsurai:master, r=steveklabnik
Manish Goregaokar [Sun, 12 Jul 2015 13:05:54 +0000 (18:35 +0530)]
Rollup merge of #26967 - tsurai:master, r=steveklabnik

The very first code fragment off every struct and trait documentation page generates wrong playground code. This pull request adjusts ```playpen.js``` to only create a link for real examples.

Documentation:
```rust
pub struct String {
    // some fields omitted
}
```

Playground:
```rust
Struct std::String

                [−]

        [src]
```

r? @steveklabnik

9 years agoRollup merge of #26881 - andreastt:international_keyboard, r=alexcrichton
Manish Goregaokar [Sun, 12 Jul 2015 13:05:54 +0000 (18:35 +0530)]
Rollup merge of #26881 - andreastt:international_keyboard, r=alexcrichton

Avoids some code duplication and relies less on deprecated properties on `KeyboardEvent`.  The code is still looking quite bad, but that’s primarily because interop in this area is a disaster zone.

9 years agoAuto merge of #26931 - reem:string-conversions, r=alexcrichton
bors [Sun, 12 Jul 2015 07:32:54 +0000 (07:32 +0000)]
Auto merge of #26931 - reem:string-conversions, r=alexcrichton

Implements merged RFC 1152.

Closes #26697.

9 years agoAuto merge of #26972 - jethrogb:patch-1, r=alexcrichton
bors [Sun, 12 Jul 2015 06:02:17 +0000 (06:02 +0000)]
Auto merge of #26972 - jethrogb:patch-1, r=alexcrichton

The File object needs to be writable for the set_len to succeed.

9 years agoAdd String::into_boxed_slice and Box<str>::into_string
Jonathan Reem [Fri, 10 Jul 2015 07:04:06 +0000 (00:04 -0700)]
Add String::into_boxed_slice and Box<str>::into_string

Implements merged RFC 1152.

Closes #26697.

9 years agoAuto merge of #26959 - dhuseby:i686-unknown-freebsd, r=alexcrichton
bors [Sun, 12 Jul 2015 02:37:31 +0000 (02:37 +0000)]
Auto merge of #26959 - dhuseby:i686-unknown-freebsd, r=alexcrichton

this adds support for i686-unknown-freebsd target.

9 years agoAuto merge of #26913 - sfackler:tuple-debug, r=alexcrichton
bors [Sat, 11 Jul 2015 23:41:07 +0000 (23:41 +0000)]
Auto merge of #26913 - sfackler:tuple-debug, r=alexcrichton

This does change the Debug output for 1-tuples to `(foo)` instead of `(foo,)` but I don't think it's that big  of a deal.

r? @alexcrichton

9 years agodoc: remove redundant info
Tshepang Lekhonkhobe [Sat, 11 Jul 2015 22:51:07 +0000 (00:51 +0200)]
doc: remove redundant info

- It is clear that what follows are re-exports
- There aren't so many re-exports that examples should be given

9 years agoAuto merge of #26882 - andreastt:style_improvements, r=alexcrichton
bors [Sat, 11 Jul 2015 21:48:44 +0000 (21:48 +0000)]
Auto merge of #26882 - andreastt:style_improvements, r=alexcrichton

Sharpens the help dialogues edges by removing border-padding, which
matches better with the rest of the document.

Also increases somewhat the rounded edges of the key symbols to
make it clear they are symbols.

Also introduces closing apostrophes and ellipsis for search field
placeholder.

9 years agoImplement RFC 1058
Simonas Kazlauskas [Sat, 11 Jul 2015 11:34:57 +0000 (14:34 +0300)]
Implement RFC 1058

9 years agoChange std::fs::File.set_len example and documentation
jethrogb [Sat, 11 Jul 2015 18:05:47 +0000 (11:05 -0700)]
Change std::fs::File.set_len example and documentation

The File object needs to be writable for the truncate to succeed.

9 years agodoc: make explanation easier to undrstand
Tshepang Lekhonkhobe [Sat, 11 Jul 2015 21:01:30 +0000 (23:01 +0200)]
doc: make explanation easier to undrstand

9 years agoUse escaped byte string representation for CString Debug
Ulrik Sverdrup [Sat, 11 Jul 2015 20:55:52 +0000 (22:55 +0200)]
Use escaped byte string representation for CString Debug

Faithfully represent the contents of the CString and CStr in their Debug
impl, by treating them as byte strings with our default escaping to
ascii representation.

Add impl Debug for Cstr.

Fixes #26964.

9 years agoAuto merge of #26878 - Esption:master, r=pnkfelix
bors [Sat, 11 Jul 2015 19:18:02 +0000 (19:18 +0000)]
Auto merge of #26878 - Esption:master, r=pnkfelix

I noticed in docs, specifically http://doc.rust-lang.org/std/primitive.u8.html#method.is_power_of_two, that it was like this, and it was apparently in multiple places too.

Didn't change any occurrences through the cross-depo things. There's a lot in /src/llvm/ for instance, but I'm not confident on how to go about sending fixes for those, so this is just what's in the base rust depo.

r? @steveklabnik

9 years agoremove repetition from E0308 explanation
Tshepang Lekhonkhobe [Sat, 11 Jul 2015 18:21:10 +0000 (20:21 +0200)]
remove repetition from E0308 explanation

9 years agofixing trailing whitespace
Dave Huseby [Sat, 11 Jul 2015 14:18:12 +0000 (07:18 -0700)]
fixing trailing whitespace

9 years agodoc: remove playground links for structs and traits
Cristian Kubis [Sat, 11 Jul 2015 11:48:10 +0000 (13:48 +0200)]
doc: remove playground links for structs and traits

9 years agoAuto merge of #26961 - Manishearth:rollup, r=Manishearth
bors [Sat, 11 Jul 2015 07:40:27 +0000 (07:40 +0000)]
Auto merge of #26961 - Manishearth:rollup, r=Manishearth

- Successful merges: #26932, #26936, #26943, #26944
- Failed merges:

9 years agoRollup merge of #26944 - rick68:patch-11, r=brson
Manish Goregaokar [Sat, 11 Jul 2015 13:10:13 +0000 (18:40 +0530)]
Rollup merge of #26944 - rick68:patch-11, r=brson

fix typos

9 years agoRollup merge of #26943 - brson:installer, r=alexcrichton
Manish Goregaokar [Sat, 11 Jul 2015 13:10:13 +0000 (18:40 +0530)]
Rollup merge of #26943 - brson:installer, r=alexcrichton

9 years agoRollup merge of #26936 - bluss:doc-array, r=steveklabnik
Manish Goregaokar [Sat, 11 Jul 2015 13:10:13 +0000 (18:40 +0530)]
Rollup merge of #26936 - bluss:doc-array, r=steveklabnik

Small tweaks for the documentation of the primitive type array

Follow up to PR #26923, fix a few small details.

9 years agoRollup merge of #26932 - tsurai:master, r=steveklabnik
Manish Goregaokar [Sat, 11 Jul 2015 13:10:13 +0000 (18:40 +0530)]
Rollup merge of #26932 - tsurai:master, r=steveklabnik

Simple adjustment to auto select the nightly channel for examples using unstable feature.

9 years agoadding support for i686-unknown-freebsd target
Dave Huseby [Fri, 10 Jul 2015 23:48:59 +0000 (16:48 -0700)]
adding support for i686-unknown-freebsd target

9 years agoAuto merge of #26903 - steveklabnik:io_function_docs, r=alexcricthon
bors [Sat, 11 Jul 2015 04:44:55 +0000 (04:44 +0000)]
Auto merge of #26903 - steveklabnik:io_function_docs, r=alexcricthon

This round: io::Result and the free functions.

9 years agoAuto merge of #26945 - steveklabnik:doc_io_bufreader, r=alexcrichton
bors [Sat, 11 Jul 2015 03:10:11 +0000 (03:10 +0000)]
Auto merge of #26945 - steveklabnik:doc_io_bufreader, r=alexcrichton

Mostly just adding basic examples, what's there seems mostly good.

r? @alexcrichton

9 years agoFix make tidy
Jared Roesch [Sat, 11 Jul 2015 02:16:35 +0000 (19:16 -0700)]
Fix make tidy

9 years agoAuto merge of #26929 - alexcrichton:windows-dir-junction, r=brson
bors [Sat, 11 Jul 2015 01:35:30 +0000 (01:35 +0000)]
Auto merge of #26929 - alexcrichton:windows-dir-junction, r=brson

Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes #26716

9 years agoRename TypeWithMutability to TypeAndMut
Jared Roesch [Sat, 11 Jul 2015 01:27:06 +0000 (18:27 -0700)]
Rename TypeWithMutability to TypeAndMut

9 years agoAuto merge of #26941 - fhartwig:osx-file-debug, r=alexcrichton
bors [Sat, 11 Jul 2015 00:01:51 +0000 (00:01 +0000)]
Auto merge of #26941 - fhartwig:osx-file-debug, r=alexcrichton

This makes `Debug` for `File` show the file path and access mode of the file on OS X, just like on Linux.
I'd be happy about any feedback how to make this code better. In particular, I'm not sure how to handle the buffer passed to `fnctl`. This way works, but it feels a bit cumbersome. `fcntl` unfortunately doesn't return the length of the path.

9 years agoRemove `pub use` of TypeError in ty.rs
Jared Roesch [Fri, 10 Jul 2015 22:40:04 +0000 (15:40 -0700)]
Remove `pub use` of TypeError in ty.rs

9 years agoMore docs for std::io::BufReader
Steve Klabnik [Fri, 10 Jul 2015 20:47:48 +0000 (16:47 -0400)]
More docs for std::io::BufReader

9 years agoAuto merge of #26926 - alexcrichton:llvm-archive-writer, r=brson
bors [Fri, 10 Jul 2015 20:18:30 +0000 (20:18 +0000)]
Auto merge of #26926 - alexcrichton:llvm-archive-writer, r=brson

We have previously always relied upon an external tool, `ar`, to modify archives
that the compiler produces (staticlibs, rlibs, etc). This approach, however, has
a number of downsides:

* Spawning a process is relatively expensive for small compilations
* Encoding arguments across process boundaries often incurs unnecessary overhead
  or lossiness. For example `ar` has a tough time dealing with files that have
  the same name in archives, and the compiler copies many files around to ensure
  they can be passed to `ar` in a reasonable fashion.
* Most `ar` programs found do **not** have the ability to target arbitrary
  platforms, so this is an extra tool which needs to be found/specified when
  cross compiling.

The LLVM project has had a tool called `llvm-ar` for quite some time now, but it
wasn't available in the standard LLVM libraries (it was just a standalone
program). Recently, however, in LLVM 3.7, this functionality has been moved to a
library and is now accessible by consumers of LLVM via the `writeArchive`
function.

This commit migrates our archive bindings to no longer invoke `ar` by default
but instead make a library call to LLVM to do various operations. This solves
all of the downsides listed above:

* Archive management is now much faster, for example creating a "hello world"
  staticlib is now 6x faster (50ms => 8ms). Linking dynamic libraries also
  recently started requiring modification of rlibs, and linking a hello world
  dynamic library is now 2x faster.
* The compiler is now one step closer to "hassle free" cross compilation because
  no external tool is needed for managing archives, LLVM does the right thing!

This commit does not remove support for calling a system `ar` utility currently.
We will continue to maintain compatibility with LLVM 3.5 and 3.6 looking forward
(so the system LLVM can be used wherever possible), and in these cases we must
shell out to a system utility. All nightly builds of Rust, however, will stop
needing a system `ar`.

9 years agoUpdate boxed.rs
Wei-Ming Yang [Fri, 10 Jul 2015 19:50:32 +0000 (03:50 +0800)]
Update boxed.rs

fix typos

9 years agoAdd trailing , for 1-tuples
Steven Fackler [Fri, 10 Jul 2015 19:03:52 +0000 (11:03 -0800)]
Add trailing , for 1-tuples

9 years agoUpgrade rust-installer. Fixes install on Fedora-based Linuxes.
Brian Anderson [Fri, 10 Jul 2015 17:41:55 +0000 (10:41 -0700)]
Upgrade rust-installer. Fixes install on Fedora-based Linuxes.

9 years agoAuto merge of #26896 - tbu-:pr_getcwd, r=alexcrichton
bors [Fri, 10 Jul 2015 16:26:19 +0000 (16:26 +0000)]
Auto merge of #26896 - tbu-:pr_getcwd, r=alexcrichton

(On Windows, it works already.)

9 years agotrans: Use LLVM's writeArchive to modify archives
Alex Crichton [Thu, 9 Jul 2015 07:14:20 +0000 (00:14 -0700)]
trans: Use LLVM's writeArchive to modify archives

We have previously always relied upon an external tool, `ar`, to modify archives
that the compiler produces (staticlibs, rlibs, etc). This approach, however, has
a number of downsides:

* Spawning a process is relatively expensive for small compilations
* Encoding arguments across process boundaries often incurs unnecessary overhead
  or lossiness. For example `ar` has a tough time dealing with files that have
  the same name in archives, and the compiler copies many files around to ensure
  they can be passed to `ar` in a reasonable fashion.
* Most `ar` programs found do **not** have the ability to target arbitrary
  platforms, so this is an extra tool which needs to be found/specified when
  cross compiling.

The LLVM project has had a tool called `llvm-ar` for quite some time now, but it
wasn't available in the standard LLVM libraries (it was just a standalone
program). Recently, however, in LLVM 3.7, this functionality has been moved to a
library and is now accessible by consumers of LLVM via the `writeArchive`
function.

This commit migrates our archive bindings to no longer invoke `ar` by default
but instead make a library call to LLVM to do various operations. This solves
all of the downsides listed above:

* Archive management is now much faster, for example creating a "hello world"
  staticlib is now 6x faster (50ms => 8ms). Linking dynamic libraries also
  recently started requiring modification of rlibs, and linking a hello world
  dynamic library is now 2x faster.
* The compiler is now one step closer to "hassle free" cross compilation because
  no external tool is needed for managing archives, LLVM does the right thing!

This commit does not remove support for calling a system `ar` utility currently.
We will continue to maintain compatibility with LLVM 3.5 and 3.6 looking forward
(so the system LLVM can be used wherever possible), and in these cases we must
shell out to a system utility. All nightly builds of Rust, however, will stop
needing a system `ar`.

9 years agostd: Consider directory junctions as directories
Alex Crichton [Thu, 9 Jul 2015 17:45:40 +0000 (10:45 -0700)]
std: Consider directory junctions as directories

Previously on Windows a directory junction would return false from `is_dir`,
causing various odd behavior, specifically calls to `create_dir_all` might fail
when they would otherwise continue to succeed.

Closes #26716

9 years agoAuto merge of #26928 - reem:cstr-is-a-cow, r=Gankro
bors [Fri, 10 Jul 2015 14:52:48 +0000 (14:52 +0000)]
Auto merge of #26928 - reem:cstr-is-a-cow, r=Gankro

This allows CString and CStr to be used with the Cow type,
which is extremely useful when interfacing with C libraries
that make extensive use of C-style strings.

9 years agoAdd more std::io documentation.
Steve Klabnik [Wed, 8 Jul 2015 22:31:08 +0000 (18:31 -0400)]
Add more std::io documentation.

This round: io::Result and the free functions.

9 years agoShow file name and access mode in Debug instance for File on OS X
Florian Hartwig [Fri, 10 Jul 2015 14:23:14 +0000 (16:23 +0200)]
Show file name and access mode in Debug instance for File on OS X

9 years agoSmall tweaks for the documentation of the primitive type array
Ulrik Sverdrup [Fri, 10 Jul 2015 12:50:35 +0000 (14:50 +0200)]
Small tweaks for the documentation of the primitive type array

9 years agoAuto merge of #26919 - alexcrichton:msvc-turn-off-unwinding, r=brson
bors [Fri, 10 Jul 2015 12:40:25 +0000 (12:40 +0000)]
Auto merge of #26919 - alexcrichton:msvc-turn-off-unwinding, r=brson

There are a number of problems with MSVC landing pads today:

* They only work about 80% of the time with optimizations enabled. For example when running the run-pass test suite a failing test will cause `compiletest` to segfault (b/c of a thread panic). There are also a large number of run-fail tests which will simply crash.
* Enabling landing pads caused the regression seen in #26915.

Overall it looks like LLVM's support for MSVC landing pads isn't as robust as we'd like for now, so let's take a little more time before we turn them on by default.

Closes #26915

9 years agoAuto merge of #26751 - retep998:copy-that-floppy, r=alexcrichton
bors [Fri, 10 Jul 2015 11:07:25 +0000 (11:07 +0000)]
Auto merge of #26751 - retep998:copy-that-floppy, r=alexcrichton

Using the OS mechanism for copying files allows the OS to optimize the transfer using stuff such as [Offloaded Data Transfers (ODX)](https://msdn.microsoft.com/en-us/library/windows/desktop/hh848056%28v=vs.85%29.aspx).
Also preserves a lot more information, including NTFS [File Streams](https://msdn.microsoft.com/en-us/library/windows/desktop/aa364404%28v=vs.85%29.aspx), which the manual implementation threw away.
In addition, it is an atomic operation, unlike the manual implementation which has extra calls for copying over permissions.

r? @alexcrichton

9 years agoRemove the generic `fill_bytes_buf` function
Tobias Bucher [Fri, 10 Jul 2015 10:33:10 +0000 (12:33 +0200)]
Remove the generic `fill_bytes_buf` function

9 years agoAuto merge of #26613 - brson:relnotes, r=alexcrichton
bors [Fri, 10 Jul 2015 09:16:38 +0000 (09:16 +0000)]
Auto merge of #26613 - brson:relnotes, r=alexcrichton

Haven't finished these, but since [others](https://github.com/rust-lang/rust/pull/26579) are also working on this and I'm on vacation I figured I should get this in.

9 years agoUse CopyFileEx for fs::copy on Windows
Peter Atashian [Fri, 10 Jul 2015 08:54:00 +0000 (04:54 -0400)]
Use CopyFileEx for fs::copy on Windows
Adds a couple more tests for fs::copy

Signed-off-by: Peter Atashian <retep998@gmail.com>
9 years agodoc: set playground to nightly for unstable code
Cristian Kubis [Fri, 10 Jul 2015 07:40:44 +0000 (09:40 +0200)]
doc: set playground to nightly for unstable code

9 years agoAuto merge of #26907 - nrc:save-fns, r=brson
bors [Fri, 10 Jul 2015 00:47:35 +0000 (00:47 +0000)]
Auto merge of #26907 - nrc:save-fns, r=brson

r? @huonw

9 years agoTest that CStr and CString have equivalent hashes.
Jonathan Reem [Fri, 10 Jul 2015 00:33:00 +0000 (17:33 -0700)]
Test that CStr and CString have equivalent hashes.

9 years agoImplement Borrow<CStr> for CString and ToOwned for CStr
Jonathan Reem [Thu, 9 Jul 2015 23:38:55 +0000 (16:38 -0700)]
Implement Borrow<CStr> for CString and ToOwned for CStr

This allows CString and CStr to be used with the Cow type,
which is extremely useful when interfacing with C libraries
that make extensive use of C-style strings.

9 years agoUpdate RELEASES.md for 1.2
Brian Anderson [Thu, 9 Jul 2015 21:34:30 +0000 (14:34 -0700)]
Update RELEASES.md for 1.2

9 years agoUpdate AUTHORS.txt for 1.2
Brian Anderson [Thu, 9 Jul 2015 21:44:44 +0000 (14:44 -0700)]
Update AUTHORS.txt for 1.2

9 years agoAuto merge of #26923 - bluss:doc-array, r=alexcrichton
bors [Thu, 9 Jul 2015 21:52:43 +0000 (21:52 +0000)]
Auto merge of #26923 - bluss:doc-array, r=alexcrichton

Expand documentation for the primitive type array

9 years agoExpand documentation for the primitive type array
Ulrik Sverdrup [Thu, 9 Jul 2015 20:43:12 +0000 (22:43 +0200)]
Expand documentation for the primitive type array

9 years agoRevert "msvc: Enable landing pads by default"
Alex Crichton [Thu, 9 Jul 2015 16:50:08 +0000 (09:50 -0700)]
Revert "msvc: Enable landing pads by default"

This reverts commit f9de964ccf767498ed7b1b4a879aaca1777a9d3d.

Conflicts:
src/librustc_trans/trans/base.rs

9 years agoAuto merge of #26766 - jespino:add-more-filetypes, r=alexcrichton
bors [Thu, 9 Jul 2015 16:38:00 +0000 (16:38 +0000)]
Auto merge of #26766 - jespino:add-more-filetypes, r=alexcrichton

I find that isn't supported on the current API and I think is necesary.

It is my first PR to rust (I'm not a rust expert and I'm not sure if this is the better way to propose this thinks), of course any suggestion of change will be welcome.

I'm almost sure that in windows aren't supported this filetypes, then, i put in the api of win::fs the functions with a fixed false in the response, I hope this is correct.

9 years agoAuto merge of #26814 - tshepang:array-examples, r=bluss
bors [Thu, 9 Jul 2015 14:50:32 +0000 (14:50 +0000)]
Auto merge of #26814 - tshepang:array-examples, r=bluss

9 years agoAddress some comments on the pull request
Tobias Bucher [Thu, 9 Jul 2015 13:03:10 +0000 (15:03 +0200)]
Address some comments on the pull request

9 years agoAuto merge of #26909 - rick68:patch-10, r=dotdash
bors [Thu, 9 Jul 2015 12:57:17 +0000 (12:57 +0000)]
Auto merge of #26909 - rick68:patch-10, r=dotdash

fix typos

9 years agoAuto merge of #26904 - bluss:no-repeat, r=alexcrichton
bors [Thu, 9 Jul 2015 10:36:41 +0000 (10:36 +0000)]
Auto merge of #26904 - bluss:no-repeat, r=alexcrichton

In a followup to PR #26849, improve one more location for I/O where
we can use `Vec::resize` to ensure better performance when zeroing
buffers.

Use the `vec![elt; n]` macro everywhere we can in the tree. It replaces
`repeat(elt).take(n).collect()` which is more verbose, requires type
hints, and right now produces worse code. `vec![]` is preferable for vector
initialization.

The `vec![]` replacement touches upon one I/O path too, Stdin::read
for windows, and that should be a small improvement.

r? @alexcrichton

9 years agoUse vec![elt; n] where possible
Ulrik Sverdrup [Wed, 8 Jul 2015 20:52:55 +0000 (22:52 +0200)]
Use vec![elt; n] where possible

The common pattern `iter::repeat(elt).take(n).collect::<Vec<_>>()` is
exactly equivalent to `vec![elt; n]`, do this replacement in the whole
tree.

(Actually, vec![] is smart enough to only call clone n - 1 times, while
the former solution would call clone n times, and this fact is
virtually irrelevant in practice.)

9 years agoAuto merge of #26899 - posix4e:netbsd, r=alexcrichton
bors [Thu, 9 Jul 2015 09:04:04 +0000 (09:04 +0000)]
Auto merge of #26899 - posix4e:netbsd, r=alexcrichton

9 years agoAdd FileTypeUnix trait to add unix special file types
Jesús Espino [Sun, 5 Jul 2015 21:16:25 +0000 (23:16 +0200)]
Add FileTypeUnix trait to add unix special file types

9 years agoAuto merge of #26885 - mvdnes:wrapping_div, r=alexcrichton
bors [Thu, 9 Jul 2015 07:13:14 +0000 (07:13 +0000)]
Auto merge of #26885 - mvdnes:wrapping_div, r=alexcrichton

Resolves #26867

9 years agoChange tuple Debug impls to use builders
Steven Fackler [Thu, 9 Jul 2015 06:38:42 +0000 (23:38 -0700)]
Change tuple Debug impls to use builders

9 years agoAuto merge of #26884 - dotdash:fast, r=alexcrichton
bors [Thu, 9 Jul 2015 05:15:48 +0000 (05:15 +0000)]
Auto merge of #26884 - dotdash:fast, r=alexcrichton

Exploiting the fact that getting the length of the slices is known, we
can use a counted loop instead of iterators, which means that we only
need a single counter, instead of having to increment and check one
pointer for each iterator.

Benchmarks comparing vectors with 100,000 elements:

Before:

```
running 8 tests
test eq1_u8  ... bench:      66,757 ns/iter (+/- 113)
test eq2_u16 ... bench:     111,267 ns/iter (+/- 149)
test eq3_u32 ... bench:     126,282 ns/iter (+/- 111)
test eq4_u64 ... bench:     126,418 ns/iter (+/- 155)
test ne1_u8  ... bench:      88,990 ns/iter (+/- 161)
test ne2_u16 ... bench:      89,126 ns/iter (+/- 265)
test ne3_u32 ... bench:      96,901 ns/iter (+/- 92)
test ne4_u64 ... bench:      96,750 ns/iter (+/- 137)
```

After:

```
running 8 tests
test eq1_u8  ... bench:      46,413 ns/iter (+/- 521)
test eq2_u16 ... bench:      46,500 ns/iter (+/- 74)
test eq3_u32 ... bench:      50,059 ns/iter (+/- 92)
test eq4_u64 ... bench:      54,001 ns/iter (+/- 92)
test ne1_u8  ... bench:      47,595 ns/iter (+/- 53)
test ne2_u16 ... bench:      47,521 ns/iter (+/- 59)
test ne3_u32 ... bench:      44,889 ns/iter (+/- 74)
test ne4_u64 ... bench:      47,775 ns/iter (+/- 68)
```

9 years agoUpdate intrinsics.rs
Wei-Ming Yang [Thu, 9 Jul 2015 04:09:54 +0000 (12:09 +0800)]
Update intrinsics.rs

fix typos

9 years agoAuto merge of #26515 - quantheory:check_enum_recursion, r=nrc
bors [Thu, 9 Jul 2015 03:41:22 +0000 (03:41 +0000)]
Auto merge of #26515 - quantheory:check_enum_recursion, r=nrc

Fixes #23302.

Note that there's an odd situation regarding the following, most likely due to some inadequacy in `const_eval`:

```rust
enum Y {
    A = 1usize,
    B,
}
```

In this case, `Y::B as usize` might be considered a constant expression in some cases, but not others.  (See #23513, for a related problem where there is only one variant, with no discriminant, and it doesn't behave nicely as a constant expression either.)

Most of the complexity in this PR is basically future-proofing, to ensure that when `Y::B as usize` is fully made to be a constant expression, it can't be used to set `Y::A`, and thus indirectly itself.

9 years agoAdd comments about the checks for recursive variant definition, as requested by ...
Sean Patrick Santos [Thu, 9 Jul 2015 02:51:47 +0000 (20:51 -0600)]
Add comments about the checks for recursive variant definition, as requested by @nrc.

9 years ago'iff' for docs to 'if and only if'
Esption [Thu, 9 Jul 2015 02:17:13 +0000 (21:17 -0500)]
'iff' for docs to 'if and only if'

9 years agoAuto merge of #26883 - retep998:download-more-ram, r=alexcrichton
bors [Thu, 9 Jul 2015 01:49:25 +0000 (01:49 +0000)]
Auto merge of #26883 - retep998:download-more-ram, r=alexcrichton

Extension of https://github.com/rust-lang/rust/pull/26691

r? @alexcrichton

9 years agosave-analysis: API-ify methods
Nick Cameron [Thu, 9 Jul 2015 00:23:29 +0000 (12:23 +1200)]
save-analysis: API-ify methods

9 years agosave-analysis: factor out helper method
Nick Cameron [Wed, 8 Jul 2015 08:54:45 +0000 (20:54 +1200)]
save-analysis: factor out helper method

9 years agoFix a span bug for qualified paths
Nick Cameron [Wed, 8 Jul 2015 05:47:27 +0000 (17:47 +1200)]
Fix a span bug for qualified paths

9 years agosave-analysis: API-ify paths
Nick Cameron [Wed, 8 Jul 2015 02:30:18 +0000 (14:30 +1200)]
save-analysis: API-ify paths

9 years agoFix a bug where macros in expression position don't have expansion inidices in their...
Nick Cameron [Wed, 8 Jul 2015 02:29:43 +0000 (14:29 +1200)]
Fix a bug where macros in expression position don't have expansion inidices in their spans

9 years agosave-analysis: api-ify method calls
Nick Cameron [Mon, 6 Jul 2015 23:42:43 +0000 (11:42 +1200)]
save-analysis: api-ify method calls

9 years agoAuto merge of #26879 - GuillaumeGomez:patch-1, r=arielb1
bors [Thu, 9 Jul 2015 00:16:56 +0000 (00:16 +0000)]
Auto merge of #26879 - GuillaumeGomez:patch-1, r=arielb1

Part of #24407.
r? @Manishearth

9 years agoio: Use Vec::resize in Cursor<Vec<u8>> for more efficient zero fill
Ulrik Sverdrup [Wed, 8 Jul 2015 20:52:06 +0000 (22:52 +0200)]
io: Use Vec::resize in Cursor<Vec<u8>> for more efficient zero fill

Vec::resize compiles to better code than .extend(repeat(0).take(n)) does
right now.

9 years agoAuto merge of #26869 - alexcrichton:fix-msvc-sepcomp, r=nrc
bors [Wed, 8 Jul 2015 22:45:19 +0000 (22:45 +0000)]
Auto merge of #26869 - alexcrichton:fix-msvc-sepcomp, r=nrc

This commit alters the implementation of multiple codegen units slightly to be
compatible with the MSVC linker. Currently the implementation will take the N
object files created by each codegen unit and will run `ld -r` to create a new
object file which is then passed along. The MSVC linker, however, is not able to
do this operation.

The compiler will now no longer attempt to assemble object files together but
will instead just pass through all the object files as usual. This implies that
rlibs may not contain more than one object file (if the library is compiled with
more than one codegen unit) and the output of `-C save-temps` will have changed
slightly as object files with the extension `0.o` will not be renamed to `o`
unless requested otherwise.

9 years agotrans: Link rlibs to dylibs with --whole-archive
Alex Crichton [Wed, 8 Jul 2015 04:33:44 +0000 (21:33 -0700)]
trans: Link rlibs to dylibs with --whole-archive

This commit starts passing the `--whole-archive` flag (`-force_load` on OSX) to
the linker when linking rlibs into dylibs. The primary purpose of this commit is
to ensure that the linker doesn't strip out objects from an archive when
creating a dynamic library. Information on how this can go wrong can be found in
issues #14344 and #25185.

The unfortunate part about passing this flag to the linker is that we have to
preprocess the rlib to remove the metadata and compressed bytecode found within.
This means that creating a dylib will now take longer to link as we've got to
copy around the input rlibs to a temporary location, modify them, and then
invoke the linker. This isn't done for executables, however, so the "hello
world" compile time is not affected.

This fix was instigated because of the previous commit where rlibs may not
contain multiple object files instead of one due to codegen units being greater
than one. That change prevented the main distribution from being compiled with
more than one codegen-unit and this commit fixes that.

Closes #14344
Closes #25185

9 years agoUpdate the installer to support netbsd
Alex HotShot Newman [Wed, 8 Jul 2015 21:18:27 +0000 (14:18 -0700)]
Update the installer to support netbsd

9 years agoAuto merge of #26849 - bluss:read-to-end-memset, r=alexcrichton
bors [Wed, 8 Jul 2015 21:12:54 +0000 (21:12 +0000)]
Auto merge of #26849 - bluss:read-to-end-memset, r=alexcrichton

Improve zerofill in Vec::resize and Read::read_to_end

We needed a more efficient way to zerofill the vector in read_to_end.
This to reduce the memory intialization overhead to a minimum.

Use the implementation of `std::vec::from_elem` (used for the vec![]
macro) for Vec::resize as well. For simple element types like u8, this
compiles to memset, so it makes Vec::resize much more efficient.

9 years agoRemove snake_case names from ty.rs
Jared Roesch [Wed, 8 Jul 2015 19:27:32 +0000 (12:27 -0700)]
Remove snake_case names from ty.rs

9 years agoMake `std::env::current_dir` work for path names longer than 2048 bytes on non-Windows
Tobias Bucher [Wed, 8 Jul 2015 19:36:46 +0000 (21:36 +0200)]
Make `std::env::current_dir` work for path names longer than 2048 bytes on non-Windows

9 years agoAuto merge of #26894 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 8 Jul 2015 19:26:30 +0000 (19:26 +0000)]
Auto merge of #26894 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #26687, #26784, #26850, #26889, #26891, #26892, #26893
- Failed merges:

9 years agoio: Simplify BufReader::with_capacity
Ulrik Sverdrup [Wed, 8 Jul 2015 01:20:00 +0000 (03:20 +0200)]
io: Simplify BufReader::with_capacity

Use the vec![] macro directly to create a sized, zeroed vector.

This should result in a big speedup when creating BufReader, because
vec![0; cap] compiles to a memset call, while the previous extend code
currently did not.

9 years agoImprove Vec::resize so that it can be used in Read::read_to_end
Ulrik Sverdrup [Tue, 7 Jul 2015 11:50:23 +0000 (13:50 +0200)]
Improve Vec::resize so that it can be used in Read::read_to_end

We needed a more efficient way to zerofill the vector in read_to_end.
This to reduce the memory intialization overhead to a minimum.

Use the implementation of `std::vec::from_elem` (used for the vec![]
macro) for Vec::resize as well. For simple element types like u8, this
compiles to memset, so it makes Vec::resize much more efficient.

9 years agoAdd E0232 error explanation
Guillaume Gomez [Wed, 8 Jul 2015 12:28:14 +0000 (14:28 +0200)]
Add E0232 error explanation

9 years agoAdd E0220 error explanation
Guillaume Gomez [Wed, 8 Jul 2015 11:04:12 +0000 (13:04 +0200)]
Add E0220 error explanation