]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoDoubleEndedIterator for Args
Sebastian Thiel [Sat, 30 Apr 2016 14:37:44 +0000 (16:37 +0200)]
DoubleEndedIterator for Args

The number of arguments given to a process is always known, which
makes implementing DoubleEndedIterator possible.

That way, the Iterator::rev() method becomes usable, among others.

Signed-off-by: Sebastian Thiel <byronimo@gmail.com>
Tidy for DoubleEndedIterator

I chose to not create a new feature for it, even though
technically, this makes me lie about the original availability
of the implementation.

Verify with @alexchrichton

Setup feature flag for new std::env::Args iterators

Add test for Args reverse iterator

It's somewhat depending on the input of the test program,
but made in such a way that should be somewhat flexible to changes
to the way it is called.

Deduplicate windows ArgsOS code for DEI

DEI = DoubleEndedIterator

Move env::args().rev() test to run-pass

It must be controlling it's arguments for full isolation.

Remove superfluous feature name

Assert all arguments returned by env::args().rev()

Let's be very sure it works as we expect, why take chances.

Fix rval of os_string_from_ptr

A trait cannot be returned, but only the corresponding object.

Deref pointers to actually operate on the argument

Put unsafe to correct location

8 years agoAuto merge of #33853 - alexcrichton:remove-deprecated, r=aturon
bors [Wed, 1 Jun 2016 22:11:38 +0000 (15:11 -0700)]
Auto merge of #33853 - alexcrichton:remove-deprecated, r=aturon

std: Clean out old unstable + deprecated APIs

These should all have been deprecated for at least one cycle, so this commit
cleans them all out.

8 years agoAuto merge of #33814 - lambda:rtabort-use-platform-abort, r=alexcrichton
bors [Wed, 1 Jun 2016 17:21:55 +0000 (10:21 -0700)]
Auto merge of #33814 - lambda:rtabort-use-platform-abort, r=alexcrichton

Open code the __fastfail intrinsic for rtabort! on windows

As described https://msdn.microsoft.com/en-us/library/dn774154.aspx

This is a Windows 8+ mechanism for terminating the process quickly,
which degrades to either an access violation or bugcheck in older versions.

I'm not sure this is better the the current mechanism of terminating
with an illegal instruction, but we recently converted unix to
terminate more correctly with SIGABORT, and this *seems* more correct
for windows.

[breaking-change]

8 years agoAuto merge of #33794 - petrochenkov:sanity, r=nrc
bors [Wed, 1 Jun 2016 13:21:53 +0000 (06:21 -0700)]
Auto merge of #33794 - petrochenkov:sanity, r=nrc

Add AST validation pass and move some checks to it

The purpose of this pass is to catch constructions that fit into AST data structures, but not permitted by the language. As an example, `impl`s don't have visibilities, but for convenience and uniformity with other items they are represented with a structure `Item` which has `Visibility` field.

This pass is intended to run after expansion of macros and syntax extensions (and before lowering to HIR), so it can catch erroneous constructions that were generated by them. This pass allows to remove ad hoc semantic checks from the parser, which can be overruled by syntax extensions and occasionally macros.

The checks can be put here if they are simple, local, don't require results of any complex analysis like name resolution or type checking and maybe don't logically fall into other passes. I expect most of errors generated by this pass to be non-fatal and allowing the compilation to proceed.

I intend to move some more checks to this pass later and maybe extend it with new checks, like, for example, identifier validity. Given that syntax extensions are going to be stabilized in the measurable future, it's important that they would not be able to subvert usual language rules.

In this patch I've added two new checks - a check for labels named `'static` and a check for lifetimes and labels named `'_`. The first one gives a hard error, the second one - a future compatibility warning.
Fixes https://github.com/rust-lang/rust/issues/33059 ([breaking-change])
cc https://github.com/rust-lang/rfcs/pull/1177

r? @nrc

8 years agoAuto merge of #34004 - Manishearth:rollup, r=Manishearth
bors [Wed, 1 Jun 2016 07:28:44 +0000 (00:28 -0700)]
Auto merge of #34004 - Manishearth:rollup, r=Manishearth

Rollup of 11 pull requests

- Successful merges: #33385, #33606, #33841, #33892, #33896, #33915, #33921, #33967, #33970, #33973, #33977
- Failed merges:

8 years agoRollup merge of #33977 - Ms2ger:create-and-enter, r=nrc
Manish Goregaokar [Wed, 1 Jun 2016 07:27:42 +0000 (12:57 +0530)]
Rollup merge of #33977 - Ms2ger:create-and-enter, r=nrc

Take the def_map argument to TyCtxt::create_and_enter out of its RefCell.

8 years agoRollup merge of #33973 - zackmdavis:stable_features_warning_notes_version_stabilized...
Manish Goregaokar [Wed, 1 Jun 2016 07:27:42 +0000 (12:57 +0530)]
Rollup merge of #33973 - zackmdavis:stable_features_warning_notes_version_stabilized, r=brson

stable features lint warning mentions version stabilized

To accomplish this, we alter the checks in `rustc::middle::stability` to
use the `StabilityLevel` defined in `syntax::attr` (which includes the
version in which the feature was stabilized) rather than the local
`StabilityLevel` in the same module, and make the
`declared_stable_lang_features` field of
`syntax::feature_gate::Features` hold a Vec of feature-name, span
tuples (in analogy to the `declared_lib_features` field) rather than
just spans.

Fixes #33394.

![stable_features_version_lint_before_and_after](https://cloud.githubusercontent.com/assets/1076988/15659237/5d952a3a-267c-11e6-9181-c9e612eefd7d.png)

r? @brson (tagging Brian because he [wrote](https://github.com/rust-lang/rust/pull/21958) the lint)

8 years agoRollup merge of #33970 - arielb1:normal-type-check, r=eddyb
Manish Goregaokar [Wed, 1 Jun 2016 07:27:42 +0000 (12:57 +0530)]
Rollup merge of #33970 - arielb1:normal-type-check, r=eddyb

normalize types in MIR typeck after erasing regions

this fixes the MIR bug @frankmcsherry encountered.

r? @eddyb

8 years agoRollup merge of #33967 - dsprenkels:enum_pattern_resolve_ice, r=petrochenkov
Manish Goregaokar [Wed, 1 Jun 2016 07:27:42 +0000 (12:57 +0530)]
Rollup merge of #33967 - dsprenkels:enum_pattern_resolve_ice, r=petrochenkov

resolve: record pattern def when `resolve_pattern` returns `Err(true)`

I propose a fix for issue #33293.

In 1a374b8, (pr #33046) fixed the error reporting of a specific case, but the change that was introduced did not make sure that `record_def` was called in all cases, which lead to an ICE in [1].
This change restores the original `else` case, but keeps the changes that were committed in 1a374b8.

[1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`

8 years agoRollup merge of #33921 - jameysharp:patch-1, r=alexcrichton
Manish Goregaokar [Wed, 1 Jun 2016 07:27:42 +0000 (12:57 +0530)]
Rollup merge of #33921 - jameysharp:patch-1, r=alexcrichton

Inline simple Cursor write calls

Implementing the Write trait for Cursors over slices is so light-weight that under some circumstances multiple writes can be fused into a single instruction. In general I think inlining these functions is a good idea because most of the code can be constant-folded and copy-propagated away.

Closes issue #33916.

r? @alexcrichton

8 years agoRollup merge of #33915 - GuillaumeGomez:err-codes, r=steveklabnik
Manish Goregaokar [Wed, 1 Jun 2016 07:27:41 +0000 (12:57 +0530)]
Rollup merge of #33915 - GuillaumeGomez:err-codes, r=steveklabnik

Add new error code tests

r? @steveklabnik

8 years agoRollup merge of #33896 - strake:next_code_point, r=aturon
Manish Goregaokar [Wed, 1 Jun 2016 07:27:41 +0000 (12:57 +0530)]
Rollup merge of #33896 - strake:next_code_point, r=aturon

make core::str::next_code_point work on arbitrary iterator

8 years agoRollup merge of #33892 - seanmonstar:slice-eq-ptr, r=alexcrichton
Manish Goregaokar [Wed, 1 Jun 2016 07:27:41 +0000 (12:57 +0530)]
Rollup merge of #33892 - seanmonstar:slice-eq-ptr, r=alexcrichton

core: check pointer equality when comparing byte slices

If pointer address and length are the same, it should be the same slice.

In experiments, I've seen that this doesn't happen as often in debug builds, but release builds seem to optimize to using a single pointer more often.

8 years agoRollup merge of #33841 - LeoTestard:macro-sequence-lhs, r=pnkfelix
Manish Goregaokar [Wed, 1 Jun 2016 07:27:41 +0000 (12:57 +0530)]
Rollup merge of #33841 - LeoTestard:macro-sequence-lhs, r=pnkfelix

Reject a LHS formed of a single sequence TT during `macro_rules!` checking.

This was already rejected during expansion. Encountering malformed LHS or RHS during expansion is now considered a bug.

Follow up to #33689.

r? @pnkfelix

Note: this can break code that defines such macros but does not use them.

8 years agoRollup merge of #33606 - tshepang:future-talk, r=brson
Manish Goregaokar [Wed, 1 Jun 2016 07:27:41 +0000 (12:57 +0530)]
Rollup merge of #33606 - tshepang:future-talk, r=brson

doc: format! may or may not handle streams in future

No need to talk about that here

8 years agoRollup merge of #33385 - cheercroaker:doc-correction, r=brson
Manish Goregaokar [Wed, 1 Jun 2016 07:27:40 +0000 (12:57 +0530)]
Rollup merge of #33385 - cheercroaker:doc-correction, r=brson

Mention initial year of publication only for the documentation copyright

I have corrected the "copyright expiration year" that was still 2015 in the documentation copyright notice.

According to #31007 it seems that we could go one step further and simplify the copyright notice to only mention the year of original publication ("Copyright &copy; 2011" in this case).

Let me know if you would prefer this copyright notice to only mention the year of original publication (please make sure that it is really 2011 as stated in the current version of the documentation, and not 2010 like Rust's code) and I'll make the simplification.

8 years agoAuto merge of #33141 - tshepang:python-love, r=brson
bors [Wed, 1 Jun 2016 04:37:42 +0000 (21:37 -0700)]
Auto merge of #33141 - tshepang:python-love, r=brson

some Python nits and fixes

8 years agoAuto merge of #33979 - retep998:why-the-long-face, r=alexcrichton
bors [Wed, 1 Jun 2016 01:49:48 +0000 (18:49 -0700)]
Auto merge of #33979 - retep998:why-the-long-face, r=alexcrichton

Attempt to diagnose #33844

https://github.com/rust-lang/rust/issues/33844 is a spurious failure that causes builds to fail due to the linker command sometimes failing with error 206, which means that the command is too long. This PR makes rustc print out the linker arguments in that case so the reason for it being so long can be diagnosed and hopefully fixed.

r? @alexcrichton

8 years agoAuto merge of #33857 - alexcrichton:new-stage0, r=nikomatsakis
bors [Tue, 31 May 2016 23:12:16 +0000 (16:12 -0700)]
Auto merge of #33857 - alexcrichton:new-stage0, r=nikomatsakis

mk: Prepare for a new stage0 compiler

This commit prepares the source for a new stage0 compiler, the 1.10.0 beta
compiler. These artifacts are hot off the bots and should be ready to go.

8 years agomk: Prepare for a new stage0 compiler
Alex Crichton [Tue, 24 May 2016 05:28:15 +0000 (22:28 -0700)]
mk: Prepare for a new stage0 compiler

This commit prepares the source for a new stage0 compiler, the 1.10.0 beta
compiler. These artifacts are hot off the bots and should be ready to go.

8 years agoPrint linker arguments if calling the linker fails
Peter Atashian [Tue, 31 May 2016 20:14:34 +0000 (16:14 -0400)]
Print linker arguments if calling the linker fails
Needed to diagnose https://github.com/rust-lang/rust/issues/33844

Signed-off-by: Peter Atashian <retep998@gmail.com>
8 years agonormalize types in MIR typeck after erasing regions
Ariel Ben-Yehuda [Mon, 30 May 2016 18:41:05 +0000 (21:41 +0300)]
normalize types in MIR typeck after erasing regions

8 years agoTake the def_map argument to TyCtxt::create_and_enter out of its RefCell.
Ms2ger [Tue, 31 May 2016 07:21:49 +0000 (09:21 +0200)]
Take the def_map argument to TyCtxt::create_and_enter out of its RefCell.

8 years agoAuto merge of #33960 - tbu-:pr_ref_clone_overflow, r=Aatch
bors [Tue, 31 May 2016 06:09:00 +0000 (23:09 -0700)]
Auto merge of #33960 - tbu-:pr_ref_clone_overflow, r=Aatch

Prevent the borrow counter from overflowing in `Ref::clone`

Fixes #33880.

8 years agostd: Clean out old unstable + deprecated APIs
Alex Crichton [Tue, 24 May 2016 21:24:44 +0000 (14:24 -0700)]
std: Clean out old unstable + deprecated APIs

These should all have been deprecated for at least one cycle, so this commit
cleans them all out.

8 years agoAuto merge of #33968 - srinivasreddy:slice.rs, r=Manishearth
bors [Mon, 30 May 2016 23:34:34 +0000 (16:34 -0700)]
Auto merge of #33968 - srinivasreddy:slice.rs, r=Manishearth

Correct grammar; and remove redundant comment

8 years agostable features lint warning mentions version stabilized
Zack M. Davis [Mon, 30 May 2016 20:55:12 +0000 (13:55 -0700)]
stable features lint warning mentions version stabilized

To accomplish this, we alter the checks in `rustc::middle::stability` to
use the `StabilityLevel` defined in `syntax::attr` (which includes the
version in which the feature was stabilized) rather than the local
`StabilityLevel` in the same module, and make the
`declared_stable_lang_features` field of
`syntax::feature_gate::Features` hold a Vec of feature-name, span
tuples (in analogy to the `declared_lib_features` field) rather than
just spans.

This is in the matter of issue #33394.

8 years agoAuto merge of #33909 - michaelwoerister:frame-pointer-fix, r=nikomatsakis
bors [Mon, 30 May 2016 18:01:55 +0000 (11:01 -0700)]
Auto merge of #33909 - michaelwoerister:frame-pointer-fix, r=nikomatsakis

Emit "no-frame-pointer-elim" attribute for closures, shims, and glue.

This will hopefully let `perf` give better backtraces.
r? @nikomatsakis

8 years agoCorrect grammar; and remove redundant comment
Srinivas Reddy Thatiparthy [Mon, 30 May 2016 17:05:41 +0000 (22:35 +0530)]
Correct grammar; and remove redundant comment

8 years agolibrustc_resolve: make sure pattern def gets recorded if `resolve_path` returns ...
Daan Sprenkels [Mon, 30 May 2016 12:54:22 +0000 (14:54 +0200)]
librustc_resolve: make sure pattern def gets recorded if `resolve_path` returns `Err(true)`

In 1a374b8, (pr #33046) fixed the error reporting of a specific
case, but the change that was introduced did not make sure that
`record_def` was called in all cases, which lead to an ICE in [1].
This change restores the original `else` case, but keeps the changes
that were committed in 1a374b8.

This commit fixes issue #33293.

[1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`

8 years agoAuto merge of #33965 - Manishearth:rollup, r=Manishearth
bors [Mon, 30 May 2016 15:13:08 +0000 (08:13 -0700)]
Auto merge of #33965 - Manishearth:rollup, r=Manishearth

Rollup of 5 pull requests

- Successful merges: #33867, #33926, #33942, #33958, #33964
- Failed merges:

8 years agoRollup merge of #33964 - Ms2ger:refcell-resolutions, r=Manishearth
Manish Goregaokar [Mon, 30 May 2016 15:05:47 +0000 (20:35 +0530)]
Rollup merge of #33964 - Ms2ger:refcell-resolutions, r=Manishearth

Move driver::Resolutions::def_map out of its RefCell.

8 years agoRollup merge of #33958 - kennytm:patch-1, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 15:05:47 +0000 (20:35 +0530)]
Rollup merge of #33958 - kennytm:patch-1, r=GuillaumeGomez

Use Path::is_dir() in fs::read_dir()'s example.

Basically reverts #25508. The `is_dir()` function has been stable since 1.5.0.

8 years agoRollup merge of #33942 - srinivasreddy:rustfmt_llvm_folder, r=nrc
Manish Goregaokar [Mon, 30 May 2016 15:05:46 +0000 (20:35 +0530)]
Rollup merge of #33942 - srinivasreddy:rustfmt_llvm_folder, r=nrc

run rustfmt on librustc_llvm folder

8 years agoRollup merge of #33926 - jseyfried:fix_derive_span, r=nrc
Manish Goregaokar [Mon, 30 May 2016 15:05:46 +0000 (20:35 +0530)]
Rollup merge of #33926 - jseyfried:fix_derive_span, r=nrc

Fix the span of generated `#[derive_*]` attributes

Fixes #33571.
r? @nrc

8 years agoRollup merge of #33867 - oli-obk:rustdoc_variant_types, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 15:05:46 +0000 (20:35 +0530)]
Rollup merge of #33867 - oli-obk:rustdoc_variant_types, r=GuillaumeGomez

print enum variant fields in docs

Right now we are repeating enum variants at the top, because the fields aren't shown with the actual docs. It's very annoying to have to scroll up and down to have both docs and field info. For struct variants we already list the fields.

enum docs look like this after this PR:

![screenshot from 2016-05-25 14-02-42](https://cloud.githubusercontent.com/assets/332036/15539231/84b018cc-2281-11e6-9666-1063655931f4.png)

There are degenerate cases for enum tuple variants with lots of fields:

![screenshot from 2016-05-25 14-01-00](https://cloud.githubusercontent.com/assets/332036/15539260/91e537ca-2281-11e6-8bf1-a3d6b2e78f65.png)

I was thinking that we could move the docs below the variant (slightly indented) or list the variant fields vertically instead of horizontally

r? @steveklabnik

8 years agoprint enum variant fields in docs
Oliver Schneider [Fri, 27 May 2016 10:04:56 +0000 (12:04 +0200)]
print enum variant fields in docs

8 years agoMove driver::Resolutions::def_map out of its RefCell.
Ms2ger [Mon, 30 May 2016 13:17:16 +0000 (15:17 +0200)]
Move driver::Resolutions::def_map out of its RefCell.

8 years agoAuto merge of #33959 - Manishearth:rollup, r=Manishearth
bors [Mon, 30 May 2016 09:54:00 +0000 (02:54 -0700)]
Auto merge of #33959 - Manishearth:rollup, r=Manishearth

Rollup of 8 pull requests

- Successful merges: #33793, #33893, #33912, #33913, #33914, #33917, #33937, #33938
- Failed merges:

8 years agoRollup merge of #33938 - srinivasreddy:rustfmt_libunwind, r=Manishearth
Manish Goregaokar [Mon, 30 May 2016 09:49:01 +0000 (15:19 +0530)]
Rollup merge of #33938 - srinivasreddy:rustfmt_libunwind, r=Manishearth

run rustfmt on libunwind

8 years agoRollup merge of #33937 - srinivasreddy:rustfmt_librand, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 09:49:01 +0000 (15:19 +0530)]
Rollup merge of #33937 - srinivasreddy:rustfmt_librand, r=GuillaumeGomez

run rustfmt on librand folder

8 years agoRollup merge of #33917 - srinivasreddy:rustfmt_liballoc, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 09:49:00 +0000 (15:19 +0530)]
Rollup merge of #33917 - srinivasreddy:rustfmt_liballoc, r=GuillaumeGomez

rustfmt liballoc folder

8 years agoRollup merge of #33914 - GuillaumeGomez:improve_err_expl, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 09:49:00 +0000 (15:19 +0530)]
Rollup merge of #33914 - GuillaumeGomez:improve_err_expl, r=GuillaumeGomez

Improve err expl

r? @steveklabnik

8 years agoRollup merge of #33913 - GuillaumeGomez:improve_e0133, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 09:49:00 +0000 (15:19 +0530)]
Rollup merge of #33913 - GuillaumeGomez:improve_e0133, r=GuillaumeGomez

Improve E0133 error explanation

r? @steveklabnik

8 years agoRollup merge of #33912 - GuillaumeGomez:improve_E0132, r=steveklabnik
Manish Goregaokar [Mon, 30 May 2016 09:49:00 +0000 (15:19 +0530)]
Rollup merge of #33912 - GuillaumeGomez:improve_E0132, r=steveklabnik

Improve E0132 error explanation

r? @steveklabnik

8 years agoRollup merge of #33893 - Ophirr33:docs_string_split_fix, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 09:49:00 +0000 (15:19 +0530)]
Rollup merge of #33893 - Ophirr33:docs_string_split_fix, r=GuillaumeGomez

Added examples/docs to split in str.rs

Added documentation clarifying the behavior of split when used with the empty string and contiguous separators. Addresses issue [33882](https://github.com/rust-lang/rust/issues/33882). This is my first time contributing to rust, so forgive me if I'm skipping any of the contribution steps.
Fixes #33882

8 years agoRollup merge of #33793 - GuillaumeGomez:compile_fail, r=GuillaumeGomez
Manish Goregaokar [Mon, 30 May 2016 09:48:59 +0000 (15:18 +0530)]
Rollup merge of #33793 - GuillaumeGomez:compile_fail, r=GuillaumeGomez

Fix compile_fail tag

Fixes #33780

r? @steveklabnik

8 years agoUse Path::is_dir() in fs::read_dir()'s example.
kennytm [Mon, 30 May 2016 09:12:01 +0000 (17:12 +0800)]
Use Path::is_dir() in fs::read_dir()'s example.

Basically reverts #25508. The `is_dir()` function has been stable since 1.5.0.

8 years agoPrevent the borrow counter from overflowing in `Ref::clone`
Tobias Bucher [Mon, 30 May 2016 07:53:09 +0000 (09:53 +0200)]
Prevent the borrow counter from overflowing in `Ref::clone`

Fixes #33880.

8 years agoAuto merge of #33929 - petrochenkov:pathir, r=eddyb
bors [Mon, 30 May 2016 04:28:50 +0000 (21:28 -0700)]
Auto merge of #33929 - petrochenkov:pathir, r=eddyb

Separate bindings from other patterns in HIR

Now when name resolution is done on AST, we can avoid dumping everything that looks like an identifier into `PatKind::Ident` in HIR.
`hir::PatKind::Ident` is removed, fresh bindings are now called `hir::PatKind::Binding`, everything else goes to `hir::PatKind::Path`.

I intend to do something with `PatKind::Path`/`PatKind::QPath` as well using resolution results, but it requires some audit and maybe some deeper refactoring of relevant resolution/type checking code to do it properly.
I'm submitting this part of the patch earlier to notify interested parties that I'm working on this.

cc @jseyfried
r? @eddyb

8 years agoAuto merge of #33860 - doomrobo:fix-grammar-verification, r=nagisa
bors [Sun, 29 May 2016 23:43:09 +0000 (16:43 -0700)]
Auto merge of #33860 - doomrobo:fix-grammar-verification, r=nagisa

antlr grammar verification script now compiles under latest nightly

This is kind of a moving target, since none of libsyntax is stable, but at least this compiles for the time being.

8 years agoImprove E0161 error explanation
Guillaume Gomez [Fri, 27 May 2016 20:05:10 +0000 (22:05 +0200)]
Improve E0161 error explanation

8 years agoAuto merge of #33859 - nrc:save-field-sub, r=pnkfelix
bors [Sun, 29 May 2016 18:23:00 +0000 (11:23 -0700)]
Auto merge of #33859 - nrc:save-field-sub, r=pnkfelix

save-analysis: be a bit more defensive with field sub-expressions

Prevents an ice with `(...).f` since the sub-expression is in the AST but not the HIR.

We could actually do better in this specific case, but it doesn't seem worth it.

8 years agoAdd new error code tests
Guillaume Gomez [Fri, 27 May 2016 20:06:24 +0000 (22:06 +0200)]
Add new error code tests

8 years agoAuto merge of #33902 - flo-l:fix-save-temps, r=dotdash
bors [Sun, 29 May 2016 14:01:51 +0000 (07:01 -0700)]
Auto merge of #33902 - flo-l:fix-save-temps, r=dotdash

save-temps was moved under the -C switch

I stumbled across this..

8 years agoAuto merge of #33934 - Byron:libsyntex-ring-buffer-size, r=pnkfelix
bors [Sun, 29 May 2016 10:02:46 +0000 (03:02 -0700)]
Auto merge of #33934 - Byron:libsyntex-ring-buffer-size, r=pnkfelix

Prevent overflows by increasing ring buffer size

Please note that this change is just done to prevent
issues as currently seen by syntex_syntax in future.
See https://github.com/serde-rs/syntex/pull/47 for details.

As shown in https://github.com/serde-rs/syntex/issues/33,
complex code can easily overflow the ring-buffer and
cause an assertion error.

8 years agorun rustfmt on librustc_llvm folder
Srinivas Reddy Thatiparthy [Sun, 29 May 2016 09:27:34 +0000 (14:57 +0530)]
run rustfmt on librustc_llvm folder

8 years agorun rustfmt on libunwind
Srinivas Reddy Thatiparthy [Sun, 29 May 2016 03:17:51 +0000 (08:47 +0530)]
run rustfmt on libunwind

8 years agorun rustfmt on librand folder
Srinivas Reddy Thatiparthy [Sun, 29 May 2016 03:10:34 +0000 (08:40 +0530)]
run rustfmt on librand folder

8 years agoAuto merge of #33848 - alexcrichton:android-gdb-sysroot, r=michaelwoerister
bors [Sun, 29 May 2016 02:19:27 +0000 (19:19 -0700)]
Auto merge of #33848 - alexcrichton:android-gdb-sysroot, r=michaelwoerister

test: Use `set sysroot` for more NDK compatibility

Recent versions of the Android NDK no longer ship debuggers like
`arm-linux-androideabi-gdb`, but instead one prebuilt binary `gdb`. We can
symlink this into place at least to get our detection still working, but it now
needs to be told what the sysroot is so it can correctly do... something. Long
story short, tests didn't pass with this change and after this change they pass.

8 years agoAuto merge of #33825 - alexcrichton:fix-beta, r=aturon
bors [Sat, 28 May 2016 23:21:53 +0000 (16:21 -0700)]
Auto merge of #33825 - alexcrichton:fix-beta, r=aturon

mk: Fix bootstrapping cross-hosts on beta

The beta builds are currently failing, unfortunately, due to what is presumably
some odd behavior with our makefiles. The wrong bootstrap key is being used to
generate the stage1 cross-compiled libraries, which fails the build.
Interestingly enough if the targets are directly specified as part of the build
then it works just fine! Just a bare `make` fails...

Instead of trying to understand what's happening in the makefiles instead just
tweak how we configure the bootstrap key in a way that's more likely to work.

8 years agoAuto merge of #33824 - alexcrichton:rustbuild-fix-local-rust, r=nikomatsakis
bors [Sat, 28 May 2016 20:24:51 +0000 (13:24 -0700)]
Auto merge of #33824 - alexcrichton:rustbuild-fix-local-rust, r=nikomatsakis

rustbuild: Add support for --enable-local-rust

This commit adds support for the `--enable-local-rust` `./configure` switch
which uses the locally installed `rustc` to bootstrap the compiler.

8 years agoPrevent overflows by increasing ring buffer size
Sebastian Thiel [Sat, 28 May 2016 15:29:59 +0000 (17:29 +0200)]
Prevent overflows by increasing ring buffer size

Please note that this change is just done to prevent
issues as currently seen by syntex_syntax in future.
See https://github.com/serde-rs/syntex/pull/47 for details.

As shown in https://github.com/serde-rs/syntex/issues/33,
complex code can easily overflow the ring-buffer and
cause an assertion error.

8 years agosanity -> validation
Vadim Petrochenkov [Sun, 6 Mar 2016 12:54:44 +0000 (15:54 +0300)]
sanity -> validation

Add test for `::super` in import prefix

8 years agoMove some other checks to AST sanity pass
Vadim Petrochenkov [Sun, 22 May 2016 15:07:28 +0000 (18:07 +0300)]
Move some other checks to AST sanity pass

8 years agoAdd an AST sanity checking pass and use it to catch some illegal lifetime/label names
Vadim Petrochenkov [Sun, 22 May 2016 14:51:22 +0000 (17:51 +0300)]
Add an AST sanity checking pass and use it to catch some illegal lifetime/label names

8 years agoAuto merge of #33821 - sanxiyn:cfg-test, r=nikomatsakis
bors [Sat, 28 May 2016 17:24:01 +0000 (10:24 -0700)]
Auto merge of #33821 - sanxiyn:cfg-test, r=nikomatsakis

Do not inject test harness for --cfg test

Fix #33670.

8 years agoAddress review comments
Vadim Petrochenkov [Sun, 6 Mar 2016 12:54:44 +0000 (15:54 +0300)]
Address review comments

8 years agoRefactor away some functions from hir::pat_util
Vadim Petrochenkov [Sun, 6 Mar 2016 12:54:44 +0000 (15:54 +0300)]
Refactor away some functions from hir::pat_util

8 years agoAuto merge of #33927 - Manishearth:rollup, r=Manishearth
bors [Sat, 28 May 2016 14:22:51 +0000 (07:22 -0700)]
Auto merge of #33927 - Manishearth:rollup, r=Manishearth

Rollup of 15 pull requests

- Successful merges: #33820, #33821, #33822, #33824, #33825, #33831, #33832, #33848, #33849, #33852, #33854, #33856, #33859, #33860, #33861
- Failed merges:

8 years agoRollup merge of #33856 - GuillaumeGomez:fmt_error, r=alexcrichton
Manish Goregaokar [Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)]
Rollup merge of #33856 - GuillaumeGomez:fmt_error, r=alexcrichton

Implement Error trait for fmt::Error type

Fixes #33827.

r? @alexcrichton

Just one last thing: I added a feature name, but don't hesitate to ask me to change it if you think it doesn't fit well.

8 years agoRollup merge of #33854 - petrochenkov:prefvis, r=eddyb
Manish Goregaokar [Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)]
Rollup merge of #33854 - petrochenkov:prefvis, r=eddyb

Apply visit_path to import prefixes by default

Overriding `visit_path` is not enough to visit all paths, some import prefixes are not visited and `visit_path_list_item` need to be overridden as well. This PR removes this catch, it should be less error prone this way. Also, the prefix is visited once now, not repeatedly for each path list item.

r? @eddyb

8 years agoRollup merge of #33852 - arielb1:autoderef-iterator, r=eddyb
Manish Goregaokar [Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)]
Rollup merge of #33852 - arielb1:autoderef-iterator, r=eddyb

refactor autoderef to avoid prematurely registering obligations

Refactor `FnCtxt::autoderef` to use an external iterator and to not
register any obligation from the main autoderef loop, but rather to
register them after (and if) the loop successfully completes.

Fixes #24819
Fixes #25801
Fixes #27631
Fixes #31258
Fixes #31964
Fixes #32320
Fixes #33515
Fixes #33755

r? @eddyb

8 years agoRollup merge of #33849 - ranma42:escape-iters-count, r=alexcrichton
Manish Goregaokar [Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)]
Rollup merge of #33849 - ranma42:escape-iters-count, r=alexcrichton

Implement `count` for `EscapeUnicode`

and cleanup the code for `count` for `EscapeDefault` (instead of repeating the `match` for `size_hint` and `count`).

This PR marks EscapeUnicode and EscapeDefault as ExactSizeIterator. The constraints for the trait implementations held even before this PR, but I am not sure if this is something we want to guarantee/expose (I would love feedback on this, especially on what would be the appropriate way to handle stabilisation, if needed).

Part of #24214, split from #31049.

The test for `count` was added in #33103.

8 years agoRollup merge of #33832 - alexcrichton:android-memalign, r=luqmana
Manish Goregaokar [Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)]
Rollup merge of #33832 - alexcrichton:android-memalign, r=luqmana

std: Use memalign, not posix_memalign, on Android

We've gotten requests to move our Android support as far back as API level 9
where unfortunately the `posix_memalign` API wasn't implemented yet. Thankfully,
however, the `memalign` API was and it appears to be usable with `free` on the
Android platform (see comments included in commit).

This should help fix some of the last few test failures when compiling against
API level 9.

8 years agoRollup merge of #33831 - diwic:patch-1, r=aturon
Manish Goregaokar [Sat, 28 May 2016 14:22:16 +0000 (19:52 +0530)]
Rollup merge of #33831 - diwic:patch-1, r=aturon

panic.rs: fix docs (recover -> catch_unwind)

The current docs are a bit inconsistent. First, change all references of "recover" to "catch_unwind" because the function was renamed. Second, consistently use the term "unwind safe" instead of "panic safe", "exception safe" and "recover safe" (all these terms were used previously).

8 years agoRollup merge of #33822 - soltanmm:dot-vec-div-mag-square, r=nikomatsakis
Manish Goregaokar [Sat, 28 May 2016 14:22:15 +0000 (19:52 +0530)]
Rollup merge of #33822 - soltanmm:dot-vec-div-mag-square, r=nikomatsakis

Propagate obligations through projection

Up next: generating region obligations in inference.

r? @nikomatsakis

8 years agoRollup merge of #33820 - jonathandturner:format_readability_updates, r=nikomatsakis
Manish Goregaokar [Sat, 28 May 2016 14:22:15 +0000 (19:52 +0530)]
Rollup merge of #33820 - jonathandturner:format_readability_updates, r=nikomatsakis

Increase spacing in error format for readability.

Two small tweaks that seem to help readability quite a bit:
* Add spacing header<->snippet, but use the |> on the side for visual consistency
* Fix #33819
* Fix #33763
* Move format-sensitive test (issue-26480 in cfail) to ui test

r? @nikomatsakis

8 years agoUse the span of `#[derive_Eq]` for `#[structural_match]`
Jeffrey Seyfried [Sat, 28 May 2016 11:58:45 +0000 (11:58 +0000)]
Use the span of `#[derive_Eq]` for `#[structural_match]`

8 years agoAuto merge of #33818 - alexcrichton:bump, r=nikomatsakis
bors [Sat, 28 May 2016 08:59:04 +0000 (01:59 -0700)]
Auto merge of #33818 - alexcrichton:bump, r=nikomatsakis

mk: Bump version number

The 1.10 betas are now under way so we're now working on the 1.11 release.

8 years agoAdd test
Jeffrey Seyfried [Mon, 23 May 2016 10:16:49 +0000 (10:16 +0000)]
Add test

8 years agoRefactor away `set_expn_info`
Jeffrey Seyfried [Mon, 23 May 2016 08:54:37 +0000 (08:54 +0000)]
Refactor away `set_expn_info`

8 years agoFix spans of generated `#[derive_*]` attributes
Jeffrey Seyfried [Mon, 23 May 2016 06:27:43 +0000 (06:27 +0000)]
Fix spans of generated `#[derive_*]` attributes

8 years agoAuto merge of #33800 - nrc:save-fn-name, r=eddyb
bors [Sat, 28 May 2016 03:45:46 +0000 (20:45 -0700)]
Auto merge of #33800 - nrc:save-fn-name, r=eddyb

save-analysis: use a function's short name

8 years agoInline simple Cursor write calls
Jamey Sharp [Sat, 28 May 2016 02:34:20 +0000 (19:34 -0700)]
Inline simple Cursor write calls

Implementing the Write trait for Cursors over slices is so light-weight that under some circumstances multiple writes can be fused into a single instruction. In general I think inlining these functions is a good idea because most of the code can be constant-folded and copy-propagated away.

Closes issue #33916.

8 years agoAuto merge of #33706 - jseyfried:refactor_cfg, r=nrc
bors [Sat, 28 May 2016 00:46:14 +0000 (17:46 -0700)]
Auto merge of #33706 - jseyfried:refactor_cfg, r=nrc

Perform `cfg` attribute processing during macro expansion and fix bugs

This PR refactors `cfg` attribute processing and fixes bugs. More specifically:
 - It merges gated feature checking for stmt/expr attributes, `cfg_attr` processing, and `cfg` processing into a single fold.
  - This allows feature gated `cfg` variables to be used in `cfg_attr` on unconfigured items. All other feature gated attributes can already be used on unconfigured items.
 - It performs `cfg` attribute processing during macro expansion instead of after expansion so that macro-expanded items are configured the same as ordinary items. In particular, to match their non-expanded counterparts,
  - macro-expanded unconfigured macro invocations are no longer expanded,
  - macro-expanded unconfigured macro definitions are no longer usable, and
  - feature gated `cfg` variables on macro-expanded macro definitions/invocations are now errors.

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m {
    () => {
        #[cfg(attr)]
        macro_rules! foo { () => {} }
        foo!(); // This will be an error

        macro_rules! bar { () => { fn f() {} } }
        #[cfg(attr)] bar!(); // This will no longer be expanded ...
        fn g() { f(); } // ... so that `f` will be unresolved.

        #[cfg(target_thread_local)] // This will be a gated feature error
        macro_rules! baz { () => {} }
    }
}

m!();
```

r? @nrc

8 years agoComment methods in `CfgFolder`
Jeffrey Seyfried [Tue, 24 May 2016 05:15:07 +0000 (05:15 +0000)]
Comment methods in `CfgFolder`

8 years agoTest that unconfigured macro-expanded macro invocations are not expanded.
Jeffrey Seyfried [Wed, 18 May 2016 02:02:04 +0000 (02:02 +0000)]
Test that unconfigured macro-expanded macro invocations are not expanded.

8 years agoSeparate bindings from other patterns in HIR
Vadim Petrochenkov [Sun, 6 Mar 2016 12:54:44 +0000 (15:54 +0300)]
Separate bindings from other patterns in HIR

8 years agoAdded examples/docs to split in str.rs
Ty Coghlan [Thu, 26 May 2016 22:17:30 +0000 (18:17 -0400)]
Added examples/docs to split in str.rs

Added documentation clarifying the behavior of split when used with the empty string and contiguous separators.

8 years agoAuto merge of #33798 - locallycompact:lc/misleading-intentation, r=alexcrichton
bors [Fri, 27 May 2016 21:49:10 +0000 (14:49 -0700)]
Auto merge of #33798 - locallycompact:lc/misleading-intentation, r=alexcrichton

Fix misleading intentation errors on gcc 6.0

Currently building with latest gcc results in the following error:

    compile: x86_64-unknown-linux-gnu/rt/miniz.o
    /home/lc/rust/src/rt/miniz.c: In function ‘tinfl_decompress’:
    /home/lc/rust/src/rt/miniz.c:578:9: error: this ‘for’ clause does not guard... [-Werror=misleading-indentation]
             for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
             ^~~
    /home/lc/rust/src/rt/miniz.c:578:47: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
             for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
                                                   ^~~
    /home/lc/rust/src/rt/miniz.c: In function ‘tdefl_find_match’:
    /home/lc/rust/src/rt/miniz.c:1396:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
         if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
         ^~
    /home/lc/rust/src/rt/miniz.c:1396:23: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
         if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break;
                           ^

This patch stops this.

8 years agorustfmt liballoc folder
Srinivas Reddy Thatiparthy [Fri, 27 May 2016 20:55:16 +0000 (02:25 +0530)]
rustfmt liballoc folder

8 years agoimprove E0152 error explanation
Guillaume Gomez [Fri, 27 May 2016 19:57:06 +0000 (21:57 +0200)]
improve E0152 error explanation

8 years agoImprove E0133 error explanation
Guillaume Gomez [Fri, 27 May 2016 19:36:40 +0000 (21:36 +0200)]
Improve E0133 error explanation

8 years agoImprove E0138 error explanation
Guillaume Gomez [Fri, 27 May 2016 19:47:59 +0000 (21:47 +0200)]
Improve E0138 error explanation

8 years agoImprove E0137 error explanatIon
Guillaume Gomez [Fri, 27 May 2016 19:45:15 +0000 (21:45 +0200)]
Improve E0137 error explanatIon

8 years agoImprove E0132 error explanation
Guillaume Gomez [Fri, 27 May 2016 19:16:58 +0000 (21:16 +0200)]
Improve E0132 error explanation

8 years agoAuto merge of #33795 - srinivasreddy:lib_coll_test, r=nrc
bors [Fri, 27 May 2016 18:51:53 +0000 (11:51 -0700)]
Auto merge of #33795 - srinivasreddy:lib_coll_test, r=nrc

run rustfmt on libcollections test module

8 years agoEmit "no-frame-pointer-elim" attribute for closures, shims, and glue.
Michael Woerister [Fri, 27 May 2016 17:27:56 +0000 (13:27 -0400)]
Emit "no-frame-pointer-elim" attribute for closures, shims, and glue.

8 years agomake core::str::next_code_point work on arbitrary iterator
M Farkas-Dyck [Fri, 27 May 2016 01:44:13 +0000 (17:44 -0800)]
make core::str::next_code_point work on arbitrary iterator