]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #29806 - tsion:compile-state-mir_map, r=nikomatsakis
bors [Fri, 13 Nov 2015 20:18:18 +0000 (20:18 +0000)]
Auto merge of #29806 - tsion:compile-state-mir_map, r=nikomatsakis

This allows "rustc drop-in replacement" programs like https://github.com/nrc/stupid-stats to access the MIR map.

Working toy example: https://gist.github.com/tsion/288423389e32eb73bb39

r? @nikomatsakis

8 years agoRemove extra eval call in snap.mk
William Throwe [Fri, 13 Nov 2015 20:13:05 +0000 (15:13 -0500)]
Remove extra eval call in snap.mk

8 years agoClean up some "suspicious" whitespace in target.mk
William Throwe [Fri, 13 Nov 2015 20:01:07 +0000 (15:01 -0500)]
Clean up some "suspicious" whitespace in target.mk

Emacs warns that makefile lines that start with spaces followed by
tabs are "suspicious".  These were harmless since they were
continuation lines, but getting rid of the warning is nice and this
version looks better.

8 years agoEscape some variables in llvm.mk
William Throwe [Fri, 13 Nov 2015 19:54:25 +0000 (14:54 -0500)]
Escape some variables in llvm.mk

The important one is $(MAKE).  make handles recipes containing the
literal string "$(MAKE)" specially, so it is important to make sure it
isn't evaluated until recipe invocation time.

8 years agoAuto merge of #29759 - nagisa:mir-static, r=nikomatsakis
bors [Fri, 13 Nov 2015 17:10:25 +0000 (17:10 +0000)]
Auto merge of #29759 - nagisa:mir-static, r=nikomatsakis

Fixes #29578

r? @nikomatsakis

My own observations are posted inline as comments.

8 years agoMIR: Support closure up-vars in LvalueTy::projection_ty()
Michael Woerister [Fri, 13 Nov 2015 16:01:37 +0000 (17:01 +0100)]
MIR: Support closure up-vars in LvalueTy::projection_ty()

8 years agoAuto merge of #29811 - bluss:binary-heap-sift-less, r=gankro
bors [Fri, 13 Nov 2015 14:28:57 +0000 (14:28 +0000)]
Auto merge of #29811 - bluss:binary-heap-sift-less, r=gankro

BinaryHeap: Simplify sift down

Sift down was doing all too much work: it can stop directly when the
current element obeys the heap property in relation to its children.

In the old code, sift down didn't compare the element to sift down at
all, so it was maximally sifted down and relied on the sift up call to
put it in the correct location.

This should speed up heapify and .pop().

Also rename Hole::removed() to Hole::element()

8 years agoBinaryHeap: Simplify sift down
Ulrik Sverdrup [Fri, 13 Nov 2015 00:54:33 +0000 (01:54 +0100)]
BinaryHeap: Simplify sift down

Sift down was doing all too much work: it can stop directly when the
current element obeys the heap property in relation to its children.

In the old code, sift down didn't compare the element to sift down at
all, so it was maximally sifted down and relied on the sift up call to
put it in the correct location.

This should speed up heapify and .pop().

Also rename Hole::removed() to Hole::element()

8 years agoAuto merge of #29761 - eefriedman:rename-nopanic, r=sanxiyn
bors [Fri, 13 Nov 2015 10:28:25 +0000 (10:28 +0000)]
Auto merge of #29761 - eefriedman:rename-nopanic, r=sanxiyn

Just `sed s/_nopanic//g`.  Hopefully makes libsyntax a bit more
readable.

8 years agoAuto merge of #29800 - Detegr:master, r=nikomatsakis
bors [Fri, 13 Nov 2015 08:41:50 +0000 (08:41 +0000)]
Auto merge of #29800 - Detegr:master, r=nikomatsakis

Fundamental attribute was missing a feature gate test.

8 years agoStore a valid name for the root module in metadata
mitaa [Wed, 11 Nov 2015 21:10:21 +0000 (22:10 +0100)]
Store a valid name for the root module in metadata

8 years agoAuto merge of #29675 - bluss:merge-sort-fastpath, r=huonw
bors [Fri, 13 Nov 2015 01:44:58 +0000 (01:44 +0000)]
Auto merge of #29675 - bluss:merge-sort-fastpath, r=huonw

sort: Fast path for already sorted data

When merging two sorted blocks `left` and `right` if the last element in
`left` is <= the first in `right`, the blocks are already in sorted order.

Add this as an additional fast path by simply copying the whole left
block into the output and advancing the left pointer. The right block is
then treated the same way by the already present logic in the merge
loop.

Can reduce runtime of .sort() to less than 50% of the previous, if the data
was already perfectly sorted. Sorted data with a few swaps are also
sorted quicker than before. The overhead of one comparison per merge
seems to be negligible.

8 years agoAuto merge of #29807 - nrc:op_span, r=brson
bors [Thu, 12 Nov 2015 23:48:56 +0000 (23:48 +0000)]
Auto merge of #29807 - nrc:op_span, r=brson

cc @nagisa

8 years agoFix the manual implementation example for the Debug trait so it matches the given...
Erik Davidson [Thu, 12 Nov 2015 21:03:36 +0000 (15:03 -0600)]
Fix the manual implementation example for the Debug trait so it matches the given output

8 years agoFix a bad span for binops
Nick Cameron [Thu, 12 Nov 2015 20:34:41 +0000 (09:34 +1300)]
Fix a bad span for binops

8 years agoAuto merge of #29780 - KyleMayes:quote-ext, r=nrc
bors [Thu, 12 Nov 2015 20:31:12 +0000 (20:31 +0000)]
Auto merge of #29780 - KyleMayes:quote-ext, r=nrc

This is my first code contribution to Rust, so I'm sure there are some issues with the changes I've made.

I've added the `quote_arg!`, `quote_block!`, `quote_path!`, and `quote_meta_item!` quasiquoting macros. From my experience trying to build AST in compiler plugins, I would like to be able to build any AST piece with a quasiquoting macro (e.g., `quote_struct_field!` or `quote_variant!`) and then use those AST pieces in other quasiquoting macros, but this pull request just adds some of the low-hanging fruit.

I'm not sure if these additions are desirable, and I'm sure these macros can be implemented in an external crate if not.

8 years agoMake the mir_map available to the after_analysis CompileController step.
Scott Olson [Thu, 12 Nov 2015 20:18:11 +0000 (14:18 -0600)]
Make the mir_map available to the after_analysis CompileController step.

8 years agoUpdate references and borrowing (Fixes #29730)
Ashkan Kiani [Thu, 12 Nov 2015 18:35:53 +0000 (10:35 -0800)]
Update references and borrowing (Fixes #29730)

Fixes #29730

8 years agoAuto merge of #29712 - Toby-S:patch-1, r=steveklabnik
bors [Thu, 12 Nov 2015 18:00:27 +0000 (18:00 +0000)]
Auto merge of #29712 - Toby-S:patch-1, r=steveklabnik

Adds `Example` sections to the rest of the integer methods.

cc @steveklabnik

8 years agoAuto merge of #29757 - dotdash:mir_simplify_cfg, r=nikomatsakis
bors [Thu, 12 Nov 2015 15:48:34 +0000 (15:48 +0000)]
Auto merge of #29757 - dotdash:mir_simplify_cfg, r=nikomatsakis

For now, this pass does some easy transformations, like eliminating
empty blocks that just jump to another block, some trivial
conversion of If terminators into Gotos and removal of dead blocks.

r? @nikomatsakis

8 years agoAdd feature gate test for #[fundamental] attribute
Antti Keränen [Thu, 12 Nov 2015 14:03:55 +0000 (16:03 +0200)]
Add feature gate test for #[fundamental] attribute

8 years agoAdd a MIR pass to simplify the control flow graph
Björn Steinbrink [Tue, 10 Nov 2015 20:38:36 +0000 (21:38 +0100)]
Add a MIR pass to simplify the control flow graph

For now, this pass does some easy transformations, like eliminating
empty blocks that just jump to another block, some trivial
conversion of If terminators into Gotos and removal of dead blocks.

8 years agoAuto merge of #29544 - Ryman:reduce_doc_warnings, r=steveklabnik
bors [Thu, 12 Nov 2015 13:07:45 +0000 (13:07 +0000)]
Auto merge of #29544 - Ryman:reduce_doc_warnings, r=steveklabnik

Did this alphabetically, so I didn't see [how `std` was doing things](https://dxr.mozilla.org/rust/source/src/libstd/lib.rs#215) till I was nearly finished. If you prefer to add crate-level-whitelists like std instead of test-level, I can rebase with that strategy.

A number of these commits can probably be dropped as the crates don't have much to test, and are deprecated. Let me know which if any to drop! (can also squash after review if desired)

r? @steveklabnik

8 years agoAuto merge of #29770 - ollie27:assert_eq_unsized, r=alexcrichton
bors [Thu, 12 Nov 2015 10:38:48 +0000 (10:38 +0000)]
Auto merge of #29770 - ollie27:assert_eq_unsized, r=alexcrichton

`format_args!` doesn't support none Sized types so we should just pass it the references to `left_val` and `right_val`.

The following works:
```rust
assert!([1, 2, 3][..] == vec![1, 2, 3][..])
```
So I would expect this to as well:
```rust
assert_eq!([1, 2, 3][..], vec![1, 2, 3][..])
```
But it fails with "error: the trait `core::marker::Sized` is not implemented for the type `[_]` [E0277]"
I don't know if this change will have any nasty side effects I don't understand.

8 years agoImprove the detailed error message for E0432
Barosl Lee [Thu, 12 Nov 2015 09:05:45 +0000 (18:05 +0900)]
Improve the detailed error message for E0432

The command-line error message for E0432 does mention the possibility of
missing the `extern crate` declaration, but the detailed error message
for it doesn't.

Fixes #29517.

8 years agoAuto merge of #29795 - Manishearth:rollup, r=Manishearth
bors [Thu, 12 Nov 2015 08:02:43 +0000 (08:02 +0000)]
Auto merge of #29795 - Manishearth:rollup, r=Manishearth

- Successful merges: #29776, #29785, #29786, #29787
- Failed merges:

8 years agoFixup #29785
Manish Goregaokar [Thu, 12 Nov 2015 07:50:48 +0000 (13:20 +0530)]
Fixup #29785

8 years agoFixup #29776
Manish Goregaokar [Thu, 12 Nov 2015 07:50:16 +0000 (13:20 +0530)]
Fixup #29776

8 years agoRollup merge of #29787 - dbrgn:docs-fix, r=steveklabnik
Manish Goregaokar [Thu, 12 Nov 2015 07:48:51 +0000 (13:18 +0530)]
Rollup merge of #29787 - dbrgn:docs-fix, r=steveklabnik

Fix usage of wrong article in `Result` docs.

This is my first rust PR, if something about the process is wrong let me know.

As this is a documentation change, I believe the correct highfive line to use is the following:

r? @steveklabnik

8 years agoRollup merge of #29786 - steveklabnik:stage0fix, r=brson
Manish Goregaokar [Thu, 12 Nov 2015 07:48:51 +0000 (13:18 +0530)]
Rollup merge of #29786 - steveklabnik:stage0fix, r=brson

8 years agoRollup merge of #29785 - steveklabnik:doc_prelude, r=nikomatsakis
Manish Goregaokar [Thu, 12 Nov 2015 07:48:51 +0000 (13:18 +0530)]
Rollup merge of #29785 - steveklabnik:doc_prelude, r=nikomatsakis

This mostly brings them in line with existing linking convention, but
also has some minor re-wording.

The text at the top has been re-focused, by starting out with what the
prelude does, rather than starting from injecting std.

Also, it now mentions that other preludes exist.

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

8 years agoRollup merge of #29776 - nikomatsakis:mir-29740, r=nrc
Manish Goregaokar [Thu, 12 Nov 2015 07:48:51 +0000 (13:18 +0530)]
Rollup merge of #29776 - nikomatsakis:mir-29740, r=nrc

In previous PRs, I changed the match desugaring to generate more efficient code for ints/chars and the like. But this doesn't help when you're matching strings, ranges, or other crazy complex things (leading to #29740). This commit restructures match desugaring *yet again* to handle that case better -- basically we now degenerate to an if-else-if chain in such cases.

~~Note that this builds on https://github.com/rust-lang/rust/pull/29763 which will hopefully land soon. So ignore the first few commits.~~ landed now

r? @Aatch since he's been reviewing the other commits in this series

8 years agoRemove impls for cases considered `niche`
Alexander Bulaev [Thu, 12 Nov 2015 07:40:02 +0000 (10:40 +0300)]
Remove impls for cases considered `niche`

8 years agotrpl: add a small section outlining doctest configuration
Kevin Butler [Tue, 3 Nov 2015 16:42:25 +0000 (16:42 +0000)]
trpl: add a small section outlining doctest configuration

8 years agolibtest: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:37:29 +0000 (16:37 +0000)]
libtest: deny warnings in doctests

8 years agolibterm: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:35:33 +0000 (16:35 +0000)]
libterm: deny warnings in doctests

8 years agolibsyntax: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:34:11 +0000 (16:34 +0000)]
libsyntax: deny warnings in doctests

8 years agolibserialize: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:17:57 +0000 (16:17 +0000)]
libserialize: deny warnings in doctests

8 years agolibrustc_unicode: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:12:25 +0000 (16:12 +0000)]
librustc_unicode: deny warnings in doctests

8 years agolibrbml: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:06:02 +0000 (16:06 +0000)]
librbml: deny warnings in doctests

8 years agolibrand: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:04:40 +0000 (16:04 +0000)]
librand: deny warnings in doctests

8 years agoliblog: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 16:03:06 +0000 (16:03 +0000)]
liblog: deny warnings in doctests

8 years agolibgraphviz: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 15:33:58 +0000 (15:33 +0000)]
libgraphviz: deny warnings in doctests

8 years agolibgetopts: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 15:32:48 +0000 (15:32 +0000)]
libgetopts: deny warnings in doctests

8 years agolibfmt_macros: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 15:30:14 +0000 (15:30 +0000)]
libfmt_macros: deny warnings in doctests

8 years agolibflate: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 15:28:58 +0000 (15:28 +0000)]
libflate: deny warnings in doctests

8 years agolibcore: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 15:27:03 +0000 (15:27 +0000)]
libcore: deny warnings in doctests

8 years agolibcollections: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 14:49:33 +0000 (14:49 +0000)]
libcollections: deny warnings in doctests

8 years agolibarena: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 14:03:22 +0000 (14:03 +0000)]
libarena: deny warnings in doctests

8 years agoliballoc: deny warnings in doctests
Kevin Butler [Tue, 3 Nov 2015 14:02:48 +0000 (14:02 +0000)]
liballoc: deny warnings in doctests

8 years agoAuto merge of #29764 - nrc:stats, r=nikomatsakis
bors [Thu, 12 Nov 2015 04:06:48 +0000 (04:06 +0000)]
Auto merge of #29764 - nrc:stats, r=nikomatsakis

Emits loc, and node count - before and after expansion.

E.g.,

```
rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
Lines of code:             32060
Pre-expansion node count:  120205
Post-expansion node count: 482749
```

r? @nikomatsakis

8 years agoAuto merge of #29616 - nagisa:mir-repeat, r=nikomatsakis
bors [Thu, 12 Nov 2015 02:24:06 +0000 (02:24 +0000)]
Auto merge of #29616 - nagisa:mir-repeat, r=nikomatsakis

r? @nikomatsakis

I went ahead and replaced repeat count with a `Constant`, because it cannot be non-constant to the best of my knowledge.

8 years agoignore pretty since it dies for some mysterious reason I can't be
Niko Matsakis [Wed, 11 Nov 2015 23:54:37 +0000 (18:54 -0500)]
ignore pretty since it dies for some mysterious reason I can't be
bothered to track down for a regresson test. /me hopes no one notices

8 years agoAuto merge of #29748 - petrochenkov:issue29746, r=nrc
bors [Wed, 11 Nov 2015 23:31:51 +0000 (23:31 +0000)]
Auto merge of #29748 - petrochenkov:issue29746, r=nrc

Closes https://github.com/rust-lang/rust/issues/29746

8 years agoConst-eval array element repetition count
Simonas Kazlauskas [Wed, 11 Nov 2015 15:58:41 +0000 (17:58 +0200)]
Const-eval array element repetition count

8 years agoFix article in Result.map and Result.map_err documentation
Danilo Bargen [Wed, 11 Nov 2015 23:01:55 +0000 (00:01 +0100)]
Fix article in Result.map and Result.map_err documentation

8 years agoFix hygiene regression in patterns
Vadim Petrochenkov [Tue, 10 Nov 2015 21:01:25 +0000 (00:01 +0300)]
Fix hygiene regression in patterns

8 years agoAdd test for assert_eq! with none Sized types
Oliver Middleton [Wed, 11 Nov 2015 22:08:20 +0000 (22:08 +0000)]
Add test for assert_eq! with none Sized types

8 years agoFix import warnings for stage0
Steve Klabnik [Wed, 11 Nov 2015 21:59:57 +0000 (16:59 -0500)]
Fix import warnings for stage0

8 years agoClean up the prelude docs
Steve Klabnik [Wed, 11 Nov 2015 20:22:23 +0000 (15:22 -0500)]
Clean up the prelude docs

This mostly brings them in line with existing linking convention, but
also has some minor re-wording.

The text at the top has been re-focused, by starting out with what the
prelude does, rather than starting from injecting std.

Also, it now mentions that other preludes exist.

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

8 years agoRewrite match algorithm to avoid massive blowup in generated code for
Niko Matsakis [Wed, 11 Nov 2015 17:54:02 +0000 (12:54 -0500)]
Rewrite match algorithm to avoid massive blowup in generated code for
large matches that fallback to Eq. When we encounter a case where the
test being performed does not inform the candidate at all, we just stop
testing the candidates at that point, rather than adding the candidate
to both outcomes. The former behavior was not WRONG, but it generated a
lot of code, whereas this new behavior degenerates to an if-else-if
tree.

Fixes #29740.

8 years agoAuto merge of #29778 - Manishearth:rollup, r=Manishearth
bors [Wed, 11 Nov 2015 20:39:49 +0000 (20:39 +0000)]
Auto merge of #29778 - Manishearth:rollup, r=Manishearth

- Successful merges: #29677, #29772, #29775, #29777
- Failed merges:

8 years agoFixup tidy
Manish Goregaokar [Wed, 11 Nov 2015 20:38:37 +0000 (02:08 +0530)]
Fixup tidy

8 years agoAdd -Zinput-stats
Nick Cameron [Wed, 11 Nov 2015 05:26:14 +0000 (18:26 +1300)]
Add -Zinput-stats

Emits loc, and node count - before and after expansion.

E.g.,

```
rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
Lines of code:             32060
Pre-expansion node count:  120205
Post-expansion node count: 482749
```

8 years agolibsyntax: Add more quasiquoting macros
Kyle Mayes [Wed, 11 Nov 2015 20:19:01 +0000 (15:19 -0500)]
libsyntax: Add more quasiquoting macros

8 years agoRollup merge of #29777 - Manishearth:const_irrefutable_diag, r=eddyb
Manish Goregaokar [Wed, 11 Nov 2015 19:29:31 +0000 (00:59 +0530)]
Rollup merge of #29777 - Manishearth:const_irrefutable_diag, r=eddyb

None

8 years agoRollup merge of #29775 - arcnmx:raw-c_char, r=alexcrichton
Manish Goregaokar [Wed, 11 Nov 2015 19:29:30 +0000 (00:59 +0530)]
Rollup merge of #29775 - arcnmx:raw-c_char, r=alexcrichton

It's a bit strange to expect users of `libstd` to require the use of an external crates.io crate to work with standard types. This commit encourages the use `os::raw::c_char` instead, although users are certainly free to use `libc::c_char` if they wish; the test still exists to ensure the two types are identical (though the reported bug only exists on platforms that are not officially tested).

Fixes #29774

8 years agoRollup merge of #29772 - banyan:fix-doc, r=steveklabnik
Manish Goregaokar [Wed, 11 Nov 2015 19:29:30 +0000 (00:59 +0530)]
Rollup merge of #29772 - banyan:fix-doc, r=steveklabnik

8 years agoRollup merge of #29677 - GuillaumeGomez:patch-3, r=Manishearth
Manish Goregaokar [Wed, 11 Nov 2015 19:29:30 +0000 (00:59 +0530)]
Rollup merge of #29677 - GuillaumeGomez:patch-3, r=Manishearth

r? @Manishearth
cc @AlisdairO

Part of #24407

8 years agoCleaner c_char cfg logic
arcnmx [Wed, 11 Nov 2015 19:25:18 +0000 (14:25 -0500)]
Cleaner c_char cfg logic

8 years agoAdd test for constant pattern diagnostics
Manish Goregaokar [Wed, 11 Nov 2015 19:18:02 +0000 (00:48 +0530)]
Add test for constant pattern diagnostics

8 years agoAdd more comprehensive diagnostics for irrefutable pattern error with constants
Manish Goregaokar [Wed, 11 Nov 2015 19:16:57 +0000 (00:46 +0530)]
Add more comprehensive diagnostics for irrefutable pattern error with constants

Fixes #7526

8 years agopass stdc++ library path after LVVM library path
Sébastien Marie [Wed, 11 Nov 2015 19:16:17 +0000 (20:16 +0100)]
pass stdc++ library path after LVVM library path

under openbsd, the library path of libstdc++ need to be explicit (due
to the fact the default linker `cc` is gcc-4.2, and not gcc-4.9).

but when a recent LLVM is installed, rustc compilation pikes the bad
LLVM version (which live in /usr/local/lib, which is same directory of
libestdc++.so for gcc-4.9).

this patch move the libstdc++ path from RUST_FLAGS_<target> to special
variable, and use it *after* LLVM_LIBDIR_RUSTFLAGS_<target> in
arguments.

8 years agoPrefer raw::c_char or libc::c_char and fix arm
arcnmx [Wed, 11 Nov 2015 17:02:55 +0000 (12:02 -0500)]
Prefer raw::c_char or libc::c_char and fix arm

8 years agoAuto merge of #29763 - nikomatsakis:mir-29227, r=nikomatsakis
bors [Wed, 11 Nov 2015 16:50:48 +0000 (16:50 +0000)]
Auto merge of #29763 - nikomatsakis:mir-29227, r=nikomatsakis

The older algorithm was pretty inefficient for big matches. Fixes #29227. (On my computer, MIR construction on this test case goes from 9.9s to 0.025s.) Whereas before we had a loop like:

- for all outcomes of the test we are performing
    - for all candidates
        - check whether candidate is relevant to outcome

We now do:

- for all candidates
    - determine which outcomes the candidate is relevant to

Since the number of outcomes in this case is proportional to the number of candidates, the original algorithm turned out to be O(n^2), and the newer one is just O(n).

This PR also does some minor speedups by eagerly mirroring all patterns, so that we can just pass around `&Pattern<'tcx>`, which makes cloning cheaper. We could probably go a bit further in this direction.

r? @Aatch

8 years agodocs: Fix variable name
Kohei Hasegawa [Wed, 11 Nov 2015 15:47:42 +0000 (00:47 +0900)]
docs: Fix variable name

8 years agoAllow none Sized types in assert_eq!
Oliver Middleton [Wed, 11 Nov 2015 14:25:08 +0000 (14:25 +0000)]
Allow none Sized types in assert_eq!

format_args! doesn't support none Sized types so we should just pass it the references to left_val and right_val.

This fixes `assert_eq!([1, 2, 3][..], vec![1, 2, 3][..])` for example.

8 years agoAuto merge of #29650 - goyox86:goyox86/rustfmting-librustc_driverII, r=nikomatsakis
bors [Wed, 11 Nov 2015 14:14:23 +0000 (14:14 +0000)]
Auto merge of #29650 - goyox86:goyox86/rustfmting-librustc_driverII, r=nikomatsakis

Hi Rustaceans!

This is the secong take on running latest rustfmt on librustc_driver!

All fixups made in https://github.com/rust-lang/rust/pull/29033 were done (also rustfmt got better).

//cc @nrc

8 years agoIgnore long lines on this test.
Niko Matsakis [Wed, 11 Nov 2015 14:02:24 +0000 (09:02 -0500)]
Ignore long lines on this test.

8 years agoChange from `&mut Vec<Vec<_>>` to `&mut [Vec<_>]`, since the outer
Niko Matsakis [Wed, 11 Nov 2015 10:33:16 +0000 (05:33 -0500)]
Change from `&mut Vec<Vec<_>>` to `&mut [Vec<_>]`, since the outer
`Vec` should not be resized.

8 years agoAuto merge of #29755 - mbrubeck:stat-doc, r=steveklabnik
bors [Wed, 11 Nov 2015 11:09:43 +0000 (11:09 +0000)]
Auto merge of #29755 - mbrubeck:stat-doc, r=steveklabnik

Moved from #29753. r? @steveklabnik

8 years agoAuto merge of #29741 - Manishearth:fix-flowgraph, r=alexcrichton
bors [Wed, 11 Nov 2015 09:15:24 +0000 (09:15 +0000)]
Auto merge of #29741 - Manishearth:fix-flowgraph, r=alexcrichton

None

8 years agoAuto merge of #29752 - tamird:fix-compiletest-stage1, r=alexcrichton
bors [Wed, 11 Nov 2015 07:29:54 +0000 (07:29 +0000)]
Auto merge of #29752 - tamird:fix-compiletest-stage1, r=alexcrichton

Fixes #29751.

8 years agoAuto merge of #29744 - sanxiyn:modernize, r=nrc
bors [Wed, 11 Nov 2015 05:47:13 +0000 (05:47 +0000)]
Auto merge of #29744 - sanxiyn:modernize, r=nrc

8 years agoAuto merge of #29738 - sanxiyn:suggest-mut, r=nrc
bors [Wed, 11 Nov 2015 04:04:31 +0000 (04:04 +0000)]
Auto merge of #29738 - sanxiyn:suggest-mut, r=nrc

Fix #16410.

8 years agoAdd regression test for #29227.
Niko Matsakis [Wed, 11 Nov 2015 03:19:17 +0000 (22:19 -0500)]
Add regression test for #29227.

8 years agoReorganize match construction to be O(n) instead of O(n^2). Whereas
Niko Matsakis [Tue, 10 Nov 2015 22:11:39 +0000 (17:11 -0500)]
Reorganize match construction to be O(n) instead of O(n^2). Whereas
before we iterated over the test and each outcome thereof, and then
checked processed every candidate against this outcome, we now organize
the walk differently. Instead, we visit each candidate and say "Here is
the test being performed. Figure out the resulting candidates for each
possible outcome and add yourself into the appropriate places."

8 years agoClone the candidates and match-pairs lazilly, instead of eagerly.
Niko Matsakis [Tue, 10 Nov 2015 10:24:25 +0000 (05:24 -0500)]
Clone the candidates and match-pairs lazilly, instead of eagerly.

8 years agoRemove the mirroring for patterns and just convert them eagerly; then,
Niko Matsakis [Tue, 10 Nov 2015 01:54:17 +0000 (20:54 -0500)]
Remove the mirroring for patterns and just convert them eagerly; then,
pass around references instead of boxed values to save on clone costs.

8 years agoAuto merge of #29727 - alexcrichton:debug-unused-result, r=sfackler
bors [Wed, 11 Nov 2015 02:08:08 +0000 (02:08 +0000)]
Auto merge of #29727 - alexcrichton:debug-unused-result, r=sfackler

This should help avoid triggering the unused_results lint which can frequently
be turned on.

Closes #29710

8 years agoAuto merge of #29726 - petrochenkov:privsan, r=alexcrichton
bors [Wed, 11 Nov 2015 00:25:08 +0000 (00:25 +0000)]
Auto merge of #29726 - petrochenkov:privsan, r=alexcrichton

- Check privacy sanity in all blocks, not only function bodies
- Check all fields, not only named
- Check all impl items, not only methods
- Check default impls
- Move the sanity check in the beginning of privacy checking, so others could rely on it

Technically it's a [breaking-change], but I expect no breakage because, well, it's *sane* privacy visitor, if code is broken it must be insane by definition!

8 years agoRename _nopanic methods to remove the suffix.
Eli Friedman [Wed, 11 Nov 2015 00:08:26 +0000 (16:08 -0800)]
Rename _nopanic methods to remove the suffix.

Just `sed s/_nopanic//g`.  Hopefully makes libsyntax a bit more
readable.

8 years agoSimplify trans/exprs.rs DefStatic considerably
Simonas Kazlauskas [Tue, 10 Nov 2015 22:19:37 +0000 (00:19 +0200)]
Simplify trans/exprs.rs DefStatic considerably

8 years agoAuto merge of #29725 - aturon:lang-features, r=huonw
bors [Tue, 10 Nov 2015 22:41:49 +0000 (22:41 +0000)]
Auto merge of #29725 - aturon:lang-features, r=huonw

This commit adds issue numbers to the vast majority of active feature
gates. The few that are left without issues are rustc/runtime-internal
features that are essentially private APIs.

Closes #28244

r? @huonw

8 years ago[MIR trans] Translate statics
Simonas Kazlauskas [Tue, 10 Nov 2015 21:22:57 +0000 (23:22 +0200)]
[MIR trans] Translate statics

Fixes #29578

8 years agouse Constant for repetition count in mir::Repeat
Simonas Kazlauskas [Tue, 10 Nov 2015 21:52:23 +0000 (23:52 +0200)]
use Constant for repetition count in mir::Repeat

8 years agoAuto merge of #29724 - alexcrichton:ip-endian, r=aturon
bors [Tue, 10 Nov 2015 20:58:51 +0000 (20:58 +0000)]
Auto merge of #29724 - alexcrichton:ip-endian, r=aturon

The comparison of IP addresses should happen not always in network endianness
but rather in the host endianness format, so be sure to convert to that before
comparing addresses.

There are still locations where the endianness will factor into visible
properties, such as the hash, but these are not important to be independent of
the endianness in play (as hash values are pretty undefined anyway.

Closes #29691

8 years agoManual fixups.
Jose Narvaez [Tue, 10 Nov 2015 20:49:12 +0000 (20:49 +0000)]
Manual fixups.

8 years agoRustfmting librustc_driver.
Jose Narvaez [Tue, 10 Nov 2015 20:48:44 +0000 (20:48 +0000)]
Rustfmting librustc_driver.

8 years ago[docs] Update references to renamed fs::stat function
Matt Brubeck [Tue, 10 Nov 2015 19:17:26 +0000 (11:17 -0800)]
[docs] Update references to renamed fs::stat function