]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoRollup merge of #24281 - steveklabnik:lol_editing, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:35:09 +0000 (19:05 +0530)]
Rollup merge of #24281 - steveklabnik:lol_editing, r=alexcrichton

 more more more

9 years agoRollup merge of #24279 - libfud:vec_insertion_docs, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:35:00 +0000 (19:05 +0530)]
Rollup merge of #24279 - libfud:vec_insertion_docs, r=steveklabnik

 ...to be less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording.

r? @steveklabnik

9 years agoRollup merge of #24274 - steveklabnik:fix_pow_docs, r=nikomatsakis
Manish Goregaokar [Sat, 11 Apr 2015 13:34:51 +0000 (19:04 +0530)]
Rollup merge of #24274 - steveklabnik:fix_pow_docs, r=nikomatsakis

 This is very confusing now that these are inherent methods.

9 years agoRollup merge of #24259 - lstat:needstest, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:34:43 +0000 (19:04 +0530)]
Rollup merge of #24259 - lstat:needstest, r=alexcrichton

 Closes #20772
Closes #20939
Closes #21950
Closes #22034

9 years agoRollup merge of #24253 - steveklabnik:doc_primitive_types, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:34:37 +0000 (19:04 +0530)]
Rollup merge of #24253 - steveklabnik:doc_primitive_types, r=alexcrichton

 A brief introduction to each type, with pointers to the primitive pages
for more info.

9 years agoRollup merge of #24247 - steveklabnik:update_variable_bindings, r=huonw
Manish Goregaokar [Sat, 11 Apr 2015 13:34:30 +0000 (19:04 +0530)]
Rollup merge of #24247 - steveklabnik:update_variable_bindings, r=huonw

 keeping on with the edits

9 years agoRollup merge of #24245 - nikomatsakis:issue-24241-coherence-failure, r=pnkfelix
Manish Goregaokar [Sat, 11 Apr 2015 13:34:22 +0000 (19:04 +0530)]
Rollup merge of #24245 - nikomatsakis:issue-24241-coherence-failure, r=pnkfelix

 Don't use skolemized parameters but rather fresh variables in coherence. Skolemized parameters wind up preventing unification. Surprised we had no test for this! Fixes #24241.

r? @pnkfelix

9 years agoRollup merge of #24244 - steveklabnik:more_editing, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:34:15 +0000 (19:04 +0530)]
Rollup merge of #24244 - steveklabnik:more_editing, r=steveklabnik

 Fill out blank section headers. Copy edit the entire first section.

9 years agoRollup merge of #24243 - frewsxcv:patch-13, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:34:08 +0000 (19:04 +0530)]
Rollup merge of #24243 - frewsxcv:patch-13, r=steveklabnik

9 years agoRollup merge of #24242 - nikomatsakis:escaping-closure-error-message, r=brson
Manish Goregaokar [Sat, 11 Apr 2015 13:34:03 +0000 (19:04 +0530)]
Rollup merge of #24242 - nikomatsakis:escaping-closure-error-message, r=brson

 Example showing sample inputs, old message, new message:

https://gist.github.com/nikomatsakis/11126784ac678b7eb6ba

Also adds infrastructure for reporting suggestions \"in situ\" and does some (minor) cleanups to `CodeMap`.

r? @brson

9 years agoRollup merge of #24240 - apasel422:patch-1, r=aturon
Manish Goregaokar [Sat, 11 Apr 2015 13:33:56 +0000 (19:03 +0530)]
Rollup merge of #24240 - apasel422:patch-1, r=aturon

9 years agoRollup merge of #24239 - steveklabnik:editing_pass, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:33:50 +0000 (19:03 +0530)]
Rollup merge of #24239 - steveklabnik:editing_pass, r=steveklabnik

 Now that the new TOC has landed, I've started doing an editing pass to get the old content into the right shape. I felt this introduction was significant enough to send as its own PR, though, as it's the introduction.

It's possible that we may just want to replace 'the intro' with this directly, but this PR doesn't do that.

9 years agoRollup merge of #24236 - aturon:issue-19097, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:43 +0000 (19:03 +0530)]
Rollup merge of #24236 - aturon:issue-19097, r=alexcrichton

 Closes #19097

9 years agoRollup merge of #24234 - thiagooak:academic-research, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:33:36 +0000 (19:03 +0530)]
Rollup merge of #24234 - thiagooak:academic-research, r=steveklabnik

 #24004

Something like this?

9 years agoRollup merge of #24121 - steveklabnik:gh24107, r=steveklabnik
Manish Goregaokar [Sat, 11 Apr 2015 13:33:29 +0000 (19:03 +0530)]
Rollup merge of #24121 - steveklabnik:gh24107, r=steveklabnik

9 years agoRollup merge of #24285 - brson:rustup, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:20 +0000 (19:03 +0530)]
Rollup merge of #24285 - brson:rustup, r=alexcrichton

 Now lives at https://github.com/rust-lang/rustup

r? @alexcrichton

9 years agoRollup merge of #24269 - benashford:formatting-fix, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:13 +0000 (19:03 +0530)]
Rollup merge of #24269 - benashford:formatting-fix, r=alexcrichton

 This fixes the bug described in issue #23150.  This affected formatting any floating point number into a string in a formatting pattern that: a) required rounding up, and b) required an extra digit on the front.

So `format!(\"{:.0}\", 9.9)` would fail, but `format!(\"{:.0}\", 8.9)` would succeed.  This was due to a negative integer being cast to a `usize` resulting in an 'arithmetic operation overflowed' panic.

The fix was to change the order of operations so that the number is zero before casting.

9 years agoRollup merge of #24268 - pnkfelix:regression-tests, r=alexcrichton
Manish Goregaokar [Sat, 11 Apr 2015 13:33:04 +0000 (19:03 +0530)]
Rollup merge of #24268 - pnkfelix:regression-tests, r=alexcrichton

 A pair of regression tests for issues that seem to have been fixed since they were originally filed.

9 years agoAuto merge of #24155 - chris-chambers:stmt_macros, r=sfackler
bors [Sat, 11 Apr 2015 08:07:34 +0000 (08:07 +0000)]
Auto merge of #24155 - chris-chambers:stmt_macros, r=sfackler

Statement macros are now treated somewhat like item macros, in that a statement macro can now expand into a series of statements, rather than just a single statement.

This allows statement macros to be nested inside other kinds of macros and expand properly, where previously the expansion would only work when no nesting was present.

See:
- `src/test/run-pass/macro-stmt_macro_in_expr_macro.rs`
- `src/test/run-pass/macro-nested_stmt_macro.rs`

This changes the interface of the MacResult trait.  make_stmt has become make_stmts and now returns a vector, rather than a single item.  Plugin writers who were implementing MacResult will have breakage, as well as anyone using MacEager::stmt.

See:
- `src/libsyntax/ext/base.rs`

This also causes a minor difference in behavior to the diagnostics produced by certain malformed macros.

See:
- `src/test/compile-fail/macro-incomplete-parse.rs`

9 years agoMoves expand_stmt's bt_pop so that it balances correctly.
Christopher Chambers [Sat, 11 Apr 2015 05:59:00 +0000 (00:59 -0500)]
Moves expand_stmt's bt_pop so that it balances correctly.

9 years agoAuto merge of #24254 - aturon:join-handle-debug, r=alexcrichton
bors [Sat, 11 Apr 2015 05:57:55 +0000 (05:57 +0000)]
Auto merge of #24254 - aturon:join-handle-debug, r=alexcrichton

Make `Box<Any + Send>` implement `Debug`.

Fixes #21291

9 years agoSimplifications to statement macro handling.
Christopher Chambers [Sat, 11 Apr 2015 04:06:34 +0000 (23:06 -0500)]
Simplifications to statement macro handling.

SmallVector::pop no longer worries about converting a Many repr downward
to One or Zero.

expand_stmt makes use of `if let` for style purposes.

9 years agoEliminates a pointless is_empty test.
Christopher Chambers [Sat, 11 Apr 2015 03:20:01 +0000 (22:20 -0500)]
Eliminates a pointless is_empty test.

9 years agoImproves semicolon expansion efficiency, corrects bt_pop placement.
Christopher Chambers [Sat, 11 Apr 2015 02:50:23 +0000 (21:50 -0500)]
Improves semicolon expansion efficiency, corrects bt_pop placement.

Implements pop() on SmallVector, and uses it to expand the final semicolon
in a statement macro expansion more efficiently.

Corrects the placement of the call to fld.cx.bt_pop().  It must run
unconditionally to reverse the corresponding push.

9 years agoAuto merge of #24186 - richo:pad-pointers, r=alexcrichton
bors [Sat, 11 Apr 2015 01:59:18 +0000 (01:59 +0000)]
Auto merge of #24186 - richo:pad-pointers, r=alexcrichton

This pads out the printing of pointers to their native width.

Extracted from and rebased on top of #24144

9 years agoAuto merge of #24270 - pnkfelix:use-disr-val-for-derive-ord, r=brson
bors [Fri, 10 Apr 2015 23:49:24 +0000 (23:49 +0000)]
Auto merge of #24270 - pnkfelix:use-disr-val-for-derive-ord, r=brson

Use `discriminant_value` intrinsic for `derive(PartialOrd)`

[breaking-change]

This is a [breaking-change] because it can change the result of comparison operators when enum discriminants have been explicitly assigned.  Notably in a case like:
```rust
#[derive(PartialOrd)]
enum E { A = 2, B = 1}
```

Under the old deriving, `A < B` held, because `A` came before `B` in the order of declaration.  But now we use the ordering according to the provided values, and thus `A > B`.  (However, this change is very unlikely to break much, if any, code, since the orderings themselves should all remain well-defined, total, etc.)

Fix #15523

9 years agoRemove pretty-expanded from 2 tests; deriving(Ord) uses unstable intrinsic.
Felix S. Klock II [Fri, 10 Apr 2015 22:50:59 +0000 (00:50 +0200)]
Remove pretty-expanded from 2 tests; deriving(Ord) uses unstable intrinsic.

9 years agoMore editing work on TRPL
Steve Klabnik [Thu, 9 Apr 2015 19:17:31 +0000 (15:17 -0400)]
More editing work on TRPL

Fill out blank section headers. Copy edit the entire first section.

9 years agofix some comments.
Felix S. Klock II [Fri, 10 Apr 2015 17:13:34 +0000 (19:13 +0200)]
fix some comments.

9 years agoTest case for 64-bit corner cases where truncation occurred before prior commit.
Felix S. Klock II [Fri, 10 Apr 2015 17:02:01 +0000 (19:02 +0200)]
Test case for 64-bit corner cases where truncation occurred before prior commit.

9 years agoIncorporate repr-attr into deriving(PartialOrd) to avoid truncation errors.
Felix S. Klock II [Fri, 10 Apr 2015 17:00:38 +0000 (19:00 +0200)]
Incorporate repr-attr into deriving(PartialOrd) to avoid truncation errors.

remove out of date fixme.

9 years agoRemove rustup.sh.
Brian Anderson [Fri, 10 Apr 2015 17:01:04 +0000 (10:01 -0700)]
Remove rustup.sh.

Now lives at https://github.com/rust-lang/rustup

9 years agoAdd examples for Convert
Steve Klabnik [Mon, 6 Apr 2015 18:25:39 +0000 (14:25 -0400)]
Add examples for Convert

9 years agocopyediting: while loops
Steve Klabnik [Fri, 10 Apr 2015 16:25:40 +0000 (12:25 -0400)]
copyediting: while loops

9 years agocopyediting: for loops
Steve Klabnik [Fri, 10 Apr 2015 16:21:14 +0000 (12:21 -0400)]
copyediting: for loops

9 years agocopyedits: patterns
Steve Klabnik [Fri, 10 Apr 2015 16:19:26 +0000 (12:19 -0400)]
copyedits: patterns

This also puts slice patterns in nightly docs, where they belong.

9 years agocopyediting: match
Steve Klabnik [Fri, 10 Apr 2015 16:03:30 +0000 (12:03 -0400)]
copyediting: match

9 years agocopy-editing: if
Steve Klabnik [Fri, 10 Apr 2015 15:50:28 +0000 (11:50 -0400)]
copy-editing: if

I decided to break if-let out, as it's too complex for this part, but moving
if that late seems silly too.

9 years agoremove backticks from titles
Steve Klabnik [Fri, 10 Apr 2015 15:35:19 +0000 (11:35 -0400)]
remove backticks from titles

This doesn't actually display correctly

9 years agosome TOC reorganization
Steve Klabnik [Fri, 10 Apr 2015 15:33:56 +0000 (11:33 -0400)]
some TOC reorganization

As I go through this, I'm finding some ways that I want to tweak the order.

9 years agoAuto merge of #24177 - alexcrichton:rustdoc, r=aturon
bors [Fri, 10 Apr 2015 16:18:44 +0000 (16:18 +0000)]
Auto merge of #24177 - alexcrichton:rustdoc, r=aturon

This commit series starts out with more official test harness support for rustdoc tests, and then each commit afterwards adds a test (where appropriate). Each commit should also test and finish independently of all others (they're all pretty separable).

I've uploaded a [copy of the documentation](http://people.mozilla.org/~acrichton/doc/std/) generated after all these commits were applied, and a double check on issues being closed would be greatly appreciated! I'll also browse the docs a bit and make sure nothing regressed too horribly.

9 years agoChanged the wording of the documentation for the insert method for Vec to be less...
Dominick Allen [Fri, 10 Apr 2015 15:33:21 +0000 (11:33 -0400)]
Changed the wording of the documentation for the insert method for Vec to be less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording.

9 years agoFix pow docs to not use Int
Steve Klabnik [Fri, 10 Apr 2015 14:58:07 +0000 (10:58 -0400)]
Fix pow docs to not use Int

This is very confusing now that these are inherent methods.

9 years agoRe-add a fixme after some investigation into what's going on.
Felix S. Klock II [Fri, 10 Apr 2015 14:26:11 +0000 (16:26 +0200)]
Re-add a fixme after some investigation into what's going on.

9 years agoTest case for new `derive(PartialOrd)` expansion.
Felix S. Klock II [Fri, 10 Apr 2015 14:17:06 +0000 (16:17 +0200)]
Test case for new `derive(PartialOrd)` expansion.

9 years agoChange `derive` expansions to use `discriminant_value` intrinsic.
Felix S. Klock II [Fri, 10 Apr 2015 14:15:12 +0000 (16:15 +0200)]
Change `derive` expansions to use `discriminant_value` intrinsic.

Fix #15523.

9 years agoRebase discriminant_value test. Add case for a specialized repr.
Felix S. Klock II [Fri, 10 Apr 2015 14:14:00 +0000 (16:14 +0200)]
Rebase discriminant_value test. Add case for a specialized repr.

9 years agoRegression test for Issue 21486.
Felix S. Klock II [Fri, 10 Apr 2015 13:35:19 +0000 (15:35 +0200)]
Regression test for Issue 21486.

Fix #21486

9 years agoRegression test for Issue 21400.
Felix S. Klock II [Fri, 10 Apr 2015 13:34:34 +0000 (15:34 +0200)]
Regression test for Issue 21400.

Fix #21400.

9 years agoAuto merge of #24034 - alexcrichton:cloexec, r=aturon
bors [Fri, 10 Apr 2015 12:42:46 +0000 (12:42 +0000)]
Auto merge of #24034 - alexcrichton:cloexec, r=aturon

The commit messages have more details as to what's going on, but this is a breaking change for any libraries which expect file descriptors to be inherited by default.

Closes #12148

9 years agoFix for #23150
Ben Ashford [Fri, 10 Apr 2015 12:10:48 +0000 (13:10 +0100)]
Fix for #23150

9 years agoAdd test for discriminant_value results
James Miller [Sun, 11 Jan 2015 00:51:58 +0000 (13:51 +1300)]
Add test for discriminant_value results

9 years agoImplement `discriminant_value` intrinsic
James Miller [Sat, 10 Jan 2015 23:58:20 +0000 (12:58 +1300)]
Implement `discriminant_value` intrinsic

Implements an intrinsic for extracting the value of the discriminant
enum variant values. For non-enum types, this returns zero, otherwise it
returns the value we use for discriminant comparisons. This means that
enum types that do not have a discriminant will also work in this
arrangement.

This is (at least part of) the work on Issue #24263

9 years agoImprove error message where a closure escapes fn while trying to borrow
Niko Matsakis [Thu, 9 Apr 2015 18:49:03 +0000 (14:49 -0400)]
Improve error message where a closure escapes fn while trying to borrow
from the current fn. Employ the new `span_suggestion` to show how you
can use `move`.

9 years agoAdd a new `span_suggestion` infrastructure. This lets you edit a snippet
Niko Matsakis [Thu, 9 Apr 2015 18:48:15 +0000 (14:48 -0400)]
Add a new `span_suggestion` infrastructure. This lets you edit a snippet
of text (perhaps obtained by span_snippet) and then splice that edited
form back into the original file in the form of a suggestion.

9 years agoModify the codemap code to use more slices and to information about
Niko Matsakis [Thu, 9 Apr 2015 18:46:03 +0000 (14:46 -0400)]
Modify the codemap code to use more slices and to information about
columns within a line, not just the line numbers. Also try to clarify
and use the term `line_index` when 0-based.

9 years agoReplace the use of the rather randomly named boolean `custom` to mean
Niko Matsakis [Thu, 9 Apr 2015 18:44:56 +0000 (14:44 -0400)]
Replace the use of the rather randomly named boolean `custom` to mean
"highlight end" and instead add a variant to `RenderSpan`

9 years agostd: Unconditionally close all file descriptors
Alex Crichton [Fri, 3 Apr 2015 22:44:14 +0000 (15:44 -0700)]
std: Unconditionally close all file descriptors

The logic for only closing file descriptors >= 3 was inherited from quite some
time ago and ends up meaning that some internal APIs are less consistent than
they should be. By unconditionally closing everything entering a `FileDesc` we
ensure that we're consistent in our behavior as well as robustly handling the
stdio case.

9 years agoTest fixes and review feedback
Alex Crichton [Wed, 8 Apr 2015 03:11:59 +0000 (20:11 -0700)]
Test fixes and review feedback

9 years agoAuto merge of #24180 - huonw:optimise-max-etc, r=alexcrichton
bors [Fri, 10 Apr 2015 07:54:18 +0000 (07:54 +0000)]
Auto merge of #24180 - huonw:optimise-max-etc, r=alexcrichton

The main change in this patch is removing the use of `Option` inside the
inner loops of those functions to avoid comparisons where one branch
will only trigger on the first pass through the loop.

The included benchmarks go from:

    test bench_max    ... bench:       372 ns/iter (+/- 118)
    test bench_max_by ... bench:       428 ns/iter (+/- 33)
    test bench_max_by2 ... bench:      7128 ns/iter (+/- 326)

to:

    test bench_max    ... bench:       317 ns/iter (+/- 64)
    test bench_max_by ... bench:       356 ns/iter (+/- 270)
    test bench_max_by2 ... bench:      1387 ns/iter (+/- 183)

Problem noticed in http://www.reddit.com/r/rust/comments/31syce/using_iterators_to_find_the_index_of_the_min_or/

9 years agoAdd tests for E-needstest issues
Luke Gallagher [Fri, 10 Apr 2015 06:12:54 +0000 (16:12 +1000)]
Add tests for E-needstest issues

Closes #20772
Closes #20939
Closes #21950
Closes #22034

9 years agoOptimise Iterator::{max, max_by, min, min_by}.
Huon Wilson [Wed, 8 Apr 2015 04:25:22 +0000 (14:25 +1000)]
Optimise Iterator::{max, max_by, min, min_by}.

The main change in this patch is removing the use of `Option` inside the
inner loops of those functions to avoid comparisons where one branch
will only trigger on the first pass through the loop.

The included benchmarks go from:

    test bench_max    ... bench:       372 ns/iter (+/- 118)
    test bench_max_by ... bench:       428 ns/iter (+/- 33)
    test bench_max_by2 ... bench:      7128 ns/iter (+/- 326)

to:

    test bench_max    ... bench:       317 ns/iter (+/- 64)
    test bench_max_by ... bench:       356 ns/iter (+/- 270)
    test bench_max_by2 ... bench:      1387 ns/iter (+/- 183)

Problem noticed in http://www.reddit.com/r/rust/comments/31syce/using_iterators_to_find_the_index_of_the_min_or/

9 years agofmt: Assume that we'll only ever see 32 or 64 bit pointers
Richo Healey [Fri, 10 Apr 2015 01:06:01 +0000 (18:06 -0700)]
fmt: Assume that we'll only ever see 32 or 64 bit pointers

9 years agotest: Unignore test for fixed issue #20676
Richo Healey [Thu, 9 Apr 2015 00:48:19 +0000 (17:48 -0700)]
test: Unignore test for fixed issue #20676

9 years agofmt: {:p#} formats pointers padded to native width
Richo Healey [Wed, 8 Apr 2015 00:53:55 +0000 (17:53 -0700)]
fmt: {:p#} formats pointers padded to native width

9 years agoEnsure that .join().unwrap() works
Aaron Turon [Fri, 10 Apr 2015 00:23:49 +0000 (17:23 -0700)]
Ensure that .join().unwrap() works

Makes `Any + Send` implement `Debug`.

Fixes #21291

9 years agostd: Clean up process spawn impl on unix
Alex Crichton [Fri, 3 Apr 2015 22:34:15 +0000 (15:34 -0700)]
std: Clean up process spawn impl on unix

* De-indent quite a bit by removing usage of FnOnce closures
* Clearly separate code for the parent/child after the fork
* Use `fs2::{File, OpenOptions}` instead of calling `open` manually
* Use RAII to close I/O objects wherever possible
* Remove loop for closing all file descriptors, all our own ones are now
  `CLOEXEC` by default so they cannot be inherited

9 years agostd: Set CLOEXEC for all fds opened on unix
Alex Crichton [Fri, 3 Apr 2015 22:30:10 +0000 (15:30 -0700)]
std: Set CLOEXEC for all fds opened on unix

This commit starts to set the CLOEXEC flag for all files and sockets opened by
the standard library by default on all unix platforms. There are a few points of
note in this commit:

* The implementation is not 100% satisfactory in the face of threads. File
  descriptors only have the `F_CLOEXEC` flag set *after* they are opened,
  allowing for a fork/exec to happen in the middle and leak the descriptor.
  Some platforms do support atomically opening a descriptor while setting the
  `CLOEXEC` flag, and it is left as a future extension to bind these apis as it
  is unclear how to do so nicely at this time.

* The implementation does not offer a method of opting into the old behavior of
  not setting `CLOEXEC`. This will possibly be added in the future through
  extensions on `OpenOptions`, for example.

* This change does not yet audit any Windows APIs to see if the handles are
  inherited by default by accident.

This is a breaking change for users who call `fork` or `exec` outside of the
standard library itself and expect file descriptors to be inherted. All file
descriptors created by the standard library will no longer be inherited.

[breaking-change]

9 years agoWrite the 'primitive types' section of TRPL
Steve Klabnik [Thu, 9 Apr 2015 23:05:49 +0000 (19:05 -0400)]
Write the 'primitive types' section of TRPL

A brief introduction to each type, with pointers to the primitive pages
for more info.

9 years agoAuto merge of #24205 - brson:debug, r=alexcrichton
bors [Thu, 9 Apr 2015 23:52:02 +0000 (23:52 +0000)]
Auto merge of #24205 - brson:debug, r=alexcrichton

This makes the default configuration fully optimized, with no debugging options, no llvm asserts, renames --enable-debug to --enable-debug-assertions, and adds --enable-debug as a blanket option that toggles various things, per #17665. It does not add a `--enable-release` flag since that would be a no-op.

cc @nrc

Fixes https://github.com/rust-lang/rust/issues/22390
Fixes https://github.com/rust-lang/rust/issues/17081
Partially addresses https://github.com/rust-lang/rust/issues/17665

9 years agoTRPL: new introduction
Steve Klabnik [Thu, 9 Apr 2015 16:47:08 +0000 (12:47 -0400)]
TRPL: new introduction

9 years agoCopyediting for 'variable bindings'
Steve Klabnik [Thu, 9 Apr 2015 20:30:43 +0000 (16:30 -0400)]
Copyediting for 'variable bindings'

9 years agoAuto merge of #24232 - Manishearth:rollup, r=Manishearth
bors [Thu, 9 Apr 2015 20:38:36 +0000 (20:38 +0000)]
Auto merge of #24232 - Manishearth:rollup, r=Manishearth

None

9 years agofixup windows std_misc
Manish Goregaokar [Thu, 9 Apr 2015 20:39:19 +0000 (02:09 +0530)]
fixup windows std_misc

9 years agoDon't use skolemized parameters but rather fresh variables in
Niko Matsakis [Thu, 9 Apr 2015 19:56:07 +0000 (15:56 -0400)]
Don't use skolemized parameters but rather fresh variables in
coherence. Skolemized parameters wind up preventing unification.
Surprised we had no test for this! Fixes #24241.

9 years agoIndicate keyword in doc comment is code-like
Corey Farwell [Thu, 9 Apr 2015 19:02:14 +0000 (12:02 -0700)]
Indicate keyword in doc comment is code-like

9 years agoRollup merge of #24217 - aturon:iterator-fixes, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 16:00:06 +0000 (21:30 +0530)]
Rollup merge of #24217 - aturon:iterator-fixes, r=alexcrichton

9 years agoRollup merge of #24225 - nrc:for-span, r=pnkfelix
Manish Goregaokar [Thu, 9 Apr 2015 10:25:18 +0000 (15:55 +0530)]
Rollup merge of #24225 - nrc:for-span, r=pnkfelix

9 years agoRollup merge of #24170 - omo:omo-typo-fix, r=steveklabnik
Manish Goregaokar [Thu, 9 Apr 2015 10:25:12 +0000 (15:55 +0530)]
Rollup merge of #24170 - omo:omo-typo-fix, r=steveklabnik

 Can anyone take a look? Very trivial.

9 years agoRollup merge of #24221 - nrc:debug-loc, r=sfackler
Manish Goregaokar [Thu, 9 Apr 2015 10:25:05 +0000 (15:55 +0530)]
Rollup merge of #24221 - nrc:debug-loc, r=sfackler

9 years agoRollup merge of #24218 - lstat:remove-ignore-tidy, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:24:58 +0000 (15:54 +0530)]
Rollup merge of #24218 - lstat:remove-ignore-tidy, r=alexcrichton

 This is a really minor issue. I noticed some tests no longer need the ignore
tidy comment directive.

A quick grep turned up the following files:

    src/test/compile-fail/bad-mid-path-type-params.rs
    src/test/compile-fail/bad-sized.rs
    src/test/compile-fail/coherence-default-trait-impl.rs
    src/test/compile-fail/coherence-orphan.rs
    src/test/compile-fail/issue-8767.rs
    src/test/compile-fail/lint-stability.rs
    src/test/compile-fail/lint-uppercase-variables.rs
    src/test/compile-fail/typeck-default-trait-impl-outside-crate.rs
    src/test/compile-fail/use-after-move-implicity-coerced-object.rs
    src/test/debuginfo/gdb-pretty-std.rs

It didn't seem like it was worth opening an issue for this, but if that is not
the case (i.e. it is required), I'll open one up. Thanks!

9 years agoRollup merge of #24216 - alexcrichton:stabilize-from-raw-os-error, r=aturon
Manish Goregaokar [Thu, 9 Apr 2015 10:24:43 +0000 (15:54 +0530)]
Rollup merge of #24216 - alexcrichton:stabilize-from-raw-os-error, r=aturon

 This commit stabilizes the old `io::Error::from_os_error` after being renamed to
use the `raw_os_error` terminology instead. This function is often useful when
writing bindings to OS functions but only actually converting to an I/O error at
a later point.

9 years agoRollup merge of #24215 - alexcrichton:stabilize-clone-from, r=aturon
Manish Goregaokar [Thu, 9 Apr 2015 10:24:36 +0000 (15:54 +0530)]
Rollup merge of #24215 - alexcrichton:stabilize-clone-from, r=aturon

 This method hasn't really changed since is inception, and it can often be a
nice performance win for some situations. This method also imposes no burden on
implementors or users of `Clone` as it's just a default method on the side.

9 years agoRollup merge of #24212 - alexcrichton:destabilize-begin-unwind, r=huonw
Manish Goregaokar [Thu, 9 Apr 2015 10:24:28 +0000 (15:54 +0530)]
Rollup merge of #24212 - alexcrichton:destabilize-begin-unwind, r=huonw

 Now that we have a `#[allow_internal_unstable]` attribute for macros there's no
need for these two `begin_unwind` functions to be stable. Right now the `panic!`
interface is the only one we wish to stabilize, so remove the stability markers
from these functions.

While this is a breaking change, it is highly unlikely to break any actual code.
It is recommended to use the `panic!` macro instead if it breaks explicit calls
into `std::rt`.

[breaking-change]
cc #24208

9 years agoRollup merge of #24207 - kmcallister:llvm-plugin, r=brson
Manish Goregaokar [Thu, 9 Apr 2015 10:24:18 +0000 (15:54 +0530)]
Rollup merge of #24207 - kmcallister:llvm-plugin, r=brson

 r? @brson

I'm using this to integrate rustc with [american-fuzzy-lop](http://lcamtuf.coredump.cx/afl/). Building with afl instrumentation is no different from loading any other plugin library.

I'd like this PR to include a `run-make` test with a custom LLVM pass; however I'm not sure it's worth the trouble of building C++ code and linking LLVM from the test suite (are there existing tests that do this?)

9 years agoRollup merge of #24205 - brson:debug, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:24:11 +0000 (15:54 +0530)]
Rollup merge of #24205 - brson:debug, r=alexcrichton

 This makes the default configuration fully optimized, with no debugging options, no llvm asserts, renames --enable-debug to --enable-debug-assertions, and adds --enable-debug as a blanket option that toggles various things, per #17665. It does not add a `--enable-release` flag since that would be a no-op.

cc @nrc

Fixes https://github.com/rust-lang/rust/issues/22390
Fixes https://github.com/rust-lang/rust/issues/17081
Partially addresses https://github.com/rust-lang/rust/issues/17665

9 years agoRollup merge of #24193 - lstat:needstest, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:24:04 +0000 (15:54 +0530)]
Rollup merge of #24193 - lstat:needstest, r=alexcrichton

 Closes #22289
Closes #22370
Closes #22384

9 years agoRollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelix
Manish Goregaokar [Thu, 9 Apr 2015 10:23:59 +0000 (15:53 +0530)]
Rollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelix

 Modify the ExprUseVisitor to walk each part of an AutoRef, and in
particular to treat an AutoUnsize as as kind of \"instantaneous\" borrow
of the value being unsized. This prevents us from feeding uninitialized
data.

This caused a problem for the eager reborrow of comparison traits,
because that wound up introducing a \"double AutoRef\", which was not
being thoroughly checked before but turned out not to type check.
Fortunately, we can just remove that \"eager reborrow\" as it is no longer
needed now that `PartialEq` doesn't force both LHS and RHS to have the
same type (and even if we did have this problem, the better way would be
to lean on introducing a common supertype).

Fixes #20791.

r? @nrc

9 years agoNightly gets LLVM assertions
Brian Anderson [Thu, 9 Apr 2015 18:51:46 +0000 (11:51 -0700)]
Nightly gets LLVM assertions

9 years agoFix `borrow` docs
Andrew Paseltiner [Thu, 9 Apr 2015 16:51:19 +0000 (12:51 -0400)]
Fix `borrow` docs

9 years agoAdd regression test for #19097
Aaron Turon [Thu, 9 Apr 2015 16:29:40 +0000 (09:29 -0700)]
Add regression test for #19097

Closes #19097

9 years agoresurrect research paper list #24004
Thiago Carvalho [Thu, 9 Apr 2015 16:07:33 +0000 (18:07 +0200)]
resurrect research paper list #24004

9 years agoImprove bounds in Iterator API
Aaron Turon [Thu, 9 Apr 2015 00:01:03 +0000 (17:01 -0700)]
Improve bounds in Iterator API

This commit changes `Iterator`'s API by:

* Generalizing bounds from `Iterator` to `IntoIterator` whenever
  possible, matching the semantics and ergonomics of `for` loops.

* Tightens up a few method-level bounds so that you get an error
  earlier. For example, `rev` did not require `DoubleEndedIterator` even
  though the result is only an `Iterator` when the original iterator was
  double-ended.

Closes #23587

The bound-tightening is technically a:

[breaking-change]

but no code should break in practice.

9 years agoAuto merge of #24176 - kballard:bufreader-seek-impl, r=aturon
bors [Thu, 9 Apr 2015 12:07:24 +0000 (12:07 +0000)]
Auto merge of #24176 - kballard:bufreader-seek-impl, r=aturon

9 years agoRollup merge of #24176 - kballard:bufreader-seek-impl, r=aturon
Manish Goregaokar [Thu, 9 Apr 2015 10:23:48 +0000 (15:53 +0530)]
Rollup merge of #24176 - kballard:bufreader-seek-impl, r=aturon

9 years agoRollup merge of #24175 - dhuseby:bitrig_fixing_tests_2, r=alexcrichton
Manish Goregaokar [Thu, 9 Apr 2015 10:23:43 +0000 (15:53 +0530)]
Rollup merge of #24175 - dhuseby:bitrig_fixing_tests_2, r=alexcrichton

 I'm not sure why this is failing.  This patch disables this test until I can figure out what is wrong.

9 years agoRollup merge of #24171 - rillian:rustup, r=brson
Manish Goregaokar [Thu, 9 Apr 2015 10:23:36 +0000 (15:53 +0530)]
Rollup merge of #24171 - rillian:rustup, r=brson

 The idea here is if you don't want rust in /usr/local
you can put something like this is your .profile:

```
export RUSTUP_PREFIX=$HOME/.local/rust
export PATH=$PATH:${RUSTUP_PREFIX}/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${RUSTUP_PREFIX}/lib
```
Then when you run rustup, it will update the install
in ${RUSTUP_PREFIX} without having to remember to pass
an explicit --prefix argument every time.

9 years agoFix the span for `for` expressions
Nick Cameron [Thu, 9 Apr 2015 08:35:27 +0000 (20:35 +1200)]
Fix the span for `for` expressions

9 years agoAuto merge of #24171 - rillian:rustup, r=brson
bors [Thu, 9 Apr 2015 07:49:26 +0000 (07:49 +0000)]
Auto merge of #24171 - rillian:rustup, r=brson

The idea here is if you don't want rust in /usr/local
you can put something like this is your .profile:

```
export RUSTUP_PREFIX=$HOME/.local/rust
export PATH=$PATH:${RUSTUP_PREFIX}/bin
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:${RUSTUP_PREFIX}/lib
```
Then when you run rustup, it will update the install
in ${RUSTUP_PREFIX} without having to remember to pass
an explicit --prefix argument every time.

9 years agoDebug impls for a few things in syntax::codemap
Nick Cameron [Thu, 9 Apr 2015 06:25:48 +0000 (18:25 +1200)]
Debug impls for a few things in syntax::codemap