Commit Graph

53911 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
de7cb0fdd6 introduce DropAndReplace for translating assignments
this introduces a DropAndReplace terminator as a fix to #30380. That terminator
is suppsoed to be translated by desugaring during drop elaboration, which is
not implemented in this commit, so this breaks `-Z orbit` temporarily.
2016-06-03 16:11:18 +03:00
Jeffrey Seyfried
9639ec87e7 Add regression test 2016-06-03 12:57:58 +00:00
Seo Sanghyeon
a7e96af377 Unsupport wget 2016-06-03 20:53:46 +09:00
bors
9552bcdd92 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
2016-06-03 04:09:31 -07:00
Reeze Xia
959c5f1a92 Update comment
The path has changed
2016-06-03 17:48:49 +08:00
bors
95206f438f 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.
2016-06-03 00:13:38 -07:00
Seo Sanghyeon
b1651fb4d2 Use Docker for Travis 2016-06-03 11:44:30 +09:00
bors
0646e8ae6e Auto merge of #33878 - GuillaumeGomez:improve_helps, r=jonathandturner
Improve help messages for E0425

Fixes #33876.

r? @Manishearth

cc @steveklabnik
cc @jonathandturner
2016-06-02 18:10:37 -07:00
Scott A Carr
d4551ece5f remove trailing whitespace 2016-06-02 15:40:03 -07:00
bors
915b003e32 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
2016-06-02 15:20:36 -07:00
Jonas Schievink
f6a243d231 Add regression test for issue #32829
Closes #32829
2016-06-02 23:58:47 +02:00
Jake Goulding
0eacb9f8f9 Correct issue number in test 2016-06-02 16:03:12 -04:00
bors
12d165352c 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
2016-06-02 10:55:43 -07:00
Simonas Kazlauskas
ed4688c232 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.
2016-06-02 20:09:59 +03:00
Amanieu d'Antras
fc4b356125 Fix rwlock successfully acquiring a write lock after a read lock 2016-06-02 14:34:00 +01:00
Amanieu d'Antras
f3c68a0fdf Add a test to ensure mutexes and rwlocks can't be re-locked 2016-06-02 14:34:00 +01:00
Oliver Middleton
8e0baf492a linkchecker: Treat directory links as errors
Directory links don't work well offline so they should be treated as errors.
2016-06-02 14:29:36 +01:00
Amanieu d'Antras
960d1b74c5 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.
2016-06-02 13:31:01 +01:00
Amanieu d'Antras
d73f5e65ec 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.
2016-06-02 13:31:01 +01:00
Amanieu d'Antras
eea4f0c248 Update libc to bring in pthread mutex type definitions 2016-06-02 13:31:00 +01:00
bors
b47a442f0b Auto merge of #34034 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #33993, #34013, #34014, #34015, #34019, #34021, #34033
- Failed merges:
2016-06-02 05:28:46 -07:00
ggomez
f4e6f3c186 Improve help messages for E0425 2016-06-02 13:58:21 +02:00
Guillaume Gomez
7399403f38 Rollup merge of #34033 - tshepang:typo, r=GuillaumeGomez
doc: typo
2016-06-02 13:47:08 +02:00
Guillaume Gomez
2c1da5b650 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
2016-06-02 13:47:08 +02:00
Guillaume Gomez
083e013086 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.)
2016-06-02 13:47:08 +02:00
Guillaume Gomez
320e27dc80 Rollup merge of #34015 - GuillaumeGomez:err-code-tests, r=jonathandturner
Add new error code tests

r? @steveklabnik
2016-06-02 13:47:07 +02:00
Guillaume Gomez
705b613037 Rollup merge of #34014 - GuillaumeGomez:fix-E0165, r=jonathandturner
Fix E0165 code examples

r? @steveklabnik
2016-06-02 13:47:07 +02:00
Guillaume Gomez
82d9103700 Rollup merge of #34013 - kraai:fix-link, r=steveklabnik
Fix broken link name in `bool` documentation
2016-06-02 13:47:07 +02:00
Guillaume Gomez
1d9e713121 Rollup merge of #33993 - oconnor663:filedocs, r=alexcrichton
document that Files close themselves automatically
2016-06-02 13:47:07 +02:00
Tshepang Lekhonkhobe
920129a258 doc: typo 2016-06-02 13:30:26 +02:00
Wangshan Lu
f67c4bb6ce Update cargo version in cargotest 2016-06-02 18:53:40 +08:00
bors
270bd7c897 Auto merge of #33988 - intelfx:hoedown-bump, r=alexcrichton
hoedown: fix trigger of -Werror=misleading-indentation

See rust-lang/hoedown#6.
2016-06-02 01:42:40 -07:00
Jeffrey Seyfried
daf916bf9a Fix bug in the syntax::config::StripUnconfigured folder 2016-06-02 07:34:19 +00:00
bors
e752aa8b57 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
2016-06-01 21:48:32 -07:00
Luqman Aden
a97f6b35ac [MIR] Use If terminator for switches on bools rather than SwitchInt. 2016-06-01 21:02:36 -04:00
bors
728eea7dc1 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.
2016-06-01 15:11:38 -07:00
Jeffrey Seyfried
3fc0407fb3 Remove the dep-info-no-analysis test and fix other fallout. 2016-06-01 19:20:42 +00:00
Jeffrey Seyfried
c52968af8c Move name resolution to phase 2 2016-06-01 19:20:39 +00:00
Jeffrey Seyfried
58d7e1bf70 Remove redundant check_for_macros AST pass. 2016-06-01 18:51:35 +00:00
Scott A Carr
79bf586d4b switch to BitVector, simplify target_block logic
clarify comments and panic message
2016-06-01 10:23:56 -07:00
bors
12d16599d8 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]
2016-06-01 10:21:55 -07:00
Steven Allen
cde72b071c build: avoid repeated string concatenation in python 2016-06-01 12:29:39 -04:00
kennytm
1d7f34538d
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.
2016-06-02 00:01:53 +08:00
Oliver Middleton
658253d30c 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.
2016-06-01 16:53:14 +01:00
Guillaume Gomez
2b80753330 Add new error code tests 2016-06-01 16:30:13 +02:00
Guillaume Gomez
d211cd6550 Close unclosed code example in E0185 2016-06-01 16:17:21 +02:00
Jack O'Connor
df8d5baab7 allow for the future addition of a close method on File 2016-06-01 10:16:45 -04:00
Guillaume Gomez
c34676a7c4 Fix E0165 code examples 2016-06-01 16:02:23 +02:00
bors
c2cab1fd58 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
2016-06-01 06:21:53 -07:00
Matt Kraai
68ac3e9ff0 Fix broken link name in bool documentation 2016-06-01 05:32:11 -07:00