]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #62000 - JohnTitor:add-test-issue-54189, r=cramertj
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:29 +0000 (22:14 +0200)]
Rollup merge of #62000 - JohnTitor:add-test-issue-54189, r=cramertj

Add test for issue-54189

Closes #54189

5 years agoRollup merge of #61996 - Xanewok:unescape-raw-strings, r=matklad
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:28 +0000 (22:14 +0200)]
Rollup merge of #61996 - Xanewok:unescape-raw-strings, r=matklad

Add unit tests for unescaping raw (byte) strings

Adds unit tests for functionality introduced in #60793.

r? @matklad @petrochenkov

5 years agoRollup merge of #61981 - rust-lang:generators-clone-doc, r=cramertj
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:26 +0000 (22:14 +0200)]
Rollup merge of #61981 - rust-lang:generators-clone-doc, r=cramertj

Closures implement Copy and Clone, generators don't

5 years agoRollup merge of #61979 - spastorino:fmt-place-base, r=oli-obk
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:25 +0000 (22:14 +0200)]
Rollup merge of #61979 - spastorino:fmt-place-base, r=oli-obk

Implement Debug for PlaceBase

r? @oli-obk

More tiny bits that can be extracted from Place 2.0 PR

5 years agoRollup merge of #61900 - s3bk:master, r=sfackler
Mazdak Farrokhzad [Thu, 20 Jun 2019 20:14:24 +0000 (22:14 +0200)]
Rollup merge of #61900 - s3bk:master, r=sfackler

implement Error::source for Box<T: Error>

fixes https://github.com/rust-lang/rust/issues/61899

5 years agoAdd test for issue-54189
Yuki Okushi [Thu, 20 Jun 2019 15:19:11 +0000 (00:19 +0900)]
Add test for issue-54189

5 years agoAuto merge of #61998 - eddyb:type-name-params, r=oli-obk
bors [Thu, 20 Jun 2019 15:11:08 +0000 (15:11 +0000)]
Auto merge of #61998 - eddyb:type-name-params, r=oli-obk

rustc_mir: support type parameters by printing them as `_`.

Fixes #61894.
r? @oli-obk

5 years agorustc_mir: support type parameters by printing them as `_`.
Eduard-Mihai Burtescu [Thu, 20 Jun 2019 14:48:02 +0000 (17:48 +0300)]
rustc_mir: support type parameters by printing them as `_`.

5 years agoImplement Debug for PlaceBase
Santiago Pastorino [Thu, 20 Jun 2019 01:02:53 +0000 (03:02 +0200)]
Implement Debug for PlaceBase

5 years agoAuto merge of #61929 - 95th:master, r=GuillaumeGomez
bors [Thu, 20 Jun 2019 12:18:25 +0000 (12:18 +0000)]
Auto merge of #61929 - 95th:master, r=GuillaumeGomez

Fix Into trait docs links

https://doc.rust-lang.org/std/convert/trait.Into.html

5 years agoFix Into trait links
Gurwinder Singh [Tue, 18 Jun 2019 07:37:11 +0000 (13:07 +0530)]
Fix Into trait links

5 years agoAdd unit tests for unescaping raw (byte) strings
Igor Matuszewski [Thu, 20 Jun 2019 07:37:20 +0000 (09:37 +0200)]
Add unit tests for unescaping raw (byte) strings

5 years agoAuto merge of #61983 - Centril:rollup-wnfo07y, r=Centril
bors [Thu, 20 Jun 2019 07:46:11 +0000 (07:46 +0000)]
Auto merge of #61983 - Centril:rollup-wnfo07y, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #60454 (Add custom nth_back to Skip)
 - #60772 (Implement nth_back for slice::{Iter, IterMut})
 - #61782 (suggest tuple struct syntax)
 - #61968 (rustc: disallow cloning HIR nodes.)

Failed merges:

r? @ghost

5 years agoRollup merge of #61968 - eddyb:hir-noclone, r=petrochenkov
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:36:03 +0000 (08:36 +0200)]
Rollup merge of #61968 - eddyb:hir-noclone, r=petrochenkov

rustc: disallow cloning HIR nodes.

Besides being inefficient, cloning also risks creating broken HIR (without properly recreating all the IDs and whatnot, in which case you might as well reconstruct the entire node without ever `Clone`-ing anything).

We detect *some* detrimental situations (based on the occurrence of `HirId`s, I believe?), but it's better to statically disallow it, IMO.

One of the examples that is fixed by this PR is `tcx.hir().fn_decl{,_by_hir_id}`, which was cloning an entire `hir::FnDecl` *every single time it was called*.

r? @petrochenkov cc @rust-lang/compiler

5 years agoRollup merge of #61782 - Electron-libre:suggest_tuple_struct_syntax, r=estebank
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:36:01 +0000 (08:36 +0200)]
Rollup merge of #61782 - Electron-libre:suggest_tuple_struct_syntax, r=estebank

suggest tuple struct syntax

refs #57242

5 years agoRollup merge of #60772 - timvermeulen:slice_iter_nth_back, r=scottmcm
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:36:00 +0000 (08:36 +0200)]
Rollup merge of #60772 - timvermeulen:slice_iter_nth_back, r=scottmcm

Implement nth_back for slice::{Iter, IterMut}

Part of #54054.

I implemented `nth_back` as straightforwardly as I could, and then slightly changed `nth` to match `nth_back`. I believe I did so correctly, but please double-check ðŸ™‚

I also added the helper methods `zst_shrink`, `next_unchecked`, and `next_back_unchecked` to get rid of some duplicated code. These changes hopefully make this code easier to understand for new contributors like me.

I noticed the `is_empty!` and `len!` macros which sole purpose seems to be inlining, according to the comment right above them, but the `is_empty` and `len` methods are already marked with `#[inline(always)]`. Does that mean we could replace these macros with method calls, without affecting anything? I'd love to get rid of them.

5 years agoRollup merge of #60454 - acrrd:issues/54054_skip, r=scottmcm
Mazdak Farrokhzad [Thu, 20 Jun 2019 06:35:58 +0000 (08:35 +0200)]
Rollup merge of #60454 - acrrd:issues/54054_skip, r=scottmcm

Add custom nth_back to Skip

Implementation of nth_back for Skip.
Part of #54054

5 years agoClosures implement Copy and Clone, generators don't
Jake Goulding [Thu, 20 Jun 2019 03:03:33 +0000 (23:03 -0400)]
Closures implement Copy and Clone, generators don't

5 years agoAuto merge of #60341 - mtak-:macos-tlv-workaround, r=alexcrichton
bors [Thu, 20 Jun 2019 02:36:49 +0000 (02:36 +0000)]
Auto merge of #60341 - mtak-:macos-tlv-workaround, r=alexcrichton

macos tlv workaround

fixes: #60141

Includes:
* remove dead code: `requires_move_before_drop`. This hasn't been needed for a while now (oops I should have removed it in #57655)
* redox had a copy of `fast::Key` (not sure why?). That has been removed.
* Perform a `read_volatile` on OSX to reduce `tlv_get_addr` calls per `__getit` from (4-2 depending on context) to 1.

`tlv_get_addr` is relatively expensive (~1.5ns on my machine).

Previously, in contexts where `__getit` was inlined, 4 calls to `tlv_get_addr` were performed per lookup. For some reason when `__getit` is not inlined this is reduced to 2x - and performance improves to match.

After this PR, I have only ever seen 1x call to `tlv_get_addr` per `__getit`, and macos now benefits from situations where `__getit` is inlined.

I'm not sure if the `read_volatile(&&__KEY)` trick is working around an LLVM bug, or a rustc bug, or neither.

r? @alexcrichton

5 years agoAuto merge of #61947 - estebank:ice-ice-revolution, r=matthewjasper
bors [Wed, 19 Jun 2019 22:23:45 +0000 (22:23 +0000)]
Auto merge of #61947 - estebank:ice-ice-revolution, r=matthewjasper

 Fix ICE involving mut references

Fix #61623, fix #61944, fix #61751.

5 years agoAuto merge of #61967 - lzutao:clippy-update, r=oli-obk
bors [Wed, 19 Jun 2019 19:28:28 +0000 (19:28 +0000)]
Auto merge of #61967 - lzutao:clippy-update, r=oli-obk

submodules: Update clippy from 868f168c to 149a988

r? @oli-obk

5 years agofix compile-fail test for targets without thread locals
tyler [Wed, 19 Jun 2019 18:50:23 +0000 (11:50 -0700)]
fix compile-fail test for targets without thread locals

5 years agorustc: disallow cloning HIR nodes.
Eduard-Mihai Burtescu [Wed, 12 Jun 2019 08:43:15 +0000 (11:43 +0300)]
rustc: disallow cloning HIR nodes.

5 years agorustc: replace `GenericArgs::with_generic_args` hack with a plain getter.
Eduard-Mihai Burtescu [Wed, 12 Jun 2019 08:42:58 +0000 (11:42 +0300)]
rustc: replace `GenericArgs::with_generic_args` hack with a plain getter.

5 years agofix indentation
Cedric [Wed, 19 Jun 2019 17:47:52 +0000 (19:47 +0200)]
fix indentation

5 years agoUpdate clippy from 868f168c to 149a988
Lzu Tao [Wed, 19 Jun 2019 17:30:55 +0000 (17:30 +0000)]
Update clippy from 868f168c to 149a988

5 years agoAuto merge of #61962 - Centril:rollup-y6sg1zw, r=Centril
bors [Wed, 19 Jun 2019 16:37:58 +0000 (16:37 +0000)]
Auto merge of #61962 - Centril:rollup-y6sg1zw, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #60667 ( Add functions for building raw slices to libcore )
 - #61547 (Support `cfg` and `cfg_attr` on generic parameters)
 - #61861 (Update rustfmt and rls)
 - #61940 (Make Place::ty iterate)

Failed merges:

r? @ghost

5 years agoreview comment
Esteban Küber [Wed, 19 Jun 2019 16:25:20 +0000 (09:25 -0700)]
review comment

5 years agoRollup merge of #61940 - spastorino:place-ty-iterate, r=oli-obk
Mazdak Farrokhzad [Wed, 19 Jun 2019 15:34:39 +0000 (17:34 +0200)]
Rollup merge of #61940 - spastorino:place-ty-iterate, r=oli-obk

Make Place::ty iterate

r? @oli-obk

Related to Place 2.0

5 years agoRollup merge of #61861 - topecongiro:rustfmt-1.3.0, r=topecongiro
Mazdak Farrokhzad [Wed, 19 Jun 2019 15:34:38 +0000 (17:34 +0200)]
Rollup merge of #61861 - topecongiro:rustfmt-1.3.0, r=topecongiro

Update rustfmt and rls

This PR bumps the version of rustfmt to 1.3.0.

5 years agoRollup merge of #61547 - petrochenkov:cfgen, r=Centril
Mazdak Farrokhzad [Wed, 19 Jun 2019 15:34:36 +0000 (17:34 +0200)]
Rollup merge of #61547 - petrochenkov:cfgen, r=Centril

Support `cfg` and `cfg_attr` on generic parameters

`cfg` attributes are supported in all other positions where attributes are accepted at all.

They were previously prohibited in https://github.com/rust-lang/rust/pull/51283 because they weren't implemented correctly before that and were simply ignored.

5 years agoRollup merge of #60667 - oli-obk:raw_from_raw_parts, r=sfackler
Mazdak Farrokhzad [Wed, 19 Jun 2019 15:34:35 +0000 (17:34 +0200)]
Rollup merge of #60667 - oli-obk:raw_from_raw_parts, r=sfackler

 Add functions for building raw slices to libcore

implement https://github.com/rust-lang/rust/issues/36925

5 years agoUpdate rustfmt and rls
topecongiro [Tue, 18 Jun 2019 12:15:19 +0000 (21:15 +0900)]
Update rustfmt and rls

Update rustfmt to 1.3.0.

5 years agoAuto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkor
bors [Wed, 19 Jun 2019 12:41:38 +0000 (12:41 +0000)]
Auto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkor

Improve the explicit_outlives_requirements lint

* Don't use Strings to compare parameters
* Extend the lint to lifetime bounds
* Extend the lint to enums and unions
* Use the correct span for where clauses in tuple structs
* Try to early-out where possible
* Remove unnecessary bounds in rustc crates

5 years agoAuto merge of #58351 - oli-obk:double_check_const_eval, r=RalfJung
bors [Wed, 19 Jun 2019 09:43:58 +0000 (09:43 +0000)]
Auto merge of #58351 - oli-obk:double_check_const_eval, r=RalfJung

Refactor interning to properly mark memory as mutable or immutable

r? @RalfJung

This implementation is incomplete out of multiple reasons

* [ ] add `-Zunleash_the_miri_inside_of_you` tests
* [ ] report an error if there's an `UnsafeCell` behind a reference in a constant
* [ ] make validity checks actually test whether the mutability of their allocations match what they see in the type

5 years agopacked -> repr(packed)
Oliver Scherer [Wed, 19 Jun 2019 09:20:38 +0000 (11:20 +0200)]
packed -> repr(packed)

5 years agoFix comment about alignments
Oliver Scherer [Wed, 19 Jun 2019 09:15:29 +0000 (11:15 +0200)]
Fix comment about alignments

5 years agoprovide variant definition on tuple struct unknow field error
Cedric [Wed, 19 Jun 2019 09:09:17 +0000 (11:09 +0200)]
provide variant definition on tuple struct unknow field error

5 years agoRemove now-unnecessary lifetime
Oliver Scherer [Wed, 19 Jun 2019 08:34:32 +0000 (10:34 +0200)]
Remove now-unnecessary lifetime

5 years agoadt hint pointing to adt span
Cedric [Wed, 19 Jun 2019 08:07:07 +0000 (10:07 +0200)]
adt hint pointing to adt span

5 years agoMore FIXMEs
Oliver Scherer [Wed, 19 Jun 2019 08:03:53 +0000 (10:03 +0200)]
More FIXMEs

5 years agoSupport `cfg` and `cfg_attr` on generic parameters
Vadim Petrochenkov [Wed, 5 Jun 2019 14:59:37 +0000 (17:59 +0300)]
Support `cfg` and `cfg_attr` on generic parameters

5 years agoExplain existance of `Align` field
Oliver Scherer [Wed, 19 Jun 2019 07:57:07 +0000 (09:57 +0200)]
Explain existance of `Align` field

5 years agoWeave the alignment through `ByRef`
Oliver Scherer [Fri, 14 Jun 2019 09:29:52 +0000 (11:29 +0200)]
Weave the alignment through `ByRef`

5 years agoOutright ignore any alignment in `const_field`
Oliver Scherer [Thu, 13 Jun 2019 15:54:54 +0000 (17:54 +0200)]
Outright ignore any alignment in `const_field`

5 years agoUpdate ui test output
Oliver Scherer [Thu, 13 Jun 2019 15:41:25 +0000 (17:41 +0200)]
Update ui test output

5 years agoElaborate some more on what mutability field means what
Oliver Scherer [Thu, 13 Jun 2019 15:18:10 +0000 (17:18 +0200)]
Elaborate some more on what mutability field means what

5 years agoUpdate to `TyCtxt` lifetime changes
Oliver Scherer [Thu, 13 Jun 2019 15:17:50 +0000 (17:17 +0200)]
Update to `TyCtxt` lifetime changes

5 years agoFix typo
Oliver Scherer [Thu, 13 Jun 2019 15:05:56 +0000 (17:05 +0200)]
Fix typo

5 years agoThe future is now
Oliver Scherer [Thu, 13 Jun 2019 15:05:32 +0000 (17:05 +0200)]
The future is now

5 years agos/intern/intern_shallow/
Oliver Scherer [Thu, 13 Jun 2019 15:04:46 +0000 (17:04 +0200)]
s/intern/intern_shallow/

5 years agoAdd and update more tests
Oliver Scherer [Tue, 11 Jun 2019 14:17:26 +0000 (16:17 +0200)]
Add and update more tests

5 years agoElaborate on a comment
Oliver Scherer [Tue, 11 Jun 2019 14:17:17 +0000 (16:17 +0200)]
Elaborate on a comment

5 years agoMerge `StaticMut` and `Static` logic
Oliver Scherer [Tue, 11 Jun 2019 14:17:08 +0000 (16:17 +0200)]
Merge `StaticMut` and `Static` logic

5 years agoFix rebase fallout
Oliver Scherer [Tue, 11 Jun 2019 11:23:08 +0000 (13:23 +0200)]
Fix rebase fallout

5 years agoElaborate on why we don't look at frozenness
Oliver Scherer [Mon, 3 Jun 2019 16:39:38 +0000 (18:39 +0200)]
Elaborate on why we don't look at frozenness

5 years agoDon't ICE when pattern matching packed structs
Oliver Scherer [Mon, 3 Jun 2019 16:35:50 +0000 (18:35 +0200)]
Don't ICE when pattern matching packed structs

5 years agoPrevent cyclic locks of `alloc_map`
Oliver Scherer [Mon, 3 Jun 2019 15:49:14 +0000 (17:49 +0200)]
Prevent cyclic locks of `alloc_map`

5 years agoMake interning explicitly care about types and the mutability of memory
Oliver Scherer [Sun, 10 Feb 2019 13:59:13 +0000 (14:59 +0100)]
Make interning explicitly care about types and the mutability of memory

5 years agoFixmes and style fixes
Oliver Scherer [Tue, 5 Feb 2019 19:44:59 +0000 (20:44 +0100)]
Fixmes and style fixes

5 years agoAdd functions to build raw slices
Oliver Scherer [Wed, 19 Jun 2019 07:21:44 +0000 (09:21 +0200)]
Add functions to build raw slices

5 years agoAuto merge of #61945 - Centril:rollup-xdqo2mn, r=Centril
bors [Wed, 19 Jun 2019 06:49:13 +0000 (06:49 +0000)]
Auto merge of #61945 - Centril:rollup-xdqo2mn, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #61505 (Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages)
 - #61701 (move stray run-pass const tests into const/ folder)
 - #61748 (Tweak transparent enums and unions diagnostic spans)
 - #61802 (Make MaybeUninit #[repr(transparent)])
 - #61839 (ci: Add a script for generating CPU usage graphs)
 - #61842 (Remove unnecessary lift calls)
 - #61843 (Turn down the myriad-closures test)
 - #61896 (rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.)
 - #61898 (syntax: Factor out common fields from `SyntaxExtension` variants)
 - #61938 (create an issue for miri even in status test-fail)
 - #61941 (Preserve generator and yield source for error messages)

Failed merges:

r? @ghost

5 years agoFix ICE involving mut references
Esteban Küber [Wed, 19 Jun 2019 01:39:08 +0000 (18:39 -0700)]
Fix ICE involving mut references

5 years agoRollup merge of #61941 - cramertj:no-more-yield-errors, r=centril
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:13 +0000 (01:52 +0200)]
Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centril

Preserve generator and yield source for error messages

Previously, error messages after HIR lowering all referred
to generators and yield, regardless of whether the original
source was a generator or an async/await body. This change
tracks the kind of each generator and yield source in order
to provide appropriately tailored error messages.

Fixes #60615.

5 years agoRollup merge of #61938 - RalfJung:miri-toolstate, r=kennytm
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:12 +0000 (01:52 +0200)]
Rollup merge of #61938 - RalfJung:miri-toolstate, r=kennytm

create an issue for miri even in status test-fail

I fired up python to see that this parses, but I wouldn't know how to test this script.

5 years agoRollup merge of #61898 - petrochenkov:sekind, r=eddyb
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:10 +0000 (01:52 +0200)]
Rollup merge of #61898 - petrochenkov:sekind, r=eddyb

syntax: Factor out common fields from `SyntaxExtension` variants

And some other related cleanups.

Continuation of https://github.com/rust-lang/rust/pull/61606.
This will also help to unblock https://github.com/rust-lang/rust/pull/61877.

5 years agoRollup merge of #61896 - eddyb:correct-self-ctor, r=petrochenkov
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:09 +0000 (01:52 +0200)]
Rollup merge of #61896 - eddyb:correct-self-ctor, r=petrochenkov

rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.

Fixes #61882.

r? @petrochenkov cc @varkor

5 years agoRollup merge of #61843 - alexcrichton:disable-myriad-closures, r=pietroalbini
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:07 +0000 (01:52 +0200)]
Rollup merge of #61843 - alexcrichton:disable-myriad-closures, r=pietroalbini

Turn down the myriad-closures test

This tests takes nearly 5 minutes to compile on CI where the CPUs we
have aren't exactly the fastest. This test does actually require all
closures to exist to exhibit the original bug, but it seems a little
excessive to test a single bug on CI on all platforms which simply pegs
a single CPU for 5 minutes with no parallelism opportunities, so this
turns down the test to still exercise it somewhat at least.

5 years agoRollup merge of #61842 - Zoxc:trim-lift, r=eddyb
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:06 +0000 (01:52 +0200)]
Rollup merge of #61842 - Zoxc:trim-lift, r=eddyb

Remove unnecessary lift calls

Note that some of these might be useful for sanity checking that there's no infer types or regions.

r? @eddyb

5 years agoRollup merge of #61839 - alexcrichton:pr-and-master-builds, r=pietroalbini
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:04 +0000 (01:52 +0200)]
Rollup merge of #61839 - alexcrichton:pr-and-master-builds, r=pietroalbini

ci: Add a script for generating CPU usage graphs

This commit checks in a script which generates CPU usage graphs over
time, expanding on the previous comment that was include in the
collection file.

Some example graphs from the [latest build](https://dev.azure.com/rust-lang/rust/_build/results?buildId=717) look like:

![dist-x86_64-apple](https://user-images.githubusercontent.com/64996/59520676-16c5b000-8e90-11e9-9188-27001911f270.png)

![x86_64-msvc-1](https://user-images.githubusercontent.com/64996/59520677-175e4680-8e90-11e9-8568-4b564807324e.png)

![x86_64-mingw-1](https://user-images.githubusercontent.com/64996/59520680-175e4680-8e90-11e9-939d-a73c7224582f.png)

![test-various](https://user-images.githubusercontent.com/64996/59520682-175e4680-8e90-11e9-9980-900ed4eeb8f4.png)

5 years agoRollup merge of #61802 - mjbshaw:maybe-uninit-transparent, r=cramertj
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:03 +0000 (01:52 +0200)]
Rollup merge of #61802 - mjbshaw:maybe-uninit-transparent, r=cramertj

Make MaybeUninit #[repr(transparent)]

Tracking issue: #60405

5 years agoRollup merge of #61748 - estebank:transparent-span, r=Centril
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:52:01 +0000 (01:52 +0200)]
Rollup merge of #61748 - estebank:transparent-span, r=Centril

Tweak transparent enums and unions diagnostic spans

5 years agoRollup merge of #61701 - RalfJung:const-tests, r=cramertj
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:51:59 +0000 (01:51 +0200)]
Rollup merge of #61701 - RalfJung:const-tests, r=cramertj

move stray run-pass const tests into const/ folder

r? @oli-obk

5 years agoRollup merge of #61505 - ebarnard:doc-shrink, r=GuillaumeGomez
Mazdak Farrokhzad [Tue, 18 Jun 2019 23:51:58 +0000 (01:51 +0200)]
Rollup merge of #61505 - ebarnard:doc-shrink, r=GuillaumeGomez

Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages

In the "Implementors" and "Implementations on Foreign Types" sections, only show methods that appear in the `impl` block for that type. This has the benefit of
- Reducing the size of the Iterator page, and other large trait documentation pages.
- Retaining documentation on the `impl` blocks and functions in the `impl` blocks.
- Indicating which provided methods are overridden.
- Making the documentation match the structure of the code being documented.
- Being a small change that can be easily backed out if issues arise.

A set of Rust stdlib docs build with this change are [available here](https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/).

The size of the [`Iterator` doc page](https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/std/iter/trait.Iterator.html) is reduced from 14.4MB (latest nightly) to 724kB.

Before:
<img width="1411" alt="Screenshot 2019-06-03 at 23 12 17" src="https://user-images.githubusercontent.com/1059683/58837971-1722a780-8655-11e9-8d81-51e48130951d.png">

After:
<img width="1428" alt="Screenshot 2019-06-03 at 16 41 27" src="https://user-images.githubusercontent.com/1059683/58814907-84ffac80-861e-11e9-8692-79be473a5299.png">

cc #55900

5 years agoPreserve generator and yield source for error messages
Taylor Cramer [Tue, 18 Jun 2019 21:34:51 +0000 (14:34 -0700)]
Preserve generator and yield source for error messages

Previously, error messages after HIR lowering all referred
to generators and yield, regardless of whether the original
source was a generator or an async/await body. This change
tracks the kind of each generator and yield source in order
to provide appropriately tailored error messages.

5 years agoAddress review comments
Matthew Jasper [Fri, 31 May 2019 20:31:03 +0000 (21:31 +0100)]
Address review comments

5 years agoImprove the explicit_outlives_requirements lint
Matthew Jasper [Sat, 25 May 2019 09:28:17 +0000 (10:28 +0100)]
Improve the explicit_outlives_requirements lint

* Don't use Strings to compare parameters
* Extend the lint to lifetime bounds
* Extend the lint to enums and unions
* Use the correct span for where clauses in tuple structs
* Try to early-out where possible

5 years agoRemove an unnecessary HirId to DefId convertion
Matthew Jasper [Sat, 25 May 2019 09:12:30 +0000 (10:12 +0100)]
Remove an unnecessary HirId to DefId convertion

5 years agoRemove the HirId/NodeId from where clauses
Matthew Jasper [Sat, 25 May 2019 09:11:48 +0000 (10:11 +0100)]
Remove the HirId/NodeId from where clauses

Also give them a span in the HIR

5 years agoAuto merge of #59625 - immunant:copy_variadics_typealias, r=eddyb
bors [Tue, 18 Jun 2019 21:50:46 +0000 (21:50 +0000)]
Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddyb

Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation

We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively):
- redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag`
- add `Clone` for `VaListImpl`
- add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList`
- add deref coercion from `VaList` to `VaListImpl`
- add support for the `asmjs` target

All these changes were needed for use cases like:
```Rust
let mut ap2 = va_copy(ap);
vprintf(fmt, ap2);
va_end(&mut ap2);
```

5 years agoMake Place::ty iterate
Santiago Pastorino [Tue, 18 Jun 2019 20:06:00 +0000 (22:06 +0200)]
Make Place::ty iterate

5 years agoimprove indentation
Cedric [Tue, 18 Jun 2019 20:05:27 +0000 (22:05 +0200)]
improve indentation

5 years agocreate an issue for miri even in status test-fail
Ralf Jung [Tue, 18 Jun 2019 19:57:31 +0000 (21:57 +0200)]
create an issue for miri even in status test-fail

5 years agoAuto merge of #61891 - eddyb:lifetime-cleanups, r=oli-obk
bors [Tue, 18 Jun 2019 19:04:15 +0000 (19:04 +0000)]
Auto merge of #61891 - eddyb:lifetime-cleanups, r=oli-obk

rustc: remove 'x: 'y bounds (except where necessary or from comments/strings).

This PR removes all lifetime-lifetime "outlives" bounds (e.g. `'tcx: 'a`) bounds except a few necessary ones (see the `reintroduce lifetime bounds where necessary` commit).

Some of these bounds kept around otherwise-unused lifetimes (e.g. `<'a, 'tcx: 'a>` followed by uses of `'tcx` but not `'a`) - these lifetimes (i.e. `'a`) were then removed.
(maybe they should be considered unused by the lint? cc @matthewjasper @zackmdavis)

r? @oli-obk cc @rust-lang/compiler

5 years agoci: Add a script for generating CPU usage graphs
Alex Crichton [Fri, 14 Jun 2019 15:31:43 +0000 (08:31 -0700)]
ci: Add a script for generating CPU usage graphs

This commit checks in a script which generates CPU usage graphs over
time, expanding on the previous comment that was include in the
collection file.

5 years agoAuto merge of #61932 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Tue, 18 Jun 2019 16:08:17 +0000 (16:08 +0000)]
Auto merge of #61932 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from be5d17fe to 868f168c

Changes:
````
rustup https://github.com/rust-lang/rust/pull/61836/
fix suggestion for floating points inequality
````
r? @oli-obk

5 years agotest: normalize away the line/column info in ui/pattern/const-pat-ice.
Eduard-Mihai Burtescu [Sun, 16 Jun 2019 11:11:20 +0000 (14:11 +0300)]
test: normalize away the line/column info in ui/pattern/const-pat-ice.

5 years agoRun `rustfmt --file-lines ...` for changes from previous commits.
Eduard-Mihai Burtescu [Sun, 16 Jun 2019 09:41:24 +0000 (12:41 +0300)]
Run `rustfmt --file-lines ...` for changes from previous commits.

5 years agorustc: reintroduce lifetime bounds where necessary.
Eduard-Mihai Burtescu [Sun, 16 Jun 2019 09:33:47 +0000 (12:33 +0300)]
rustc: reintroduce lifetime bounds where necessary.

5 years agorustc: remove unused lifetimes.
Eduard-Mihai Burtescu [Sun, 16 Jun 2019 09:33:21 +0000 (12:33 +0300)]
rustc: remove unused lifetimes.

5 years agorustc: remove leftover lifetimes with no bounds from where clauses.
Eduard-Mihai Burtescu [Fri, 14 Jun 2019 16:43:53 +0000 (19:43 +0300)]
rustc: remove leftover lifetimes with no bounds from where clauses.

5 years agorustc: remove 'x: 'y bounds (except from comments/strings).
Eduard-Mihai Burtescu [Fri, 14 Jun 2019 16:39:39 +0000 (19:39 +0300)]
rustc: remove 'x: 'y bounds (except from comments/strings).

5 years agorustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.
Eduard-Mihai Burtescu [Sun, 16 Jun 2019 14:23:41 +0000 (17:23 +0300)]
rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.

5 years agosubmodules: update clippy from be5d17fe to 868f168c
Matthias Krüger [Tue, 18 Jun 2019 13:43:41 +0000 (15:43 +0200)]
submodules: update clippy from be5d17fe to 868f168c

Changes:
````
rustup https://github.com/rust-lang/rust/pull/61836/
fix suggestion for floating points inequality
````

5 years agoMake MaybeUninit #[repr(transparent)]
Michael Bradshaw [Wed, 12 Jun 2019 02:04:02 +0000 (19:04 -0700)]
Make MaybeUninit #[repr(transparent)]

Tracking issue: #60405

5 years agoAuto merge of #61927 - RalfJung:miri, r=oli-obk
bors [Tue, 18 Jun 2019 11:18:45 +0000 (11:18 +0000)]
Auto merge of #61927 - RalfJung:miri, r=oli-obk

update miri

Tests fail since https://github.com/rust-lang/rust/pull/61885, this should fix that.

r? @oli-obk

5 years agoAuto merge of #61822 - JohnTitor:add-long-e0592, r=GuillaumeGomez,Centril
bors [Tue, 18 Jun 2019 08:30:38 +0000 (08:30 +0000)]
Auto merge of #61822 - JohnTitor:add-long-e0592, r=GuillaumeGomez,Centril

Add explanation for E0592

This is a part of #61137

r? @GuillaumeGomez

5 years agoresolve/expand: Move expansion info setting to a single earlier point
Vadim Petrochenkov [Tue, 18 Jun 2019 07:48:44 +0000 (10:48 +0300)]
resolve/expand: Move expansion info setting to a single earlier point

5 years agohygiene: Avoid some unnecessary `ExpnInfo` clones
Vadim Petrochenkov [Mon, 17 Jun 2019 22:36:44 +0000 (01:36 +0300)]
hygiene: Avoid some unnecessary `ExpnInfo` clones

5 years agosyntax: Move `default_transparency` into `ExpnInfo`
Vadim Petrochenkov [Mon, 17 Jun 2019 20:55:22 +0000 (23:55 +0300)]
syntax: Move `default_transparency` into `ExpnInfo`