94973 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
d51002ce07
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.
2019-06-19 01:52:10 +02:00
Mazdak Farrokhzad
dcd5b20177
Rollup merge of #61896 - eddyb:correct-self-ctor, r=petrochenkov
rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.

Fixes #61882.

r? @petrochenkov cc @varkor
2019-06-19 01:52:09 +02:00
Mazdak Farrokhzad
4f24715745
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.
2019-06-19 01:52:07 +02:00
Mazdak Farrokhzad
de8066f73f
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
2019-06-19 01:52:06 +02:00
Mazdak Farrokhzad
404c854d03
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)
2019-06-19 01:52:04 +02:00
Mazdak Farrokhzad
e416932bab
Rollup merge of #61802 - mjbshaw:maybe-uninit-transparent, r=cramertj
Make MaybeUninit #[repr(transparent)]

Tracking issue: #60405
2019-06-19 01:52:03 +02:00
Mazdak Farrokhzad
06d2a891c7
Rollup merge of #61748 - estebank:transparent-span, r=Centril
Tweak transparent enums and unions diagnostic spans
2019-06-19 01:52:01 +02:00
Mazdak Farrokhzad
65da792afa
Rollup merge of #61701 - RalfJung:const-tests, r=cramertj
move stray run-pass const tests into const/ folder

r? @oli-obk
2019-06-19 01:51:59 +02:00
Mazdak Farrokhzad
9a7016d67d
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
2019-06-19 01:51:58 +02:00
bors
04a3dd8a87 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
2019-06-18 19:04:15 +00:00
Alex Crichton
831ddf700d 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.
2019-06-18 09:51:39 -07:00
bors
673cf7de44 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
2019-06-18 16:08:17 +00:00
Eduard-Mihai Burtescu
2be847b2f9 test: normalize away the line/column info in ui/pattern/const-pat-ice. 2019-06-18 18:10:26 +03:00
Eduard-Mihai Burtescu
ea78c3aa33 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-18 18:10:26 +03:00
Eduard-Mihai Burtescu
4c4fc7512e rustc: reintroduce lifetime bounds where necessary. 2019-06-18 18:10:26 +03:00
Eduard-Mihai Burtescu
356a37d8d1 rustc: remove unused lifetimes. 2019-06-18 18:10:26 +03:00
Eduard-Mihai Burtescu
1d0cb40908 rustc: remove leftover lifetimes with no bounds from where clauses. 2019-06-18 18:10:25 +03:00
Eduard-Mihai Burtescu
b25b466a88 rustc: remove 'x: 'y bounds (except from comments/strings). 2019-06-18 18:10:21 +03:00
Eduard-Mihai Burtescu
dedf2eda8f rustc_typeck: correctly compute Substs for Res::SelfCtor. 2019-06-18 17:02:26 +03:00
Matthias Krüger
6a084dc0e7 submodules: update clippy from be5d17fe to 868f168c
Changes:
````
rustup https://github.com/rust-lang/rust/pull/61836/
fix suggestion for floating points inequality
````
2019-06-18 15:43:41 +02:00
Michael Bradshaw
0f9dc6c48e Make MaybeUninit #[repr(transparent)]
Tracking issue: #60405
2019-06-18 06:31:23 -07:00
bors
44fb88d252 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
2019-06-18 11:18:45 +00:00
bors
0376941156 Auto merge of #61822 - JohnTitor:add-long-e0592, r=GuillaumeGomez,Centril
Add explanation for E0592

This is a part of #61137

r? @GuillaumeGomez
2019-06-18 08:30:38 +00:00
Vadim Petrochenkov
e152554e11 resolve/expand: Move expansion info setting to a single earlier point 2019-06-18 11:01:20 +03:00
Vadim Petrochenkov
1ff3bce5bb hygiene: Avoid some unnecessary ExpnInfo clones 2019-06-18 10:48:56 +03:00
Vadim Petrochenkov
2de2278f1a syntax: Move default_transparency into ExpnInfo 2019-06-18 10:48:56 +03:00
Vadim Petrochenkov
8ec502eecd syntax: Introduce default/with_unstable constructors for ExpnInfo 2019-06-18 10:48:56 +03:00
Vadim Petrochenkov
68e1141c45 resolve: Avoid creating fresh syntax extensions for all non-macro attributes 2019-06-18 10:48:56 +03:00
Vadim Petrochenkov
085a8d0375 syntax: Remove DummyResolver 2019-06-18 10:48:56 +03:00
Vadim Petrochenkov
679000cc0e allow_internal_unstable: Avoid some more allocations 2019-06-18 10:48:56 +03:00
Vadim Petrochenkov
961ba8f9ef syntax: Factor out common fields from SyntaxExtension variants 2019-06-18 10:48:56 +03:00
Ralf Jung
2987704062 update miri 2019-06-18 08:14:03 +02:00
bors
a6a8f6c5b3 Auto merge of #61864 - lzutao:ptr-null, r=sfackler
Make use of `ptr::null(_mut)` instead of casting zero

There are few places that I don't replace the zero casting pointer with `ptr::null`
or `ptr::null_mut`:
```bash
% git grep -E '[ ([{]0 as \*'
src/libcore/ptr/mod.rs:216:pub const fn null<T>() -> *const T { 0 as *const T }
src/libcore/ptr/mod.rs:231:pub const fn null_mut<T>() -> *mut T { 0 as *mut T }
src/test/run-pass/consts/const-cast-ptr-int.rs:12:static a: TestStruct = TestStruct{x: 0 as *const u8};
src/test/ui/issues/issue-45730.rs:5:    let x: *const _ = 0 as *const _; //~ ERROR cannot cast
src/test/ui/issues/issue-45730.rs:8:    let x = 0 as *const i32 as *const _ as *mut _; //~ ERROR cannot cast
src/test/ui/issues/issue-45730.stderr:14:LL |     let x: *const _ = 0 as *const _;
src/test/ui/issues/issue-45730.stderr:24:LL |     let x = 0 as *const i32 as *const _ as *mut _;
src/test/ui/lint/lint-forbid-internal-unsafe.rs:15:    println!("{}", evil!(*(0 as *const u8)));
src/test/ui/order-dependent-cast-inference.rs:5:    let mut y = 0 as *const _;
src/test/ui/order-dependent-cast-inference.stderr:4:LL |     let mut y = 0 as *const _;
```

r? @sfackler
2019-06-18 05:16:26 +00:00
bors
704ab2ba10 Auto merge of #61771 - ehuss:update-cargo, r=alexcrichton
Update cargo

Update cargo

19 commits in 545f354259be4e9745ea00a524c0e4c51df01aa6..807429e1b6da4e2ec52488ef2f59e77068c31e1f
2019-05-23 17:45:30 +0000 to 2019-06-11 14:06:10 +0000
- Stabilize publish-lockfile. (rust-lang/cargo#7026)
- change package cache lock message (rust-lang/cargo#7029)
- Fix documenting an example. (rust-lang/cargo#7023)
- Fix nonconcurrent tests (rust-lang/cargo#6900)
- Update git2 crates for libgit2 0.28 (rust-lang/cargo#7018)
- fix bunch of clippy warnings (rust-lang/cargo#7019)
- Ignore remap-path-prefix in metadata hash. (rust-lang/cargo#6966)
- Don't synthesize feature diretives for non-optional deps (rust-lang/cargo#7010)
- Handle pipelined tests of libraries (rust-lang/cargo#7008)
- Import the cargo-vendor subcommand into Cargo (rust-lang/cargo#6869)
- Remove unnecessary outlives bounds (rust-lang/cargo#7000)
- Catch filename output collisions in rustdoc. (rust-lang/cargo#6998)
- the testing SAT solver was messed up by a refactor (rust-lang/cargo#6995)
- Add some hints to the docs for `cfg()` targets (rust-lang/cargo#6990)
- Test the Resolver against the varisat Library (rust-lang/cargo#6980)
- Update changelog. (rust-lang/cargo#6984)
- Update cache-messages tracking issue. (rust-lang/cargo#6987)
- zsh: Add --all-targets option to cargo-check and cargo-build (rust-lang/cargo#6985)
- Fix typo (rust-lang/cargo#6982)
2019-06-18 02:17:17 +00:00
bors
9f22ddf6bb Auto merge of #61915 - Centril:rollup-oire3i8, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #61702 (test more variants of enum-int-casting)
 - #61836 (Replace some uses of NodeId with HirId)
 - #61885 (Help LLVM better optimize slice::Iter(Mut)::len)
 - #61893 (make `Weak::ptr_eq`s into methods)
 - #61908 (don't ICE on large files)

Failed merges:

r? @ghost
2019-06-17 23:30:37 +00:00
Yuki Okushi
3d5ef11f1a Improve wording 2019-06-18 07:53:27 +09:00
Eric Huss
afa4827e98 Bump libgit2-sys to get it to compile on i686-pc-windows-gnu. 2019-06-17 14:34:43 -07:00
Eric Huss
6b25e53538 Add syn to workspace hack.
Cargo's syn now has the `full` feature, so add it here to keep it in sync.
2019-06-17 14:34:43 -07:00
Eric Huss
aedb74b8c3 Update cargo 2019-06-17 14:34:43 -07:00
Mazdak Farrokhzad
6fe2653156
Rollup merge of #61908 - matklad:overflow, r=petrochenkov
don't ICE on large files

This is an extremely marginal error, so the cost of properly threading
`Handler` everywhere just not seemed justified. However, it's useful
to panic when we create a file, and not when we slice strings with
overflown indexes somewhere in the guts of the compiler.

For this reason, while we provide safe `try_new_source_file`, we don't
change the existing public interface and just panic more or less
cleanly.

closes #61904

r? @petrochenkov
2019-06-17 20:56:01 +02:00
Mazdak Farrokhzad
04d6539025
Rollup merge of #61893 - chpio:weak_ptr_eq_methods, r=rkruppe
make `Weak::ptr_eq`s into methods

This makes the `Weak::ptr_eq`s associated function into methods. There's no reason for methods on `Weak`s to be associated functions, as there is no `Dered` thus no possibility of a collision. Also: methods can be called using the associated function syntax.

follow up on https://github.com/rust-lang/rust/pull/55987
[Tracking issue for weak_ptr_eq](https://github.com/rust-lang/rust/issues/55981)
2019-06-17 20:56:00 +02:00
Mazdak Farrokhzad
2d3d0b7e93
Rollup merge of #61885 - scottmcm:slice-iter-len-opt, r=rkruppe,RalfJung
Help LLVM better optimize slice::Iter(Mut)::len

r? @RalfJung

I've included a codegen test that fails without this change as a demonstration of usefulness.
2019-06-17 20:55:58 +02:00
Mazdak Farrokhzad
0800b6ee20
Rollup merge of #61836 - ljedrz:i_still_hate_node_ids, r=ljedrz
Replace some uses of NodeId with HirId

We are still using `NodeId` in some spots where we could use `HirId` instead; this PR targets some of these spots and removes some of the associated `hir::map` functions.
2019-06-17 20:55:57 +02:00
Mazdak Farrokhzad
a2259aae7d
Rollup merge of #61702 - RalfJung:const-enum-cast, r=oli-obk
test more variants of enum-int-casting

As I learned in https://github.com/rust-lang/rust/pull/61673#issuecomment-500213506, there is a code path we are not testing yet. Looks like enum-int-casting with and without an intermediate let-binding is totally different.

EDIT: The reason for this is to get rid of the cycle in definitions such as:
```rust
enum Foo {
    A = 0,
    B = Foo::A as isize + 2,
}
```
This has historically been supported, so a hack adding special treatment to `Enum::Variant as _` was added to keep supporting it.
2019-06-17 20:55:55 +02:00
ljedrz
e1bf56de25 remove superfluous space 2019-06-17 20:31:26 +02:00
bors
b25ee64497 Auto merge of #61781 - christianpoveda:intptrcast-model, r=oli-obk,RalfJung
prepare for Intptrcast model

https://github.com/rust-lang/rust/pull/61668 done right (I hope so). r? @RalfJung @oli-obk
2019-06-17 18:04:15 +00:00
ljedrz
61e004d68e fix rebase fallout 2019-06-17 19:05:26 +02:00
ljedrz
72bb5c7067 change NodeId to HirId in some HIR docs 2019-06-17 18:59:27 +02:00
ljedrz
88961b049e simplify ICE handling in HirIdValidator 2019-06-17 18:59:27 +02:00
ljedrz
21fbb59500 fix a HIR doc, simplify one HIR-related function call 2019-06-17 18:59:27 +02:00