]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #33997 - jseyfried:resolve_in_phase_2, r=nrc
bors [Fri, 3 Jun 2016 15:22:54 +0000 (08:22 -0700)]
Auto merge of #33997 - jseyfried:resolve_in_phase_2, r=nrc

Move name resolution into phase 2

r? @nrc

8 years agoAuto merge of #33861 - Amanieu:lock_elision_fix, r=alexcrichton
bors [Fri, 3 Jun 2016 11:09:31 +0000 (04:09 -0700)]
Auto merge of #33861 - Amanieu:lock_elision_fix, r=alexcrichton

Make sure Mutex and RwLock can't be re-locked on the same thread

Fixes #33770

r? @alexcrichton

8 years agoAuto merge of #34016 - sanxiyn:travis-docker, r=brson
bors [Fri, 3 Jun 2016 07:13:38 +0000 (00:13 -0700)]
Auto merge of #34016 - sanxiyn:travis-docker, r=brson

Use Docker for Travis

The primary motivtion is to use system LLVM from ubuntu.com, instead of llvm.org.

Travis provides two environments: Ubuntu 12.04 LTS aka precise by default, and Ubuntu 14.04 LTS aka trusty if you specify dist: trusty. According to travis-ci/travis-ci#5821, Ubuntu 16.04 LTS aka xenial is unlikely to be available this year, and Travis recommends to use Docker.

LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04.

Fix #34009.

8 years agoUse Docker for Travis
Seo Sanghyeon [Wed, 1 Jun 2016 15:14:22 +0000 (00:14 +0900)]
Use Docker for Travis

8 years agoAuto merge of #33878 - GuillaumeGomez:improve_helps, r=jonathandturner
bors [Fri, 3 Jun 2016 01:10:37 +0000 (18:10 -0700)]
Auto merge of #33878 - GuillaumeGomez:improve_helps, r=jonathandturner

Improve help messages for E0425

Fixes #33876.

r? @Manishearth

cc @steveklabnik
cc @jonathandturner

8 years agoAuto merge of #33894 - nagisa:windows-lack-endurance-for-sprint, r=alexcrichton
bors [Thu, 2 Jun 2016 22:20:36 +0000 (15:20 -0700)]
Auto merge of #33894 - nagisa:windows-lack-endurance-for-sprint, r=alexcrichton

Rewrite variadic-ffi pass to use test helper

The sprintf used in this test previously isn’t available on some versions of MSVC.

Fixes #32305

r? @alexcrichton

8 years agoAuto merge of #33583 - luqmana:tri-bool-mir, r=arielb1
bors [Thu, 2 Jun 2016 17:55:43 +0000 (10:55 -0700)]
Auto merge of #33583 - luqmana:tri-bool-mir, r=arielb1

MIR: Don't generate 3-armed boolean switch from match.

Fixes #33540.

Snippet from issue:
```Rust
fn foo(x: bool, y: bool) -> u32 {
    match (x, y) {
         (false, _) => 0,
         (_, false) => 1,
         (true, true) => 2,
    }
}
```

Generated MIR:
```
fn foo(arg0: bool, arg1: bool) -> u32 {
    let var0: bool;                      // "x" in scope 1 at 3bbm.rs:17:8: 17:9
    let var1: bool;                      // "y" in scope 1 at 3bbm.rs:17:17: 17:18
    let mut tmp0: (bool, bool);
    let mut tmp1: bool;
    let mut tmp2: bool;
    let mut tmp3: (&'static str, &'static str, u32);
    let mut tmp4: &'static (&'static str, &'static str, u32);

    bb0: {
        var0 = arg0;                     // scope 1 at 3bbm.rs:17:8: 17:9
        var1 = arg1;                     // scope 1 at 3bbm.rs:17:17: 17:18
        tmp1 = var0;                     // scope 5 at 3bbm.rs:18:12: 18:13
        tmp2 = var1;                     // scope 6 at 3bbm.rs:18:15: 18:16
        tmp0 = (tmp1, tmp2);             // scope 4 at 3bbm.rs:18:11: 18:17
        if((tmp0.0: bool)) -> [true: bb4, false: bb1]; // scope 3 at 3bbm.rs:19:10: 19:15
    }

    bb1: {
        return = const 0u32;             // scope 10 at 3bbm.rs:19:23: 19:24
        goto -> bb7;                     // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb2: {
        return = const 1u32;             // scope 11 at 3bbm.rs:20:23: 20:24
        goto -> bb7;                     // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb3: {
        return = const 2u32;             // scope 12 at 3bbm.rs:21:25: 21:26
        goto -> bb7;                     // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb4: {
        if((tmp0.1: bool)) -> [true: bb5, false: bb2]; // scope 3 at 3bbm.rs:20:13: 20:18
    }

    bb5: {
        if((tmp0.0: bool)) -> [true: bb3, false: bb6]; // scope 3 at 3bbm.rs:21:10: 21:14
    }

    bb6: {
        tmp4 = promoted0;                // scope 3 at 3bbm.rs:18:5: 22:6
        core::panicking::panic(tmp4);    // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb7: {
        return;                          // scope 0 at 3bbm.rs:17:1: 23:2
    }
}
```

Not sure about this approach. I was also thinking maybe just a standalone pass?

cc @arielb1, @nagisa

8 years agoFix the test to use explicit argument types
Simonas Kazlauskas [Thu, 2 Jun 2016 14:18:11 +0000 (17:18 +0300)]
Fix the test to use explicit argument types

Hopefully this pacifies the 32bit windows. Apparently there’s an ABI out there that not only allows
non-64 bit variadic arguments, but also has differing ABI for them!

Good thing all variadic functions are unsafe.

8 years agoFix rwlock successfully acquiring a write lock after a read lock
Amanieu d'Antras [Thu, 26 May 2016 05:32:15 +0000 (06:32 +0100)]
Fix rwlock successfully acquiring a write lock after a read lock

8 years agoAdd a test to ensure mutexes and rwlocks can't be re-locked
Amanieu d'Antras [Thu, 26 May 2016 05:10:43 +0000 (06:10 +0100)]
Add a test to ensure mutexes and rwlocks can't be re-locked

8 years agoDon't allow pthread_rwlock_t to recursively lock itself
Amanieu d'Antras [Wed, 25 May 2016 05:07:54 +0000 (06:07 +0100)]
Don't allow pthread_rwlock_t to recursively lock itself

This is allowed by POSIX and can happen on glibc with processors
that support hardware lock elision.

8 years agoFix undefined behavior when re-locking a mutex from the same thread
Amanieu d'Antras [Wed, 25 May 2016 04:44:28 +0000 (05:44 +0100)]
Fix undefined behavior when re-locking a mutex from the same thread

The only applies to pthread mutexes. We solve this by creating the
mutex with the PTHREAD_MUTEX_NORMAL type, which guarantees that
re-locking from the same thread will deadlock.

8 years agoUpdate libc to bring in pthread mutex type definitions
Amanieu d'Antras [Wed, 25 May 2016 04:40:57 +0000 (05:40 +0100)]
Update libc to bring in pthread mutex type definitions

8 years agoAuto merge of #34034 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 2 Jun 2016 12:28:46 +0000 (05:28 -0700)]
Auto merge of #34034 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #33993, #34013, #34014, #34015, #34019, #34021, #34033
- Failed merges:

8 years agoImprove help messages for E0425
ggomez [Thu, 26 May 2016 13:29:17 +0000 (15:29 +0200)]
Improve help messages for E0425

8 years agoRollup merge of #34033 - tshepang:typo, r=GuillaumeGomez
Guillaume Gomez [Thu, 2 Jun 2016 11:47:08 +0000 (13:47 +0200)]
Rollup merge of #34033 - tshepang:typo, r=GuillaumeGomez

doc: typo

8 years agoRollup merge of #34021 - ollie27:book_links_offline, r=steveklabnik
Guillaume Gomez [Thu, 2 Jun 2016 11:47:08 +0000 (13:47 +0200)]
Rollup merge of #34021 - ollie27:book_links_offline, r=steveklabnik

Fix a few links in the book

Links to directories and direct links to doc.rust-lang.org don't work properly
when viewing the docs offline so fix them.

r? @steveklabnik

8 years agoRollup merge of #34019 - kennytm:fix-33958, r=steveklabnik
Guillaume Gomez [Thu, 2 Jun 2016 11:47:08 +0000 (13:47 +0200)]
Rollup merge of #34019 - kennytm:fix-33958, r=steveklabnik

Restore original meaning of std::fs::read_dir's example changed in #33958

`DirEntry.file_type().is_dir()` will not follow symlinks, but the original example (`fs::metadata(&path).is_dir()`) does. Therefore the change in #33958 introduced a subtle difference that now it won't enter linked folders. To preserve the same behavior, we use `Path::is_dir()` instead, which does follow symlink.

(See discussion in the previous PR for detail.)

8 years agoRollup merge of #34015 - GuillaumeGomez:err-code-tests, r=jonathandturner
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #34015 - GuillaumeGomez:err-code-tests, r=jonathandturner

Add new error code tests

r? @steveklabnik

8 years agoRollup merge of #34014 - GuillaumeGomez:fix-E0165, r=jonathandturner
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #34014 - GuillaumeGomez:fix-E0165, r=jonathandturner

Fix E0165 code examples

r? @steveklabnik

8 years agoRollup merge of #34013 - kraai:fix-link, r=steveklabnik
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #34013 - kraai:fix-link, r=steveklabnik

Fix broken link name in `bool` documentation

8 years agoRollup merge of #33993 - oconnor663:filedocs, r=alexcrichton
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #33993 - oconnor663:filedocs, r=alexcrichton

document that Files close themselves automatically

8 years agodoc: typo
Tshepang Lekhonkhobe [Thu, 2 Jun 2016 11:28:24 +0000 (13:28 +0200)]
doc: typo

8 years agoAuto merge of #33988 - intelfx:hoedown-bump, r=alexcrichton
bors [Thu, 2 Jun 2016 08:42:40 +0000 (01:42 -0700)]
Auto merge of #33988 - intelfx:hoedown-bump, r=alexcrichton

hoedown: fix trigger of -Werror=misleading-indentation

See rust-lang/hoedown#6.

8 years agoAuto merge of #33947 - xosmig:btree_split_off, r=gereeter
bors [Thu, 2 Jun 2016 04:48:32 +0000 (21:48 -0700)]
Auto merge of #33947 - xosmig:btree_split_off, r=gereeter

Implement split_off for BTreeMap and BTreeSet (RFC 509)

Fixes #19986 and refactors common with append methods.
It splits the tree with O(log n) operations and then calculates sizes by traversing the lower one.

CC @gereeter

8 years ago[MIR] Use If terminator for switches on bools rather than SwitchInt.
Luqman Aden [Sat, 28 May 2016 19:50:33 +0000 (15:50 -0400)]
[MIR] Use If terminator for switches on bools rather than SwitchInt.

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 agoRemove the `dep-info-no-analysis` test and fix other fallout.
Jeffrey Seyfried [Fri, 27 May 2016 07:02:19 +0000 (07:02 +0000)]
Remove the `dep-info-no-analysis` test and fix other fallout.

8 years agoMove name resolution to phase 2
Jeffrey Seyfried [Wed, 25 May 2016 23:15:23 +0000 (23:15 +0000)]
Move name resolution to phase 2

8 years agoRemove redundant `check_for_macros` AST pass.
Jeffrey Seyfried [Sat, 28 May 2016 20:08:10 +0000 (20:08 +0000)]
Remove redundant `check_for_macros` AST pass.

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 agoRestore original meaning of std::fs::read_dir's example changed in #33958.
kennytm [Wed, 1 Jun 2016 16:01:53 +0000 (00:01 +0800)]
Restore original meaning of std::fs::read_dir's example changed in #33958.

DirEntry.file_type().is_dir() will not follow symlinks, but the original
example (fs::metadata(&path).is_dir()) does. Therefore the change in
#33958 introduced a subtle difference that now it won't enter linked
folders. To preserve the same behavior, we use Path::is_dir() instead,
which does follow symlink.

8 years agoFix a few links in the book
Oliver Middleton [Wed, 1 Jun 2016 12:32:58 +0000 (13:32 +0100)]
Fix a few links in the book

Links to directories and direct links to doc.rust-lang.org don't work properly
when viewing the docs offline so fix them.

8 years agoAdd new error code tests
Guillaume Gomez [Wed, 1 Jun 2016 14:30:13 +0000 (16:30 +0200)]
Add new error code tests

8 years agoClose unclosed code example in E0185
Guillaume Gomez [Wed, 1 Jun 2016 14:17:21 +0000 (16:17 +0200)]
Close unclosed code example in E0185

8 years agoallow for the future addition of a close method on File
Jack O'Connor [Wed, 1 Jun 2016 14:16:45 +0000 (10:16 -0400)]
allow for the future addition of a close method on File

8 years agoFix E0165 code examples
Guillaume Gomez [Wed, 1 Jun 2016 14:02:23 +0000 (16:02 +0200)]
Fix E0165 code examples

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 agoFix broken link name in `bool` documentation
Matt Kraai [Wed, 1 Jun 2016 12:32:11 +0000 (05:32 -0700)]
Fix broken link name in `bool` documentation

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 © 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 agoImplement split_off for BTreeMap and BTreeSet (RFC 509)
Andrey Tonkih [Sun, 29 May 2016 10:30:13 +0000 (13:30 +0300)]
Implement split_off for BTreeMap and BTreeSet (RFC 509)

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 agodocument that Files close themselves automatically
Jack O'Connor [Tue, 31 May 2016 21:12:08 +0000 (17:12 -0400)]
document that Files close themselves automatically

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 agohoedown: fix trigger of -Werror=misleading-indentation
Ivan Shapovalov [Tue, 31 May 2016 18:33:17 +0000 (21:33 +0300)]
hoedown: fix trigger of -Werror=misleading-indentation

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.