]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoMention multiple impl blocks in TRPL
Steve Klabnik [Wed, 4 Nov 2015 09:35:09 +0000 (10:35 +0100)]
Mention multiple impl blocks in TRPL

Fixes #29322

8 years agoAuto merge of #29217 - nikomatsakis:mir-trans, r=dotdash
bors [Wed, 4 Nov 2015 02:13:05 +0000 (02:13 +0000)]
Auto merge of #29217 - nikomatsakis:mir-trans, r=dotdash

This branch implements a variant of trans that is based on MIR. It is very incomplete (intentionally), and had only the goal of laying out enough work to enable more incremental follow-on patches. Currently, only fns tagged with `#[rustc_mir]` use the new trans code. I plan to build up a meta-issue as well that tracks the various "not-yet-implemented" points. The only fn that has been tested so far is this amazingly complex "spike" fn:

```rust
#[rustc_mir]
fn sum(x: i32, y: i32) -> i32 {
    x + y
}
```

In general, the most interesting commit is the last one. There are some points on which I would like feedback from @rust-lang/compiler:

- I did not use `Datum`. Originally, I thought that maybe just a `ValueRef` would be enough but I wound up with two very simple structures, `LvalueRef` and `OperandRef`, that just package up a `ValueRef` and a type. Because of MIR's structure, you don't wind up mixing by-ref and by-value so much, and I tend to think that a thinner abstraction layer is better here, but I'm not sure.
- Related to the above, I expect that sooner or later we will analyze temps (and maybe variables too) to find those whose address is never taken and which are word-sized and which perhaps meet a few other criteria. For those, we'll probably want to avoid the alloca, just because it means prettier code.
- I generally tried to re-use data structures from elsewhere in trans, though I'm sure we can trim these down.
- I didn't do any debuginfo primarily because it seems to want node-ids and we have only spans. I haven't really read into that code so I don't know what's going on there.

r? @nrc

8 years agoremove unused import
Niko Matsakis [Wed, 4 Nov 2015 01:38:02 +0000 (20:38 -0500)]
remove unused import

8 years agoAuto merge of #29547 - arielb1:speculative-upvar, r=eddyb
bors [Wed, 4 Nov 2015 00:30:05 +0000 (00:30 +0000)]
Auto merge of #29547 - arielb1:speculative-upvar, r=eddyb

`resolve_identifier` used to mark a variable as an upvar when used within a closure. However, the function is also used for the "unnecessary qualification" lint, which would mark paths whose last component had the same name as a local as upvars.

Fixes #29522

r? @eddyb

8 years agoaddress nits from dotdash
Niko Matsakis [Tue, 3 Nov 2015 20:50:04 +0000 (15:50 -0500)]
address nits from dotdash

8 years agocorrect typos
Niko Matsakis [Tue, 3 Nov 2015 11:44:45 +0000 (06:44 -0500)]
correct typos

8 years agoAdd (and use) an analysis to determine which temps can forgo an alloca.
Niko Matsakis [Tue, 3 Nov 2015 11:35:09 +0000 (06:35 -0500)]
Add (and use) an analysis to determine which temps can forgo an alloca.

8 years agoAuto merge of #29545 - mystor:vec-deque-test-panic, r=bluss
bors [Tue, 3 Nov 2015 21:12:03 +0000 (21:12 +0000)]
Auto merge of #29545 - mystor:vec-deque-test-panic, r=bluss

I think this should fix the test failures in debug mode from #29492

The assertion was written incorrectly, and I don't like the way the new assertion is written, but I _think_ it does the right thing now.

8 years agoAuto merge of #29532 - Ryman:cow_path, r=alexcrichton
bors [Tue, 3 Nov 2015 19:29:44 +0000 (19:29 +0000)]
Auto merge of #29532 - Ryman:cow_path, r=alexcrichton

8 years agoresolve: don't speculatively create freevars when resolving
Ariel Ben-Yehuda [Tue, 3 Nov 2015 18:44:23 +0000 (20:44 +0200)]
resolve: don't speculatively create freevars when resolving

Fixes #29522

8 years agoCorrect incorrect assertion in VecDeque::wrap_copy
Michael Layzell [Tue, 3 Nov 2015 18:03:36 +0000 (13:03 -0500)]
Correct incorrect assertion in VecDeque::wrap_copy

8 years agolibcollections: DRY up a PartialEq impl for String
Kevin Butler [Tue, 3 Nov 2015 04:54:32 +0000 (04:54 +0000)]
libcollections: DRY up a PartialEq impl for String

8 years agolibstd: implement PartialEq<Path> for PathBuf and Cow<Path>
Kevin Butler [Tue, 3 Nov 2015 04:51:21 +0000 (04:51 +0000)]
libstd: implement PartialEq<Path> for PathBuf and Cow<Path>

8 years agoAuto merge of #29529 - Ryman:rustdoc-cap-lints, r=alexcrichton
bors [Tue, 3 Nov 2015 17:02:13 +0000 (17:02 +0000)]
Auto merge of #29529 - Ryman:rustdoc-cap-lints, r=alexcrichton

This sets the `cap-lints` setting to 'allow' for all doc compilations. There's precedent for this as rustdoc [already whitelists unstable code](https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs#L112) when compiling documentation, with the expectation being that a regular compile will complain about any problems. I think the same justification applies here.

Problem case in the wild: https://github.com/laumann/compiletest-rs/pull/28

r? @Manishearth

8 years agoAuto merge of #29515 - Manishearth:ice-itembody, r=eddyb
bors [Tue, 3 Nov 2015 15:19:07 +0000 (15:19 +0000)]
Auto merge of #29515 - Manishearth:ice-itembody, r=eddyb

r? @eddyb or @nrc

8 years agoFix ICE with unresolved associated items in closures (fixes #28971)
Manish Goregaokar [Sun, 11 Oct 2015 20:44:55 +0000 (02:14 +0530)]
Fix ICE with unresolved associated items in closures (fixes #28971)

8 years agoAuto merge of #29495 - meqif:fix_unindent_tabs, r=steveklabnik
bors [Tue, 3 Nov 2015 13:34:09 +0000 (13:34 +0000)]
Auto merge of #29495 - meqif:fix_unindent_tabs, r=steveklabnik

A line may be indented with either spaces or tabs, but not a mix of both. If there is a mix of tabs and spaces, only the kind that occurs first is counted.

This addresses issue #29268.

8 years agoAuto merge of #29535 - Toby-S:patch-1, r=steveklabnik
bors [Tue, 3 Nov 2015 11:51:34 +0000 (11:51 +0000)]
Auto merge of #29535 - Toby-S:patch-1, r=steveklabnik

This basically just inlines the fatal! macro from BurntSushi's [blog post](http://blog.burntsushi.net/rust-error-handling/#argument-parsing).

cc @steveklabnik

8 years agoFix #29533
Toby Scrace [Tue, 3 Nov 2015 11:46:05 +0000 (11:46 +0000)]
Fix #29533

This replaces usage of the (missing) `fatal!` macro with `panic!`.

8 years agoAdd a MIR visitor
Niko Matsakis [Tue, 3 Nov 2015 11:33:59 +0000 (06:33 -0500)]
Add a MIR visitor

8 years agolibstd: implement From<&Path|PathBuf> for Cow<Path>
Kevin Butler [Tue, 3 Nov 2015 04:26:45 +0000 (04:26 +0000)]
libstd: implement From<&Path|PathBuf> for Cow<Path>

8 years agoAuto merge of #29509 - vadimcn:readme, r=alexcrichton
bors [Tue, 3 Nov 2015 10:01:06 +0000 (10:01 +0000)]
Auto merge of #29509 - vadimcn:readme, r=alexcrichton

The current readme provides critical information about gcc versions too late in the flow.

r? @steveklabnik

8 years agoPlumbing to omit allocas for temps when possible (currently unused)
Niko Matsakis [Mon, 2 Nov 2015 14:39:59 +0000 (09:39 -0500)]
Plumbing to omit allocas for temps when possible (currently unused)

8 years agoNew trans codepath that builds fn body from MIR instead.
Niko Matsakis [Wed, 21 Oct 2015 21:42:25 +0000 (17:42 -0400)]
New trans codepath that builds fn body from MIR instead.

8 years agoMove shifting code out of expr and into somewhere more accessible
Niko Matsakis [Wed, 21 Oct 2015 21:35:15 +0000 (17:35 -0400)]
Move shifting code out of expr and into somewhere more accessible

8 years agoChange adt case handling fn to be less tied to match
Niko Matsakis [Wed, 21 Oct 2015 21:33:08 +0000 (17:33 -0400)]
Change adt case handling fn to be less tied to match

8 years agoAdd helper methods that require tcx; these compute types of
Niko Matsakis [Wed, 21 Oct 2015 21:30:17 +0000 (17:30 -0400)]
Add helper methods that require tcx; these compute types of
lvalues and operands

8 years agoChange Call operands to be, well, Operands
Niko Matsakis [Wed, 21 Oct 2015 21:29:50 +0000 (17:29 -0400)]
Change Call operands to be, well, Operands

8 years agoAdd adt_def into Switch, since it's convenient to have in trans
Niko Matsakis [Wed, 21 Oct 2015 21:28:51 +0000 (17:28 -0400)]
Add adt_def into Switch, since it's convenient to have in trans

8 years agoMove the "HAIR" code that reads the tcx tables etc out of the `tcx`
Niko Matsakis [Wed, 21 Oct 2015 21:24:05 +0000 (17:24 -0400)]
Move the "HAIR" code that reads the tcx tables etc out of the `tcx`
module and into `hair/cx`, now that we don't have a trait defining
the interface

8 years agoPass the mir map to trans
Niko Matsakis [Wed, 21 Oct 2015 21:20:00 +0000 (17:20 -0400)]
Pass the mir map to trans

8 years agoConvert from using named fields to always using indices
Niko Matsakis [Wed, 21 Oct 2015 21:19:02 +0000 (17:19 -0400)]
Convert from using named fields to always using indices

8 years agoChange ShallowDrop to Free, so that it matches what trans will do
Niko Matsakis [Wed, 21 Oct 2015 21:16:11 +0000 (17:16 -0400)]
Change ShallowDrop to Free, so that it matches what trans will do

8 years agoBuild the MIR using the liberated fn sigs, and track the return type
Niko Matsakis [Wed, 21 Oct 2015 21:14:25 +0000 (17:14 -0400)]
Build the MIR using the liberated fn sigs, and track the return type

8 years agoIntroduce a "liberated fn sigs" map so that we have easy access to this
Niko Matsakis [Wed, 21 Oct 2015 19:46:30 +0000 (15:46 -0400)]
Introduce a "liberated fn sigs" map so that we have easy access to this
information when constructing MIR.

8 years agoAuto merge of #29459 - tshepang:simplify, r=steveklabnik
bors [Tue, 3 Nov 2015 08:18:45 +0000 (08:18 +0000)]
Auto merge of #29459 - tshepang:simplify, r=steveklabnik

8 years agoAuto merge of #29523 - durka:patch-9, r=alexcrichton
bors [Tue, 3 Nov 2015 06:34:53 +0000 (06:34 +0000)]
Auto merge of #29523 - durka:patch-9, r=alexcrichton

`Rc::try_unwrap` and `Rc::make_mut` are stable since 1.4.0, but the example code still has `#![feature(rc_unique)]`. Ideally the stable and beta docs would be updated, but I don't think that's possible :(

8 years agoAuto merge of #29514 - apasel422:issue-26220, r=alexcrichton
bors [Tue, 3 Nov 2015 04:52:12 +0000 (04:52 +0000)]
Auto merge of #29514 - apasel422:issue-26220, r=alexcrichton

Closes #26220.

r? @alexcrichton

8 years agoAuto merge of #29285 - eefriedman:libsyntax-panic, r=nrc
bors [Tue, 3 Nov 2015 03:06:03 +0000 (03:06 +0000)]
Auto merge of #29285 - eefriedman:libsyntax-panic, r=nrc

A set of commits which pushes some panics out of core parser methods, and into users of those parser methods.

8 years agoAuto merge of #29500 - vadimcn:rustlib, r=alexcrichton
bors [Tue, 3 Nov 2015 01:23:10 +0000 (01:23 +0000)]
Auto merge of #29500 - vadimcn:rustlib, r=alexcrichton

According to a recent [discussion on IRC](https://botbot.me/mozilla/rust-tools/2015-10-27/?msg=52887517&page=2), there's no good reason for Windows builds to store target libraries under `bin`, when on every other platform they are under `lib`.

This might be a [breaking-change] for some users.  I am pretty sure VisualRust has that path hard-coded somewhere.

r? @brson

8 years agolibrustdoc: ignore lint warnings when compiling documentation
Kevin Butler [Mon, 2 Nov 2015 23:44:53 +0000 (23:44 +0000)]
librustdoc: ignore lint warnings when compiling documentation

8 years agoAuto merge of #29291 - petrochenkov:privacy, r=alexcrichton
bors [Mon, 2 Nov 2015 23:38:49 +0000 (23:38 +0000)]
Auto merge of #29291 - petrochenkov:privacy, r=alexcrichton

The public set is expanded with trait items, impls and their items, foreign items, exported macros, variant fields, i.e. all the missing parts. Now it's a subset of the exported set.
This is needed for https://github.com/rust-lang/rust/pull/29083 because stability annotation pass uses the public set and all things listed above need to be annotated.
Rustdoc can now be migrated to the public set as well, I guess.

Exported set is now slightly more correct with regard to exported items in blocks - 1) blocks in foreign items are considered and 2) publicity is not inherited from the block's parent - if a function is public it doesn't mean structures defined in its body are public.

r? @alexcrichton or maybe someone else

8 years agoParens + issue number + typo
Vadim Petrochenkov [Mon, 2 Nov 2015 22:58:41 +0000 (01:58 +0300)]
Parens + issue number + typo

8 years agoAuto merge of #29456 - alexcrichton:path-hash, r=aturon
bors [Mon, 2 Nov 2015 21:56:47 +0000 (21:56 +0000)]
Auto merge of #29456 - alexcrichton:path-hash, r=aturon

Almost all operations on Path are based on the components iterator in one form
or another to handle equivalent paths. The `Hash` implementations, however,
mistakenly just went straight to the underlying `OsStr`, causing these
equivalent paths to not get merged together.

This commit updates the `Hash` implementation to also be based on the iterator
which should ensure that if two paths are equal they hash to the same thing.

cc #29008, but doesn't close it

8 years agostd: Base Hash for Path on its iterator
Alex Crichton [Thu, 29 Oct 2015 17:56:54 +0000 (10:56 -0700)]
std: Base Hash for Path on its iterator

Almost all operations on Path are based on the components iterator in one form
or another to handle equivalent paths. The `Hash` implementations, however,
mistakenly just went straight to the underlying `OsStr`, causing these
equivalent paths to not get merged together.

This commit updates the `Hash` implementation to also be based on the iterator
which should ensure that if two paths are equal they hash to the same thing.

cc #29008, but doesn't close it

8 years agoremove #![feature(rc_unique)] from Rc docs
Alex Burka [Mon, 2 Nov 2015 20:36:22 +0000 (15:36 -0500)]
remove #![feature(rc_unique)] from Rc docs

`Rc::try_unwrap` and `Rc::make_mut` are stable since 1.4.0, but the example code still has `#![feature(rc_unique)]`. Ideally the stable and beta docs would be updated, but I don't think that's possible...

8 years agoAuto merge of #29513 - apasel422:issue-23217, r=alexcrichton
bors [Mon, 2 Nov 2015 20:11:53 +0000 (20:11 +0000)]
Auto merge of #29513 - apasel422:issue-23217, r=alexcrichton

Closes #23217.

r? @alexcrichton

8 years agoMerged windows and unix `find_libdir()`
Vadim Chugunov [Mon, 2 Nov 2015 19:42:20 +0000 (11:42 -0800)]
Merged windows and unix `find_libdir()`

8 years agoAuto merge of #29510 - mneumann:dragonfly-guard-page, r=alexcrichton
bors [Mon, 2 Nov 2015 18:29:33 +0000 (18:29 +0000)]
Auto merge of #29510 - mneumann:dragonfly-guard-page, r=alexcrichton

Only tested on DragonFly.

8 years agoAuto merge of #29518 - KyleMayes:master, r=apasel422
bors [Mon, 2 Nov 2015 14:41:31 +0000 (14:41 +0000)]
Auto merge of #29518 - KyleMayes:master, r=apasel422

Fixes one of the `expr` examples to be a correct expression

r? @steveklabnik

8 years agoMinor fix to Rust Book, Macros chapter
Kyle Mayes [Mon, 2 Nov 2015 13:52:05 +0000 (08:52 -0500)]
Minor fix to Rust Book, Macros chapter

Fixes one of the `expr` examples to be a proper expression

8 years agoAuto merge of #28846 - Ms2ger:categorization, r=nikomatsakis
bors [Mon, 2 Nov 2015 10:44:08 +0000 (10:44 +0000)]
Auto merge of #28846 - Ms2ger:categorization, r=nikomatsakis

8 years agoAccept tabs as indentation character
Ricardo Martins [Sat, 31 Oct 2015 23:07:10 +0000 (23:07 +0000)]
Accept tabs as indentation character

A line may be indented with both spaces or tabs. All leading whitespace
is trimmed, even if it is mixed.

8 years agoAuto merge of #29505 - rjbs:docs-where-type, r=steveklabnik
bors [Mon, 2 Nov 2015 08:01:56 +0000 (08:01 +0000)]
Auto merge of #29505 - rjbs:docs-where-type, r=steveklabnik

I read this section a few times before even having a guess what
was meant, then consulted IRC for confirmation.  It may be that I
was thick-headed, but I think this is a useful addition.

8 years agoAttempt to clarify use of `where i32: ConvertTo<T>
Ricardo Signes [Sun, 1 Nov 2015 18:28:51 +0000 (13:28 -0500)]
Attempt to clarify use of `where i32: ConvertTo<T>

I read this section a few times before even having a guess what
was meant, then consulted IRC for confirmation.  It may be that I
was thick-headed, but I think this is a useful addition.

8 years agoFormatting
Vadim Chugunov [Mon, 2 Nov 2015 00:24:51 +0000 (16:24 -0800)]
Formatting

8 years agoAuto merge of #29507 - fhartwig:result-expect, r=Manishearth
bors [Sun, 1 Nov 2015 23:22:22 +0000 (23:22 +0000)]
Auto merge of #29507 - fhartwig:result-expect, r=Manishearth

This fixes part of #29506
These instances of `ok().expect()` have no benefit over using `Result`'s `expect` directly.

8 years agoImplement `IntoIterator` for `&{Path, PathBuf}`
Andrew Paseltiner [Sun, 1 Nov 2015 23:04:53 +0000 (18:04 -0500)]
Implement `IntoIterator` for `&{Path, PathBuf}`

Closes #26220.

8 years agoAdd test for #23217
Andrew Paseltiner [Sun, 1 Nov 2015 22:55:09 +0000 (17:55 -0500)]
Add test for #23217

Closes #23217.

8 years agoUse guard-pages also on DragonFly/FreeBSD.
Michael Neumann [Sun, 1 Nov 2015 21:56:31 +0000 (22:56 +0100)]
Use guard-pages also on DragonFly/FreeBSD.

Only tested on DragonFly.

8 years agoAuto merge of #29501 - Manishearth:pat-docs, r=alexcrichton
bors [Sun, 1 Nov 2015 21:42:18 +0000 (21:42 +0000)]
Auto merge of #29501 - Manishearth:pat-docs, r=alexcrichton

None

8 years agoClarify Windows gcc setup instructions.
Vadim Chugunov [Sun, 1 Nov 2015 20:02:19 +0000 (12:02 -0800)]
Clarify Windows gcc setup instructions.

8 years agoAuto merge of #29471 - pierzchalski:custom-target-custom-unwind-json, r=alexcrichton
bors [Sun, 1 Nov 2015 20:00:07 +0000 (20:00 +0000)]
Auto merge of #29471 - pierzchalski:custom-target-custom-unwind-json, r=alexcrichton

8 years agoStop using ok().expect() in Result docs
Florian Hartwig [Sun, 1 Nov 2015 19:41:23 +0000 (20:41 +0100)]
Stop using ok().expect() in Result docs

8 years agoReplace ok().expect() by Result::expect in trait chapter of trpl
Florian Hartwig [Sun, 1 Nov 2015 19:40:20 +0000 (20:40 +0100)]
Replace ok().expect() by Result::expect in trait chapter of trpl

8 years agoAuto merge of #29177 - vadimcn:rtstuff, r=alexcrichton
bors [Sun, 1 Nov 2015 17:15:29 +0000 (17:15 +0000)]
Auto merge of #29177 - vadimcn:rtstuff, r=alexcrichton

Note: for now, this change only affects `-windows-gnu` builds.

So why was this `libgcc` dylib dependency needed in the first place?
The stack unwinder needs to know about locations of unwind tables of all the modules loaded in the current process.  The easiest portable way of achieving this is to have each module register itself with the unwinder when loaded into the process.  All modules compiled by GCC do this by calling the __register_frame_info() in their startup code (that's `crtbegin.o` and `crtend.o`, which are automatically linked into any gcc output).
Another important piece is that there should be only one copy of the unwinder (and thus unwind tables registry) in the process.  This pretty much means that the unwinder must be in a shared library (unless everything is statically linked).

Now, Rust compiler tries very hard to make sure that any given Rust crate appears in the final output just once.   So if we link the unwinder statically to one of Rust's crates, everything should be fine.

Unfortunately, GCC startup objects are built under assumption that `libgcc` is the one true place for the unwind info registry, so I couldn't find any better way than to replace them.  So out go `crtbegin`/`crtend`, in come `rsbegin`/`rsend`!

A side benefit of this change is that rustc is now more in control of the command line that goes to the linker, so we could stop using `gcc` as the linker driver and just invoke `ld` directly.

8 years agoAuto merge of #29486 - petrochenkov:multiwild, r=Manishearth
bors [Sun, 1 Nov 2015 13:36:49 +0000 (13:36 +0000)]
Auto merge of #29486 - petrochenkov:multiwild, r=Manishearth

Motivation:
- It is not actually a pattern
- It is not actually needed, except for...

Drawback:
- Slice patterns like `[a, _.., b]` are pretty-printed as `[a, .., b]`. Great loss :(

plugin-[breaking-change], as always

8 years agoAdd comment for stability.rs
Vadim Petrochenkov [Sun, 1 Nov 2015 13:33:46 +0000 (16:33 +0300)]
Add comment for stability.rs

8 years agoAdd code formatting on PatVec docs
Manish Goregaokar [Sun, 1 Nov 2015 11:07:12 +0000 (16:37 +0530)]
Add code formatting on PatVec docs

8 years agoFix PatEnum docs
Manish Goregaokar [Sun, 1 Nov 2015 11:02:51 +0000 (16:32 +0530)]
Fix PatEnum docs

8 years agoAuto merge of #29316 - GBGamer:change-unchecked-div-generic, r=eddyb
bors [Sun, 1 Nov 2015 07:03:09 +0000 (07:03 +0000)]
Auto merge of #29316 - GBGamer:change-unchecked-div-generic, r=eddyb

Similarly to the simd intrinsics. I believe this is a better solution than #29288, and I could implement it as well for overflowing_add/sub/mul. Also rename from udiv/sdiv to div, and same for rem.

8 years agoWindows: Move target libraries to $rustroot/lib/rustlib/... - for symmetry with all...
Vadim Chugunov [Sun, 1 Nov 2015 06:26:12 +0000 (23:26 -0700)]
Windows: Move target libraries to $rustroot/lib/rustlib/... - for symmetry with all other platforms.

8 years agoAuto merge of #29496 - cpjreynolds:patch-1, r=apasel422
bors [Sun, 1 Nov 2015 04:23:18 +0000 (04:23 +0000)]
Auto merge of #29496 - cpjreynolds:patch-1, r=apasel422

Corrects `write_bytes`'s documentation as the parameter name is `val` not `c`.

8 years agoFix stage0 ICE caused by the old _Unwind_Resume override trickery.
Vadim Chugunov [Sun, 1 Nov 2015 01:47:38 +0000 (18:47 -0700)]
Fix stage0 ICE caused by the old _Unwind_Resume override trickery.

8 years agoMinor documentation correction
Cole Reynolds [Sun, 1 Nov 2015 00:31:16 +0000 (20:31 -0400)]
Minor documentation correction

Corrects `write_bytes`'s documentation as the parameter name is `val` not `c`.

8 years agoCheck unchecked_div|rem's specialisation
Nicholas Mazzuca [Mon, 26 Oct 2015 03:51:51 +0000 (20:51 -0700)]
Check unchecked_div|rem's specialisation

Similarly to the simd intrinsics.

8 years agoAuto merge of #29487 - sfackler:current-exe-docs, r=steveklabnik
bors [Sat, 31 Oct 2015 14:13:43 +0000 (14:13 +0000)]
Auto merge of #29487 - sfackler:current-exe-docs, r=steveklabnik

The "optionally" stuff just makes things confusing.

r? @steveklabnik

8 years agoAuto merge of #29489 - Ms2ger:fmt-ri, r=Manishearth
bors [Sat, 31 Oct 2015 10:58:41 +0000 (10:58 +0000)]
Auto merge of #29489 - Ms2ger:fmt-ri, r=Manishearth

CC @nrc

8 years agoRustfmt region_inference.
Ms2ger [Sat, 31 Oct 2015 10:31:52 +0000 (11:31 +0100)]
Rustfmt region_inference.

8 years agoTweak env docs a bit
Steven Fackler [Sat, 31 Oct 2015 05:13:32 +0000 (22:13 -0700)]
Tweak env docs a bit

The "optionally" stuff just makes things confusing.

8 years agoAuto merge of #29484 - steveklabnik:gh29330, r=brson
bors [Sat, 31 Oct 2015 04:04:45 +0000 (04:04 +0000)]
Auto merge of #29484 - steveklabnik:gh29330, r=brson

These two commits do a few things:

1. reformat to 80 cols
2. use the reference-style links where appropriate for improved in-source readability
3. adds a few links, tweaks a couple of words, `3` -> `three`, stuff like that

While the diff is big due to these edits, there's no significant content change.

r? @brson

8 years agoAuto merge of #29480 - apasel422:coerce-unique, r=alexcrichton
bors [Sat, 31 Oct 2015 01:58:51 +0000 (01:58 +0000)]
Auto merge of #29480 - apasel422:coerce-unique, r=alexcrichton

Closes rust-lang/rfcs#1343.

8 years agoRemove PatWildMulti
Vadim Petrochenkov [Sat, 31 Oct 2015 00:44:43 +0000 (03:44 +0300)]
Remove PatWildMulti

8 years agoAuto merge of #29477 - alexcrichton:revert-compiler-rt, r=brson
bors [Sat, 31 Oct 2015 00:09:39 +0000 (00:09 +0000)]
Auto merge of #29477 - alexcrichton:revert-compiler-rt, r=brson

This ended up causing regressions in a few builds I've seen:

* MinGW -- [64-bit](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/1.0.338/job/2c4pkxgxa2dvqs25) and [32-bit](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/1.0.338/job/d0n7kml3k5el9gla)
- MSVC - [64-bit with VS 12.0](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/job/ugldcage9ydoy1k6) and [32-bit with VS 12.0](https://ci.appveyor.com/project/alexcrichton/gcc-rs/build/job/pn59p4rhnj8gybei).

I suspect the problems are along the lines of:

* The emutls support needs to be disabled on Windows, it currently always used pthreads which isn't available
* The objects in compiler-rt either need to be built without a CRT or not specifically against the static one.

8 years agoAuto merge of #29454 - stepancheg:vec-reserve, r=bluss
bors [Fri, 30 Oct 2015 22:23:41 +0000 (22:23 +0000)]
Auto merge of #29454 - stepancheg:vec-reserve, r=bluss

Before this patch `reserve` function allocated twice as requested
amount elements (not twice as capacity).  It leaded to unnecessary
excessive memory usage in scenarios like this:

```
let mut v = Vec::new();
v.push(17);
v.extend(0..10);
println!("{}", v.capacity());
```

`Vec` allocated 22 elements, while it could allocate just 11.

`reserve` function must have a property of keeping `push` operation
cost (which calls `reserve`) `O(1)`. To achieve this `reserve` must
exponentialy grow its capacity when it does reallocation.

There's better strategy to implement `reserve`:

```
let new_capacity = max(current_capacity * 2, requested_capacity);
```

This strategy still guarantees that capacity grows at `O(1)` with
`reserve`, and fixes the issue with `extend`.

Patch imlpements this strategy.

8 years agoSome fixes to std index docs
Steve Klabnik [Fri, 30 Oct 2015 21:43:05 +0000 (17:43 -0400)]
Some fixes to std index docs

Part of https://github.com/rust-lang/rust/issues/29330

Needed because of https://github.com/rust-lang/rust/issues/29481 and https://github.com/rust-lang/rust/issues/29483

8 years agoClean up formatting on std main page
Steve Klabnik [Fri, 30 Oct 2015 21:18:26 +0000 (17:18 -0400)]
Clean up formatting on std main page

Part of #29330

8 years agoFix excessive memory allocation in RawVec::reserve
Stepan Koltsov [Fri, 30 Oct 2015 21:17:16 +0000 (00:17 +0300)]
Fix excessive memory allocation in RawVec::reserve

Before this patch `reserve` function allocated twice as requested
amount elements (not twice as capacity).  It leaded to unnecessary
excessive memory usage in scenarios like this:

```
let mut v = Vec::new();
v.push(17);
v.extend(0..10);
println!("{}", v.capacity());
```

`Vec` allocated 22 elements, while it could allocate just 11.

`reserve` function must have a property of keeping `push` operation
cost (which calls `reserve`) `O(1)`. To achieve this `reserve` must
exponentialy grow its capacity when it does reallocation.

There's better strategy to implement `reserve`:

```
let new_capacity = max(current_capacity * 2, requested_capacity);
```

This strategy still guarantees that capacity grows at `O(1)` with
`reserve`, and fixes the issue with `extend`.

Patch imlpements this strategy.

8 years agoImplement `CoerceUnsized` for `Unique`
Andrew Paseltiner [Fri, 30 Oct 2015 20:38:29 +0000 (16:38 -0400)]
Implement `CoerceUnsized` for `Unique`

Closes rust-lang/rfcs#1343.

8 years agoAuto merge of #29475 - apasel422:drop-in, r=alexcrichton
bors [Fri, 30 Oct 2015 19:06:43 +0000 (19:06 +0000)]
Auto merge of #29475 - apasel422:drop-in, r=alexcrichton

This is a rebase of #27204.

r? @alexcrichton
CC @Gankro

8 years agoRevert "Build compiler-rt/builtins with MSVC"
Alex Crichton [Fri, 30 Oct 2015 17:36:38 +0000 (10:36 -0700)]
Revert "Build compiler-rt/builtins with MSVC"

This reverts commit b09e8f51a26f9421d27fea4e1324b6ee24a26722.

8 years agoRevert "Update compiler-rt"
Alex Crichton [Fri, 30 Oct 2015 17:36:34 +0000 (10:36 -0700)]
Revert "Update compiler-rt"

This reverts commit 6e61c6f11902c686a637207a78aa1ccaad24f9b6.

8 years agoAuto merge of #29468 - ronindev:patch-1, r=alexcrichton
bors [Fri, 30 Oct 2015 16:18:11 +0000 (16:18 +0000)]
Auto merge of #29468 - ronindev:patch-1, r=alexcrichton

There are no `rm` commands on windows. But windows has `del`

8 years agodon't use drop_in_place as an intrinsic
Alexis Beingessner [Wed, 19 Aug 2015 22:55:36 +0000 (15:55 -0700)]
don't use drop_in_place as an intrinsic

8 years agoexpose drop_in_place as ptr::drop_in_place
Alexis Beingessner [Tue, 21 Jul 2015 21:11:50 +0000 (14:11 -0700)]
expose drop_in_place as ptr::drop_in_place

8 years agoAdd JSON parser rule for custom_unwind_resume.
pierzchalski [Thu, 29 Oct 2015 16:20:51 +0000 (03:20 +1100)]
Add JSON parser rule for custom_unwind_resume.

8 years agoFixed delete command on Windows
Igor Shuvalov [Fri, 30 Oct 2015 06:25:55 +0000 (09:25 +0300)]
Fixed delete command on Windows

8 years agoAuto merge of #29458 - tshepang:better, r=alexcrichton
bors [Fri, 30 Oct 2015 01:28:12 +0000 (01:28 +0000)]
Auto merge of #29458 - tshepang:better, r=alexcrichton

I see that `extend()` is not called if new_len > len()

8 years agoAuto merge of #29199 - tshepang:they-can, r=steveklabnik
bors [Thu, 29 Oct 2015 23:39:34 +0000 (23:39 +0000)]
Auto merge of #29199 - tshepang:they-can, r=steveklabnik

8 years agoAuto merge of #29452 - SimonSapin:patch-14, r=alexcrichton
bors [Thu, 29 Oct 2015 20:46:44 +0000 (20:46 +0000)]
Auto merge of #29452 - SimonSapin:patch-14, r=alexcrichton

… I think.