Commit Graph

79507 Commits

Author SHA1 Message Date
Mark Rousskov
b370f0e646
Rollup merge of #51276 - Havvy:dyn-trait-send-send, r=nikomatsakis
Dedup auto traits in trait objects.

Fixes #47010

Note that the test file `run-pass/trait-object-auto-dedup.rs` passes before and after this change. It's the `ui` test that changed from compiling to not compiling. Which does make this a breaking change, but I cannot imagine anybody actually being broken by it.
2018-06-08 17:20:58 -06:00
Mark Rousskov
71865fb947
Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank
Fix Issue 38777

When looking through for a closing bracket in the loop condition, adds them to expecteds.
https://github.com/rust-lang/rust/issues/38777
2018-06-08 17:20:57 -06:00
Mark Rousskov
91b6842dc9
Rollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakis
Add deprecation lint for duplicated `macro_export`s

cc https://github.com/rust-lang/rust/issues/35896#issuecomment-381370556
2018-06-08 17:20:55 -06:00
David Cao
313d6c53df provide error message when using more than 65535 hash symbols for raw strings 2018-06-08 15:32:28 -07:00
tinaun
6e5c18e8dc add a few blanket future impls to std 2018-06-08 17:56:59 -04:00
Crazycolorz5
df0c6a97b4 Built, corrected, and run tests. Added expected stderr files. 2018-06-08 17:25:53 -04:00
bors
8afb894931 Auto merge of #51247 - pnkfelix:issue-51190-report-type-moved-from-behind-borrow, r=nikomatsakis
NLL: report type moved from behind borrow of array/slice

When NLL has illegal move due to borrowed content in an array or slice, provide feedback about why the move wasn't a copy.

Drive by: While comparing the resulting `.nll.stderr` files to their old borrowck variants, I noticed that the test for borrowck-vec-pattern-nesting.rs was not signaling some errors under NLL due to the test assuming lexical lifetimes. So I fixed that too.

Fix #51190
2018-06-08 20:41:20 +00:00
bstrie
9a8fa2cf92 Document size_of for 128-bit integers
We might want to consider separately documenting the alignment of
primitives, rather than just their size, since 128-bit integers, unlike
all other primitives, have an alignment that is not identical to their
size (size_of is 16, align_of is 8)
2018-06-08 19:20:28 +00:00
Lukas Bergdoll
0bc8d4ef2c Fix spelling error in CONTRIBUTING.md 2018-06-08 19:44:04 +02:00
bors
c40275b34f Auto merge of #51410 - oli-obk:cargo_bump, r=nikomatsakis
Update the cargo submodule

This allows the next nightly to publish crates that are on the 2018 edition (in an unstable way)
2018-06-08 17:04:14 +00:00
Matthew Jasper
a1bddcfe7b Normalize associated types when checking global bounds 2018-06-08 17:00:56 +01:00
Matthew Jasper
9d7613abee Fix a typo 2018-06-08 17:00:49 +01:00
Matthew Jasper
0476a875d1 Test that object bounds are preferred over global where clause bounds 2018-06-08 17:00:36 +01:00
Matthew Jasper
87f63ca258 Add tests for associated types and inconsistent bounds 2018-06-08 17:00:26 +01:00
Matthew Jasper
ba35e80534 Reenable trivial bounds
Removes extra global bounds at the winnowing stage rather than when
normalizing the param_env. This avoids breaking inference when there is
a global bound.
2018-06-08 17:00:03 +01:00
Evgenii Pashkin
cb5e9731bb Add test for libsyntax with canonicalized base path 2018-06-08 18:05:01 +03:00
est31
c28145d1ad rustbuild: generate full list of dependencies for metadata
Previously, we didn't send --features to our cargo metadata invocations,
and thus missed some dependencies that we enable through the --features
mechanism.
2018-06-08 16:50:56 +02:00
Mark Simulacrum
721f2e789a Do not require stage 2 compiler for rustdoc 2018-06-08 08:29:15 -06:00
Oliver Schneider
20f759fdce Fix rustdoc 2018-06-08 11:09:05 +02:00
Kyle Simpson
ec08622192 compiletest: autoremove duplicate .nll.* files (#51204)
UI tests in bless mode should now check to see if `.nll.*` files have a
matching `.*` file. If a match is found, it will be deleted.
This should be extensible to other modes (i.e., Polonius).
On running with `--bless`, the two files removed in #51186 are, in turn,
removed automatically.
2018-06-08 01:10:34 +01:00
Oliver Schneider
6e5e35458c Add a sanity test for nesting other items inside the existential type 2018-06-08 01:10:18 +02:00
bors
1b4c921103 Auto merge of #51426 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #51186 (Remove two redundant .nll.stderr files)
 - #51283 (Deny #[cfg] and #[cfg_attr] on generic parameters.)
 - #51368 (Fix the use of closures within #[panic_implementation])
 - #51380 (Remove dependency on fmt_macros from typeck)
 - #51389 (rustdoc: Fix missing stability and src links for inlined external macros)
 - #51399 (NLL performance boost)
 - #51407 (Update RLS and Rustfmt)
 - #51417 (Revert #49719)
 - #51420 (Tries to address the recent network issues)

Failed merges:
2018-06-07 23:06:39 +00:00
kennytm
34cd36e2f2
Rollup merge of #51420 - kennytm:some-network-issues, r=Mark-Simulacrum
Tries to address the recent network issues

1. Set the DNS server to 8.8.8.8/8.8.4.4/1.1.1.1/1.0.0.1 to workaround the daily "Cannot resolve host" error these two weeks.
2. Remove the unnecessary command `gem update --system` (originally added as experiment of the "Could not find a valid gem" error, which turns out to be useless).
2018-06-08 07:05:48 +08:00
kennytm
e46ef1bb86
Rollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakis
Revert #49719

This also needs to be backported into beta.

Fixes #51416.
r? @nikomatsakis
2018-06-08 07:05:47 +08:00
kennytm
c843607bcc
Rollup merge of #51407 - nrc:update, r=Mark-Simulacrum
Update RLS and Rustfmt

r? @Mark-Simulacrum

Fixes tests
2018-06-08 07:05:45 +08:00
kennytm
326331c34f
Rollup merge of #51399 - ngg:nll-performance, r=nikomatsakis
NLL performance boost

This makes compilation of the [inflate](https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks/inflate) benchmark compile 2 times faster on my computer when NLL is enabled.
This does not fix the #51377 perfectly, it's still 4-5 times slower than without NLL, but it's a start.
2018-06-08 07:05:44 +08:00
kennytm
d5759daf64
Rollup merge of #51389 - ollie27:rustdoc_cross_macro_src_stab, r=QuietMisdreavus
rustdoc: Fix missing stability and src links for inlined external macros

Fixes #38951

r? @QuietMisdreavus
2018-06-08 07:05:43 +08:00
kennytm
b94b89b2ee
Rollup merge of #51380 - Mark-Simulacrum:remove-fmt-macros, r=oli-obk
Remove dependency on fmt_macros from typeck

None
2018-06-08 07:05:42 +08:00
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