Commit Graph

70549 Commits

Author SHA1 Message Date
kennytm
666c24136b
Disable all macOS dist images to workaround travis-ci/travis-ci#8821
[skip ci]
2017-11-29 17:39:36 +08:00
Nick Cameron
1cec22e157 Update Rustfmt again 2017-11-29 20:34:06 +13:00
Nick Cameron
02c89f703d Rebased Cargo.lock 2017-11-29 19:17:20 +13:00
Nick Cameron
500b791b30 Update Cargo
Pulls in https://github.com/rust-lang/cargo/pull/4762 fixing a broken test which prevented the RLS update
2017-11-29 19:15:54 +13:00
Nick Cameron
1b50f68135 Update RLS and Rustfmt 2017-11-29 19:15:46 +13:00
David Ross
2c98378ace
Reject '2' as a binary digit in internals of 'b' formatting
I don't believe the previous code `0 ... 2` would run into any real problems, but it seems confusing to read, given that '2' is never a valid binary digit.

As far as I can tell this code is only ever called from within another private method in the trait which has logic to never hand it '2' anyways. I thought we could change this for clarity anyways.
2017-11-28 21:35:18 -08:00
Jeffrey Seyfried
dfa6c25afd Fix hygiene bug. 2017-11-28 18:59:12 -08:00
Mark Simulacrum
2485afa123 Deploy builds both with asserts enabled and asserts disabled to CI.
This also removes uploads to the 'try' bucket, and instead dumps
everything into the two rustc-builds and rustc-builds-alt buckets. This
makes lives easier, as there is only one location for a given "type" of
build, and since we have the git commit hash in the filenames, this is
fine; we won't run into uploads of the same commit.
2017-11-28 19:55:19 -07:00
bors
77ab3a1d5f Auto merge of #46207 - kennytm:kill-grep, r=alexcrichton
Replace most call to grep in run-make by a script that cat the input.

Introduced a new `src/etc/cat-and-grep.sh` script (called in run-make as `$(CGREP)`), which prints the input and do a grep simultaneously. This is mainly used to debug spurious failures in run-make, such as the spurious error in #45810, as well as real errors such as #46126.

(cc #40713)

Some `grep` still remains, mainly the `grep -c` calls that count the number of matches and print the result to stdout.
2017-11-28 23:23:03 +00:00
Tamir Duberstein
94d02b896c
*: strip calls to cc::Build::compile
The documentation states: "The name output should be the name of the
library." and this is already done in more recently-added callers.
2017-11-28 18:15:30 -05:00
Tamir Duberstein
9067d9735a
rustc_llvm: use cc::Build::define 2017-11-28 18:15:30 -05:00
Tamir Duberstein
658ea389fd
rustc_llvm: remove stale references
...that were removed in 77c3bfa742.
2017-11-28 18:15:28 -05:00
Julian Kulesh
6506f9c253 Add case insensitive comparison, besides Levenstein 2017-11-29 00:02:09 +03:00
bors
73bca2b9fa Auto merge of #46094 - dtolnay:is_null, r=alexcrichton
Remove `T: Sized` on `ptr::is_null()`

Originally from #44932 -- this is purely a revert of the last commit of that PR, which was removing some changes from the previous commits in the PR. So a revert of a revert means this is code written by @cuviper!

@mikeyhew makes a compelling case in https://github.com/rust-lang/rfcs/issues/433#issuecomment-345495505 for why this is the right way to implement `is_null` for trait objects. And the behavior for slices makes sense to me as well.

```diff
  impl<T: ?Sized> *const T {
-     pub fn is_null(self) -> bool where T: Sized;
+     pub fn is_null(self) -> bool;
  }

  impl<T: ?Sized> *mut T {
-     pub fn is_null(self) -> bool where T: Sized;
+     pub fn is_null(self) -> bool;
  }
2017-11-28 20:40:51 +00:00
Julien Cretin
8e025d8009 Fix doc test of previous commit 2017-11-28 21:22:30 +01:00
Esteban Küber
677381a0c1 On type mismatch error highlight & when type matches
When the only difference between the two types in a type error is that
one is a reference to the other type (`T` vs `&T`) or both are
references differing only in their mutability (`&T` vs `&mut T`), don't
highlight the type (`T`).
2017-11-28 11:25:40 -08:00
bors
71340ca4e1 Auto merge of #46291 - alexcrichton:wasm-tests, r=kennytm
ci: Start running wasm32 tests on Travis

This commit allocates a builder to running wasm32 tests on Travis. Not all test
suites pass right now so this is starting out with just the run-pass and the
libcore test suites. This'll hopefully give us a pretty broad set of coverage
for integration in rustc itself as well as a somewhat broad coverage of the llvm
backend itself through integration/unit tests.
2017-11-28 17:58:58 +00:00
Alex Crichton
73970bf6f2 ci: Start running wasm32 tests on Travis
This commit allocates a builder to running wasm32 tests on Travis. Not all test
suites pass right now so this is starting out with just the run-pass and the
libcore test suites. This'll hopefully give us a pretty broad set of coverage
for integration in rustc itself as well as a somewhat broad coverage of the llvm
backend itself through integration/unit tests.
2017-11-28 09:27:35 -08:00
kennytm
918158debb
Disable the cdylib-fewer-symbols test for all Windows (test was broken). 2017-11-28 23:38:04 +08:00
kennytm
ab788a2ee1
Replace most call to grep in run-make by a script that cat the input.
Introduced a new src/etc/cat-and-grep.sh script (called in run-make as
$(CGREP)), which prints the input and do a grep simultaneously. This is
mainly used to debug spurious failures in run-make, such as the sanitizer
error in #45810, as well as real errors such as #46126.
2017-11-28 23:36:12 +08:00
Basile Desloges
1cd9d74a2d mir-borrowck: Update tests 2017-11-28 16:19:44 +01:00
bors
5a59704525 Auto merge of #46329 - arielb1:incoherent, r=eddyb
Revert "fix treatment of local types in "remote coherence" mode"

That commit had accidentally snuck in into #44884 and it causes regressions. Revert it.

This reverts commit c48650ec25.

@bors p=10 - fixes breakage in nightly
r? @eddyb
2017-11-28 15:12:58 +00:00
Julien Cretin
43323b3194 Fix since for mpsc_error_conversions 2017-11-28 15:58:36 +01:00
Basile Desloges
34f56c44a9 mir-borrowck: Add permission check for WriteKind::Mutate 2017-11-28 15:07:51 +01:00
Simon Sapin
a6d1895404
Update comment on alternate builds in .travis.yml
https://github.com/rust-lang/rust/pull/45810#issuecomment-347257640
2017-11-28 14:26:59 +01:00
Ariel Ben-Yehuda
bef4fe98b1 Revert "fix treatment of local types in "remote coherence" mode"
That commit had accidentally snuck in into #44884. Revert it.

This reverts commit c48650ec25.
2017-11-28 14:54:01 +02:00
Basile Desloges
503d25cbfd mir-borrowck: describe_lvalue() can fail if a local doesn't have a name 2017-11-28 13:44:09 +01:00
Michael Woerister
3bb25d6bfb incr.comp.: Add some missing DepNode [input] annotations. 2017-11-28 13:03:39 +01:00
Michael Woerister
687e099b44 incr.comp.: Make a bunch of query results encodable. 2017-11-28 13:03:39 +01:00
Michael Woerister
8fbc91cfe1 incr.comp.: Make MIR encoding fit for incr.comp. caching. 2017-11-28 12:44:45 +01:00
bors
3bde5e78ae Auto merge of #46175 - GuillaumeGomez:fix-global-search, r=QuietMisdreavus
Fix global search

Fixes #46021.

r? @QuietMisdreavus
2017-11-28 10:41:47 +00:00
gnzlbg
32a36d8f6e white list MMX and MSA target features 2017-11-28 10:28:15 +01:00
bors
436ac8928a Auto merge of #46123 - Gankro:c-repr, r=eddyb
Implement the special repr(C)-non-clike-enum layout

This is the second half of https://github.com/rust-lang/rfcs/pull/2195

which specifies that

```rust
#[repr(C, u8)]
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
enum MyEnum {
    A(u32),                 // Single primitive value
    B { x: u8, y: i16 },    // Composite, and the offset of `y` depends on tag being internal
    C,                      // Empty
    D(Option<u32>),         // Contains an enum
    E(Duration),            // Contains a struct
}
```

Has the same layout as

```rust
#[repr(C)]
struct MyEnumRepr {
    tag: MyEnumTag,
    payload: MyEnumPayload,
}

#[repr(C)]
#[allow(non_snake_case)]
union MyEnumPayload {
    A: MyEnumVariantA,
    B: MyEnumVariantB,
    D: MyEnumVariantD,
    E: MyEnumVariantE,
}

#[repr(u8)] #[derive(Copy, Clone)] enum MyEnumTag { A, B, C, D, E }
#[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantA(u32);
#[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantB {x: u8, y: i16 }
#[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantD(Option<u32>);
#[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantE(Duration);

```
2017-11-28 08:04:58 +00:00
Lukas Kalbertodt
c5aad96739 Change since attribute from ctype methods from 1.23 to 1.24
The changes didn't land in time for 1.23 and stabilizations won't
be backported to beta.
2017-11-28 08:50:40 +01:00
Alexis Beingessner
0e63d2727c Fix and improve test for enum repr sizes 2017-11-28 00:54:16 -05:00
bors
7745a7a817 Auto merge of #46142 - eddyb:even-mirer-2, r=nikomatsakis
MIR: split Operand::Consume into Copy and Move.

By encoding the choice of leaving the source untouched (`Copy`) and invalidating it (`Move`) in MIR, we can express moves of copyable values and have MIR borrow-checking enforce them, *including* ownership transfer of stack locals in calls  (when the ABI passes by indirection).

Optimizations could turn a "last-use" `Copy` into a `Move`, and the MIR borrow-checker, at least within the confines of safe code, could even do this when the underlying lvalue was borrowed.
(However, that last part would be the first time lifetime inference affects code generation, AFAIK).

Furthermore, as `Move`s invalidate borrows as well, for any local that is initialized only once, we can ignore borrows that happened before a `Move` and safely reuse/replace its memory storage.
This will allow us to perform NRVO in the presence of short-lived borrows, unlike LLVM (currently), and even compute optimal `StorageLive...StorageDead` ranges instead of discarding them.
2017-11-28 05:38:19 +00:00
Eduard-Mihai Burtescu
919ed409b0 tests: update to include move annotations in MIR. 2017-11-28 04:18:32 +02:00
Eduard-Mihai Burtescu
170b88dc79 rustc_mir: require that Copy(L) satisfies typeof L: Copy. 2017-11-28 04:18:32 +02:00
Eduard-Mihai Burtescu
c42a118188 MIR: split Operand::Consume into Copy and Move. 2017-11-28 04:18:32 +02:00
Eduard-Mihai Burtescu
73f5bab33f rustc_mir: enforce that arguments are replaced with Local's only. 2017-11-28 04:11:09 +02:00
Eduard-Mihai Burtescu
0477319afb rustc_mir: move storage_dead_or_drop_error_reported logic to access_lvalue. 2017-11-28 04:11:09 +02:00
bors
3e9a7f7fbb Auto merge of #46102 - kennytm:45861-step-1, r=alexcrichton
[auto-toolstate][1/8] Always ignore build failure of failable tools (rls, rustfmt, clippy)

If build failed for these tools, they will be automatically skipped from distribution, and will not fail the whole build.

Test failures are *not* ignored, nor build failure of other tools (e.g. cargo). Therefore it should have no observable effect to the current CI system.

This is step 1/8 of automatic management of broken tools #45861. The purpose is concentrate all failure detection about tools into a single CI job for easy management, while keeping the ability to distribute these tools in the nightlies.

r? @Mark-Simulacrum
2017-11-28 02:08:52 +00:00
bors
b087a991fc Auto merge of #46312 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests

- Successful merges: #45506, #46174, #46231, #46240, #46249, #46258, #46262, #46275, #46282, #46285
- Failed merges:
2017-11-27 23:40:16 +00:00
Julien Cretin
8424cacff8 Use an unstable feature linked to #46316 2017-11-27 22:31:00 +01:00
Oliver Middleton
71d766bd55
Change version number for impl From<bool> for AtomicBool to 1.24.0 2017-11-27 21:26:19 +00:00
kennytm
83a6f38556 Rollup merge of #46285 - SimonSapin:twos-complement, r=GuillaumeGomez
Document non-obvious behavior of fmt::UpperHex & co for negative integers

Before stabilization I’d have suggested changing the behavior,  but that time is past.
2017-11-28 03:16:50 +08:00
kennytm
8dd10e62cc Rollup merge of #46282 - estebank:impl-trait-cicle-span, r=arielb1
Shorten output of E0391

Use the shorter `def_span` on the impl-Trait cyclic reference errors.
2017-11-28 03:16:49 +08:00
kennytm
81ba35228c Rollup merge of #46275 - dtolnay:compiletest-libc, r=Mark-Simulacrum
Compiletest libc dependency can be unix-only

In main.rs libc is imported as:

```rust
#[cfg(unix)]
extern crate libc;
```

This came up in https://github.com/laumann/compiletest-rs/pull/90.
2017-11-28 03:16:48 +08:00
kennytm
7707b18621 Rollup merge of #46262 - udoprog:linked-list-remove-if, r=dtolnay
Introduce LinkedList::drain_filter

This introduces `LinkedList::remove_if`.

This operation embodies one of the use-cases where `LinkedList` would typically be preferred over `Vec`: random removal and retrieval.

There are a number of considerations with this:

Should there be two `remove_if` methods? One where elements are only removed, one which returns a collection of removed elements.

Should this be implemented using a draining iterator pattern that covers both cases? I suspect that would incur a bit of overhead (moving the element into the iterator, then into a new collection). But I'm not sure. Maybe that's an acceptable compromise to maximize flexibility.

I don't feel I've had enough exposure to unsafe programming in rust to be certain the implementation is correct. This relies quite heavily on moving around copies of Shared pointers to make the code reasonable. Please help me out :).
2017-11-28 03:16:47 +08:00
kennytm
f33edd2ed0 Rollup merge of #46258 - colinmarsh19:master, r=estebank
Remove semicolon note

In reference to issue #46186
r? @estebank

First time doing a pull request, if there are any suggestions on how to improve this please let me know.
@jjolly
2017-11-28 03:16:47 +08:00