Commit graph

64990 commits

Author SHA1 Message Date
Sunjay Varma
223d091744 Parsing where clauses correctly and documenting the grammar being parsed 2017-12-01 01:26:29 -05:00
Sunjay Varma
c2aaba9b44 Specifically gating generic_associated_types feature on associated Type declarations 2017-12-01 01:26:29 -05:00
Niko Matsakis
e565b5bbdd demonstrate how we can write "successful parse" tests quite easily 2017-12-01 01:26:29 -05:00
Sunjay Varma
1b196fa324 Added stderr files for ui tests 2017-12-01 01:26:29 -05:00
Sunjay Varma
332a3cb169 More testing for generic associated types parsing 2017-12-01 01:26:29 -05:00
Sunjay Varma
83efebc539 Fixed tidy errors 2017-12-01 01:26:29 -05:00
Sunjay Varma
f29613437f Adding feature gate 2017-12-01 01:26:29 -05:00
Sunjay Varma
6bd8ea1a6b Added run-pass tests for associated generic types 2017-12-01 01:24:53 -05:00
Sunjay Varma
19e25b61d1 Parsing generics in both trait items and impl items 2017-12-01 01:24:53 -05:00
bors
804b15be82 Auto merge of #45846 - pietroalbini:use-nested-groups, r=petrochenkov
Add nested groups in imports

This PR adds support for nested groups in imports (rust-lang/rfcs#2128, tracking issue #44494).

r? @petrochenkov
2017-12-01 03:25:54 +00:00
bors
d8a60c9611 Auto merge of #46370 - michaelwoerister:rm-metadata-hashing, r=eddyb
incr.comp.: Remove ability to produce incr. comp. hashes during metadata export.

This functionality has been superseded by on-import hashing, which can be less conservative and does not require extra infrastructure.

r? @nikomatsakis
2017-12-01 00:46:08 +00:00
Oliver Schneider
208deac1c9
Reenable clippy 2017-11-30 16:12:24 +01:00
Pietro Albini
f7f69512c8
Mark rustfmt and rls as broken 2017-11-30 13:24:59 +01:00
Pietro Albini
91ba8b42fc
Implement RFC 2128 (use_nested_groups)
This commit adds support for nested groups inside `use` declarations,
such as `use foo::{bar, sub::{baz::Foo, *}};`.
2017-11-30 13:10:26 +01:00
bors
4fa202d23b Auto merge of #46299 - michaelwoerister:incr-comp-krimskrams, r=nikomatsakis
incr.comp.: Some preparatory work for caching more query results.

This PR
* adds and updates some encoding/decoding routines for various query result types so they can be cached later, and
* adds missing `[input]` annotations for a few `DepNode` variants.

The situation around having to explicitly mark dep-nodes/queries as inputs is not really satisfactory. I hope we can find a way of making this more fool-proof in the future.

r? @nikomatsakis
2017-11-30 10:57:21 +00:00
bors
d6b010f98b Auto merge of #46226 - arielb1:special-region-obligation, r=nikomatsakis
avoid type-live-for-region obligations on dummy nodes

Type-live-for-region obligations on DUMMY_NODE_ID cause an ICE, and it
turns out that in the few cases they are needed, these obligations are not
needed anyway because they are verified elsewhere.

Fixes #46069.

Beta-nominating because this is a regression for our new beta.
r? @nikomatsakis
2017-11-30 08:00:27 +00:00
bors
909b94b5cc Auto merge of #46041 - zilbuz:issue-44837, r=arielb1
MIR borrowck: finalize `check_access_permissions()`

Fix #44837 (hopefully for good)

r? @arielb1
2017-11-30 05:26:28 +00:00
bors
74bc14d0fe Auto merge of #46144 - nrc:rls-update, r=alexcrichton
Update RLS and Rustfmt

r? @alexcrichton
2017-11-29 22:41:05 +00:00
Michael Woerister
7ebccbb7a4 incr.comp.: Update test cases after metadata hashing removal. 2017-11-29 16:29:13 +01:00
Michael Woerister
c60b0e43c8 incr.comp.: Remove on-export crate metadata hashing. 2017-11-29 16:28:25 +01:00
kennytm
51bd916af4 Rollup merge of #46356 - daboross:patch-2, r=sfackler
Reject '2' as a binary digit in internals of b: number formatting

The `radix!` macro generates an implementation of the private trait `GenericRadix`, and the code replaced changes Binary's implementation to no longer accept '2' as a valid digit to print.

Granted, this code is literally only ever called from another method in this private trait, and that method has logic to never hand a '2' to the printing function. Even given this, the code's there, I thought it would be best to fix this for clarity of anyone reading it.
2017-11-29 18:37:54 +08:00
kennytm
30f1853649 Rollup merge of #46323 - ia0:fix_mpsc_error_conv, r=kennytm
Fix since for mpsc_error_conversions

This is a followup of #45506.
2017-11-29 18:37:51 +08:00
kennytm
a19c13a698 Rollup merge of #46322 - gnzlbg:mmx, r=alexcrichton
white list MMX and MSA target features

r? @alexcrichton
2017-11-29 18:37:50 +08:00
kennytm
fc9abbd7b7 Rollup merge of #46293 - ollie27:atomic_bool_from, r=BurntSushi
impl From<bool> for AtomicBool

This seems like an obvious omission from #45610. ~~I've used the same feature name and version in the hope that this can be backported to beta so it's stabilized with the other impls. If it can't be I'll change it to `1.24.0`.~~
2017-11-29 18:37:50 +08:00
kennytm
0e78c29bea Rollup merge of #46287 - SimonSapin:stable-constness, r=aturon
Stabilize const-calling existing const-fns in std

Fixes #46038
2017-11-29 18:37:47 +08:00
kennytm
6006c0f35f Rollup merge of #46219 - rust-lang:frewsxcv-issue-45636, r=GuillaumeGomez
Improve documentation for slice swap/copy/clone operations.

Fixes #45636.

- Demonstrate how to use these operations with slices of differing
  lengths
- Demonstrate how to swap/copy/clone sub-slices of a slice using
  `split_at_mut`
2017-11-29 18:37:45 +08:00
kennytm
963ab91dd4 Rollup merge of #46077 - LukasKalbertodt:stabilize-ascii-ctype, r=alexcrichton
Stabilize some `ascii_ctype` methods

As discussed in #39658, this PR stabilizes those methods for `u8` and `char`. All inherent `ascii_ctype` for `[u8]` and `str` are removed as we prefer the more explicit version `s.chars().all(|c| c.is_ascii_())`.

This PR doesn't modify the `AsciiExt` trait. There, the `ascii_ctype` methods are still unstable. It is planned to remove those in the future (I think). I had to modify some code in `ascii.rs` to properly implement `AsciiExt` for all types.

Fixes #39658.
2017-11-29 18:37:44 +08:00
kennytm
0ec3aee569 Rollup merge of #45969 - ia0:mpsc_recv_deadline, r=alexcrichton
Add std::sync::mpsc::Receiver::recv_deadline()

Essentially renames recv_max_until to recv_deadline (mostly copying recv_timeout
documentation). This function is useful to avoid the often unnecessary call to
Instant::now in recv_timeout (e.g. when the user already has a deadline). A
concrete example would be something along those lines:

```rust
use std::sync::mpsc::Receiver;
use std::time::{Duration, Instant};

/// Reads a batch of elements
///
/// Returns as soon as `max_size` elements have been received or `timeout` expires.
fn recv_batch_timeout<T>(receiver: &Receiver<T>, timeout: Duration, max_size: usize) -> Vec<T> {
    recv_batch_deadline(receiver, Instant::now() + timeout, max_size)
}

/// Reads a batch of elements
///
/// Returns as soon as `max_size` elements have been received or `deadline` is reached.
fn recv_batch_deadline<T>(receiver: &Receiver<T>, deadline: Instant, max_size: usize) -> Vec<T> {
    let mut result = Vec::new();
    while let Ok(x) = receiver.recv_deadline(deadline) {
        result.push(x);
        if result.len() == max_size {
            break;
        }
    }
    result
}
```
2017-11-29 18:37:43 +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
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
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
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
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