Commit Graph

54027 Commits

Author SHA1 Message Date
bors
7de2e6dc82 Auto merge of #34020 - Stebalien:py-cleanup, r=alexcrichton
Avoid repeated string concatenation in python

While performance isn't really critical here, IMO, format strings are more
readable.

/end nit
2016-06-03 12:37:01 -07:00
bors
1ceaa86e0a Auto merge of #33997 - jseyfried:resolve_in_phase_2, r=nrc
Move name resolution into phase 2

r? @nrc
2016-06-03 08:22:54 -07:00
Ariel Ben-Yehuda
148f8422f3 check for is_cleanup violations in MIR typeck
There weren't any in practice, but as these cause MSVC-only problems, the
check looks like a good idea.
2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
f6068ea847 fix ICEs with RUST_LOG 2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
4fff19528b remove filling on drop 2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
8d6d646203 address review comments 2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
a091cfd4f3 implement drop elaboration
Fixes #30380
2016-06-03 16:11:18 +03:00
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
Jeffrey Seyfried
635a82e744 Add regression test. 2016-06-03 12:56:26 +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
Jakob Demler
c26703b77b document of shared modules for integration tests 2016-06-03 12:16:07 +02:00
Reeze Xia
959c5f1a92 Update comment
The path has changed
2016-06-03 17:48:49 +08:00
Jakob Demler
d71f9f614c Fixed ambiguous explanaiton of tests/ directory 2016-06-03 11:43:42 +02: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
Wojciech Nawrocki
8841f26e94 atomic doc: fix statement 2016-06-02 19:36:10 +02: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
Andrew Brinker
00e77d7489 Rewrote "How Safe and Unsafe Interact" Nomicon chapter.
The previous version of the chapter covered a lot of ground, but was a little
meandering and hard to follow at times. This draft is intended to be clearer
and more direct, while still providing the same information as the previous
version.
2016-06-01 16:13:44 -04: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