Commit Graph

79477 Commits

Author SHA1 Message Date
kennytm
6c73943001
Rollup merge of #51368 - varkor:panic_implementation-closures, r=eddyb
Fix the use of closures within #[panic_implementation]

Fixes #51365.
2018-06-08 07:05:41 +08:00
kennytm
26a9d589c8
Rollup merge of #51283 - kennytm:fix-51279-preempt-the-warning-song-and-dance, r=nikomatsakis
Deny #[cfg] and #[cfg_attr] on generic parameters.

Fix #51279.

Attributes on generic parameters are not expanded, meaning `#[cfg]`, `#[cfg_attr]` and attribute proc macros are entirely ignored on them.

This PR makes using the first two attributes an error, because if they are correctly expanded will affect the AST and change code behavior.

I'm beta-nominating this, because generic parameter attributes are stabilizing in 1.27, and if we did not reserve their usage, we may never be able to repurpose the meaning of these attributes in the Rust 2015 edition.
2018-06-08 07:05:39 +08:00
kennytm
0bc15ed7c0
Rollup merge of #51186 - pnkfelix:remove-unneccessary-nll-stderr-files, r=oli-obk
Remove two redundant .nll.stderr files

It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck, and thus we can just fallback on those `.stderr` files that already exist for AST-borrowck.

Bravo!

(it is a good idea to remove these files, because it slightly reduces the amount of time humans will spend reviewing the .nll.stderr fileset...)

((it *might* be worthwhile trying to change the `compiletest` code to even issue a warning when two such files have equivalent contents... but I am not going so far as to try to implement that right now...))
2018-06-08 07:05:38 +08:00
Nicholas Nethercote
b0440d359b Avoid useless Vec clones in pending_obligations().
The only instance of `ObligationForest` in use has an obligation type of
`PendingPredicateObligation`, which contains a `PredicateObligation` and a
`Vec<Ty>`.

`FulfillmentContext::pending_obligations()` calls
`ObligationForest::pending_obligations()`, which clones all the
`PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned
obligations is never touched.

This patch changes `ObligationForest::pending_obligations()` to
`map_pending_obligations` -- which gives callers control about which part
of the obligation to clone -- and takes advantage of the change to avoid
cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf
benchmarks, the best by 1%.
2018-06-08 09:00:17 +10:00
Ralf Jung
579099ab57 Improve docs for slice::from_raw_parts 2018-06-07 23:53:30 +02:00
kennytm
32e8bda4e3
Use public DNS server instead of 169.254.169.254 on CI.
Tries to workaround travis-ci/travis-ci#9696.
2018-06-08 05:15:50 +08:00
kennytm
6e7affffac
Remove the gem update from .travis.yml
It has no effect on deployment error and may cause further network issues.
2018-06-08 04:31:30 +08:00
Esteban Küber
31bb50b6b9 Use from_inner_byte_pos for cleaner code 2018-06-07 09:47:09 -07:00
Adam Barth
0c6cd26aec [fuchsia] Migrate from launchpad to fdio_spawn_etc
fdio_spawn_etc is the preferred way of creating processes on Fuchsia
now.
2018-06-07 09:22:59 -07:00
Oliver Schneider
9b1bd94e37 Add existential type definitons 2018-06-07 17:33:53 +02:00
Pietro Albini
1df7817122
Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"
This reverts commit d6ba1b9b02, reversing
changes made to 8de5353f75.
2018-06-07 17:07:05 +02:00
scalexm
796ded2dfd Add tests for WellFormed-Type and FromEnv-Type rules 2018-06-07 14:45:09 +02:00
Oliver Schneider
0c1bcd3871 quiet-tests -> !verbose-tests 2018-06-07 14:40:36 +02:00
scalexm
09f6cb93ca Remove FromEnv(ProjectionEq(...)) from tests 2018-06-07 14:40:24 +02:00
scalexm
6656c0f09f Add rules for type well-formedness 2018-06-07 14:38:23 +02:00
Nicholas Nethercote
c83d152eba Introduce ProcessResult.
A tri-valued enum is nicer than Result<Option<T>>, and it's slightly
faster.
2018-06-07 20:34:39 +10:00
Nicholas Nethercote
f14b5d9ee6 Inline process_obligation.
It's very hot, and this speeds things up.
2018-06-07 20:32:12 +10:00
Nicholas Nethercote
b18a22a384 Inline and remove process_predicate.
Because it has a single callsite.

This patch is large but trivial, doing the minimal amount of work
(mostly `self.` insertions) necessary.
2018-06-07 20:32:09 +10:00
Nicholas Nethercote
cdfd9ca088 Simplify process_obligation.
`process_predicates` returns a
`Result<Option<Vec<PredicateObligation>>>`. `process_obligation` calls
it and then fiddles with the output (using `map`, `map`, `into_iter`,
`collect`) to produce a a
`Result<Option<Vec<PendingPredicateObligation>>>`.

This function is sufficiently hot that the fiddling is expensive. It's
much better for `process_predicate` to directly return a
`Result<Option<Vec<PendingPredicateObligation>>>` because `Ok(None)`
accounts for ~90% of the results, and `Ok(vec![])` accounts for another
~5%.
2018-06-07 20:25:05 +10:00
Oliver Schneider
0288ab03a9 Update the cargo submodule 2018-06-07 11:51:43 +02:00
Havvy
eccd2ede3c Use Ord::cmp for auto traits since stable sort not needed 2018-06-06 22:11:37 -07:00
Nick Cameron
acd4fe8974 Update RLS and Rustfmt 2018-06-07 15:14:49 +12:00
Esteban Küber
0e3f19d3f1 Do not account for inner/outer attr 2018-06-06 17:39:58 -07:00
Esteban Küber
3cc09c8380 Use consistent span for repr attr suggestion 2018-06-06 17:36:28 -07:00
bors
c131bdcaff Auto merge of #50699 - Zoxc:blocking-queries, r=mw
Blocking Rayon queries

r? @michaelwoerister
2018-06-06 22:24:07 +00:00
Esteban Küber
b3810f61da Add i/u size 2018-06-06 14:34:07 -07:00
Esteban Küber
9a80c2b994 Change repr documentation link 2018-06-06 14:33:07 -07:00
Niko Matsakis
b417701ac1 add an explanatory comment 2018-06-07 00:26:31 +03:00
Esteban Küber
451eb66a53 Expand (fix) u* and i* repr hints 2018-06-06 14:25:57 -07:00
Esteban Küber
48e45eec30 Add transparent as valid repr hint 2018-06-06 14:25:50 -07:00
Esteban Küber
3580de8c6d Turn warning into lint 2018-06-06 14:11:48 -07:00
Felix S. Klock II
e5b378b18d Update the expected error output to reflect changes in this PR. 2018-06-06 22:42:27 +02:00
Felix S. Klock II
9b24595226 Drive-by: Make assignment conflict tests in borrowck-vec-pattern-nesting.rs robust for NLL. 2018-06-06 22:42:27 +02:00
Felix S. Klock II
fbe7d5bce8 When NLL has illegal move due to borrowed content, provide feedback about why the move wasn't a copy.
This should address #51190.
2018-06-06 22:42:27 +02:00
Felix S. Klock II
50224ec1a9 It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck. Bravo! 2018-06-06 22:41:00 +02:00
bors
19d0b539aa Auto merge of #51263 - cramertj:futures-in-core, r=aturon
Add Future and task system to the standard library

This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary.

r? @aturon
2018-06-06 19:42:19 +00:00
Esteban Küber
2c7099baeb Expand output and suggestions, fix tests 2018-06-06 12:31:43 -07:00
Taylor Cramer
a6055c8859 Add Future and task system to the standard library 2018-06-06 10:41:52 -07:00
Esteban Küber
36381fabaf Warn on repr without hints 2018-06-06 10:02:09 -07:00
bors
cb8ab33ed2 Auto merge of #51333 - GuillaumeGomez:reexport-fmt-alignment, r=SimonSapin
Reexport fmt::Alignment into std

Follow-up of #51078.
2018-06-06 17:01:56 +00:00
Konrad Borowski
b7fcf8f576
Increase number of usages of u8 in weird expressions u8 test 2018-06-06 18:42:34 +02:00
Esteban Küber
7d0b6b75f0 When unable to sinthesize link span, fallback to previous behavior 2018-06-06 09:38:47 -07:00
Esteban Küber
507dfd2148 Use spans pointing at the inside of a rustdoc attribute 2018-06-06 08:49:42 -07:00
Gergely Nagy
f1c9247663 NLL performance boost 2018-06-06 17:31:24 +02:00
dylan_DPC
8ecbd351bb fix stderrs 2018-06-06 20:51:57 +05:30
bors
35aeecb8aa Auto merge of #51201 - estebank:dotdot, r=petrochenkov
Accept `..` in incorrect position to avoid further errors

We currently give a specific message when encountering a `..` anywhere
other than the end of a pattern. Modify the parser to accept it (while
still emitting the error) so that we don't also trigger "missing fields
in pattern" errors afterwards.

Add suggestions to either remove trailing `,` or moving the `..` to the
end.

Follow up to #49268.
2018-06-06 14:04:06 +00:00
John Kåre Alsaker
f273f285b8 Update Cargo 2018-06-06 15:25:47 +02:00
John Kåre Alsaker
131ef97c4b Reduce the amount of unsafe code and mark handle_deadlock as unsafe 2018-06-06 15:25:19 +02:00
John Kåre Alsaker
3e83248441 Add comments 2018-06-06 15:25:19 +02:00
John Kåre Alsaker
b2555bd545 Make QueryWaiter use safe code 2018-06-06 15:25:18 +02:00