Commit Graph

92943 Commits

Author SHA1 Message Date
Mark Rousskov
91e0c253ed Update mailmap to proper syntax
Also updates my entry to the proper name
2019-05-05 12:06:59 -06:00
bors
5d8fd98d34 Auto merge of #60544 - petrochenkov:parder, r=eddyb
Rename `PathResolution` to `PartialRes`

Don't use `PartialRes` when `Res` is enough.
Rename `Res::kind_name` to `Res::descr` for consistency.
Remove `Res::Label`, paths can never resolve to labels.

Some further cleanup after https://github.com/rust-lang/rust/pull/60462
r? @eddyb
2019-05-05 12:30:14 +00:00
bors
d65e721ef8 Auto merge of #60525 - eddyb:namespaces-not-kinds, r=petrochenkov
rustc: collapse relevant DefPathData variants into {Type,Value,Macro,Lifetime}Ns.

`DefPathData` was meant to disambiguate within each namespace, but over the years, that purpose was overlooked, and it started to serve a double-role as a sort of `DefKind` (which #60462 properly adds).
Now, we can go back to *only* categorizing namespaces (at least for the variants with names in them).

r? @petrochenkov or @nikomatsakis cc @michaelwoerister
2019-05-05 06:34:13 +00:00
bors
c55b68aaef Auto merge of #60508 - varkor:const-generics-fold-ct-err, r=petrochenkov
Fix substs issues for const errors

Fixes https://github.com/rust-lang/rust/issues/60503.
2019-05-05 03:39:16 +00:00
bors
a823fa4fa8 Auto merge of #60476 - froydnj:aarch64-profiling, r=alexcrichton
build dist-aarch64-linux with --enable-profiler

This change should enable PGO to be used for aarch64-linux.

Fixes #57257.
2019-05-05 00:40:38 +00:00
bors
747dd57e0f Auto merge of #60415 - jespersm:pr_unused_import_45268, r=petrochenkov
Fix #45268 by saving all NodeId's for resolved traits.

This fixes #45268 by saving all NodeId's for resolved traits.

I've verifies this against master (but only on MacOS). However, with some recent changes in master, it appears that there are some failures on my machine. They are unrelated to my changes, anyway.
2019-05-04 21:50:11 +00:00
varkor
3e6787cb4c Early error for mixing order of const and type parameters 2019-05-04 22:28:08 +01:00
Vadim Petrochenkov
f5b5ca8b23 Revert Cargo.lock changes accidentally introduced during rebase 2019-05-05 00:12:38 +03:00
Jesper Steen Møller
6da7649f61 Delegate SmallVec's stable_hash to array's stable_hash. 2019-05-04 20:29:35 +02:00
Jesper Steen Møller
6802082039 Hash all of the import_ids for the TraitCandidate. 2019-05-04 20:29:35 +02:00
Jesper Steen Møller
fc34d5f608 Removed unneccesary reference for trait name 2019-05-04 20:29:35 +02:00
Jesper Steen Møller
7dbb5e3b49 Use binding autoref, because we can. 2019-05-04 20:29:34 +02:00
Jesper Steen Møller
42255d93ef Reuse 'kind' parameter. 2019-05-04 20:29:34 +02:00
Jesper Steen Møller
719890502e Improved name: first_import_id 2019-05-04 20:29:34 +02:00
Jesper Steen Møller
a300cab526 Revert the introduced typedefs 2019-05-04 20:29:34 +02:00
Jesper Steen Møller
5d2be7d1fa Fix misleading indentation 2019-05-04 20:29:33 +02:00
Jesper Steen Møller
5deec307f7 Fix #45268 by saving all NodeId's for resolved traits. 2019-05-04 20:29:33 +02:00
Vadim Petrochenkov
7da9250fb5 Remove Res::Label
Paths can never resolve to labels
2019-05-04 17:22:00 +03:00
Vadim Petrochenkov
85ddd1dc58 Rename Res::kind_name to Res::descr for consistency 2019-05-04 16:55:46 +03:00
Vadim Petrochenkov
917a0fbc1b Rename PathResolution to PartialRes
Don't use `PartialRes` when `Res` is enough
2019-05-04 16:55:46 +03:00
varkor
47f373128a Add tests 2019-05-04 14:39:43 +01:00
varkor
823293bf16 Fix subst error for consts in wfcheck 2019-05-04 14:39:43 +01:00
varkor
c187f71120 Fix subst error for consts in astconv 2019-05-04 14:39:43 +01:00
varkor
0439efbbee Improve subst error when parameter kinds mismatch 2019-05-04 14:39:43 +01:00
bors
8dd4aae9a8 Auto merge of #60538 - matthiaskrgr:submodule_upd, r=eddyb
submodules: update clippy from 2ed0b3bf to fc96aa03

Changes:
````
Rustup to rustc 1.36.0-nightly (13fde05b1 2019-05-03)
Fix link in into_iter_on_array documentation
remove function body from "too many args" span
check closure arguments before use it
format code
fix suggestion for search_is_some
fix suggestion for search_is_some naively
change |&x| to |x| in stderr file
cargo fmt
useless_let_if_seq handle interior mutability
````
Fixes https://github.com/rust-lang/rust/issues/60534
2019-05-04 13:08:58 +00:00
bors
d0a6ddfe10 Auto merge of #60117 - sunfishcode:wasi-os, r=sunfishcode
Categorize WASI as an "OS" rather than as an "environment".

This distinction is fairly abstract, but in practice, the main advantage
here is that LLVM's triple code considers WASI to be an OS, so this
makes rustc agree with that.
2019-05-04 10:22:05 +00:00
Matthias Krüger
9bd6a7a680 submodules: update clippy from 2ed0b3bf to fc96aa03
Changes:
````
Rustup to rustc 1.36.0-nightly (13fde05b1 2019-05-03)
Fix link in into_iter_on_array documentation
remove function body from "too many args" span
check closure arguments before use it
format code
fix suggestion for search_is_some
fix suggestion for search_is_some naively
change |&x| to |x| in stderr file
cargo fmt
useless_let_if_seq handle interior mutability
````
2019-05-04 11:47:37 +02:00
bors
2f1bc91803 Auto merge of #60537 - Centril:rollup-42jxz82, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #60429 (Account for paths in incorrect pub qualifier help)
 - #60449 (Constrain all regions in the concrete type for an opaque type)
 - #60486 (Place related refactors)
 - #60513 (Remove -Z borrowck=compare flag)
 - #60516 (Remove TypeckMir)
 - #60517 (Reword casting message)
 - #60520 (Add rustfmt toml)
 - #60521 (Migrate tidy to rust 2018 edition)
 - #60527 (Fix async fn lowering ICE with APIT.)

Failed merges:

r? @ghost
2019-05-04 07:40:13 +00:00
Mazdak Farrokhzad
1599877c7e
Rollup merge of #60527 - davidtwco:issue-60518, r=cramertj
Fix async fn lowering ICE with APIT.

Fixes #60518.

This PR fixes an ICE where simple bindings (which aren't replaced with replacement arguments during async fn lowering) were not being visited in the def collector and thus caused an ICE during HIR lowering for types that use their `DefId` at that point - such as `impl Trait`.

r? @cramertj
2019-05-04 09:21:34 +02:00
Mazdak Farrokhzad
10f5a36664
Rollup merge of #60521 - rasendubi:tidy-2018-edition, r=Centril
Migrate tidy to rust 2018 edition

cc @Centril
2019-05-04 09:21:32 +02:00
Mazdak Farrokhzad
68dcca8e09
Rollup merge of #60520 - matklad:rustfmt-all-the-new-things, r=Centril
Add rustfmt toml

This commit adds an rustfmt.toml for using for **new** code.
Old code should continut to use old style, until we put automated
style checks in place.

See
https://internals.rust-lang.org/t/running-rustfmt-on-rust-lang-rust-and-other-rust-lang-repositories/8732/81
for the reason why we deviate from the default formatting. The TL;DR
is that currently compiler uses a pretty condensed style of code, and
default settings both create a huge diff and inflate the number of
lines. use_small_heuristics=Max fixes that.

version=Two is required for bug-fixes, which technically can't be made
to the stable first version

cc @Centril: I guess adding config file with agreed-upon formatting doesn't hurt :-)

EDIT: Zullip discussion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/x.2Epy.20fmt
2019-05-04 09:21:31 +02:00
Mazdak Farrokhzad
099c06465b
Rollup merge of #60517 - estebank:wording, r=davidtwco
Reword casting message

r? @davidtwco
2019-05-04 09:21:29 +02:00
Mazdak Farrokhzad
3cfd39bb2e
Rollup merge of #60516 - JohnTitor:remove-typeck, r=matthewjasper
Remove TypeckMir

Fixes #60422

r? @matthewjasper
2019-05-04 09:21:27 +02:00
Mazdak Farrokhzad
ffc33b3733
Rollup merge of #60513 - chrisvittal:remove-borrowck-compare, r=matthewjasper
Remove -Z borrowck=compare flag

This is the start of the work that needs to be done on #59193. It just removes the flag and updates
the tests.

r? @matthewjasper
2019-05-04 09:21:26 +02:00
Mazdak Farrokhzad
0399d1349e
Rollup merge of #60486 - spastorino:place-related-refactors, r=oli-obk
Place related refactors

Meanwhile I was working on Place 2 I'm finding some little things that I had on my branch but preferred to land a separate PR for things that are simpler to merge.

r? @oli-obk
2019-05-04 09:21:24 +02:00
Mazdak Farrokhzad
b4c620dc05
Rollup merge of #60449 - matthewjasper:impl-trait-outlives, r=pnkfelix
Constrain all regions in the concrete type for an opaque type

`push_outlives_components` skips some regions in a type, notably the signature
of a closure is ignored. Most of the time this is OK, but for opaque types the
concrete type is used when checking auto-trait bounds in other functions.

cc @nikomatsakis @pnkfelix

Closes #57464
Closes #60127
2019-05-04 09:21:23 +02:00
Mazdak Farrokhzad
6a86be9fca
Rollup merge of #60429 - estebank:pub-path, r=michaelwoerister
Account for paths in incorrect pub qualifier help

Handle case where incorrect pub qualifier with a mod path is used and provide the same help given for all other incorrect qualifiers by making the `pub(crate)` parse check more specific.
2019-05-04 09:21:21 +02:00
Dan Gohman
c07b52e29a Bump libc dependency to 0.2.54. 2019-05-03 23:01:24 -07:00
Dan Gohman
33ea556cb5 Categorize WASI as an "OS" rather than as an "environment".
This distinction is fairly abstract, but in practice, the main advantage
here is that LLVM's triple code considers WASI to be an OS, so this
makes rustc agree with that.
2019-05-03 23:01:24 -07:00
bors
e232636693 Auto merge of #59897 - tmandry:variantful-generators, r=eddyb
Multi-variant layouts for generators

This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants.

Required for optimizing generator layouts (#52924).

There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible.

This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator.

Also, fixes #59972.

Future work:
- Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924)
- In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172)
- Preserve debuginfo scopes across generator yield points
2019-05-04 03:18:14 +00:00
Tyler Mandry
77a6d29f48 Address review comments 2019-05-03 19:25:35 -07:00
Eduard-Mihai Burtescu
60f1944ebf rustc: rename DefPathData::{MacroDef,LifetimeParam} to {Macro,Lifetime}Ns. 2019-05-04 05:10:46 +03:00
Eduard-Mihai Burtescu
2efeb485a9 rustc: collapse relevant DefPathData variants into ValueNs. 2019-05-04 05:10:46 +03:00
Eduard-Mihai Burtescu
e5b9f54cd9 rustc: collapse relevant DefPathData variants into TypeNs. 2019-05-04 05:10:46 +03:00
bors
13fde05b12 Auto merge of #60462 - eddyb:def-1-a-mere-resolution, r=petrochenkov
rustc: factor out most of hir::def::Def's variants into DefKind, and rename to Res.

The first two commits are about introducing `DefKind`, both to simplify/orthogonalize `hir::def::Def`, and to allow reasoning about the kind of a definition without dealing with the redundant `DefId`.
(There are likely more changes to be made, such as adding enough `DefKind` variants for `tcx.def_kind(def_id)` to return just `DefKind`, not `Option<DefKind>`, but this is pretty big as-is)

The third commit frees up the `Def` name (which we may want to use in the future for "definitions", in the sense of "entities with a `DefId`") by renaming `hir::def::Def` to `Res` ("resolution").
IMO this fits, as it represents all the possible name resolution results, not just "definitions (with a `DefId`)".

Quick examples:
```rust
// Before:
if tcx.describe_def(def_id) == Some(Def::Struct(def_id)) {...}
if let Def::Struct(def_id) = path.def {...}
```
```rust
// After:
if tcx.def_kind(def_id) == Some(DefKind::Struct) {...}
if let Res::Def(DefKind::Struct, def_id) = path.res {...}
```

r? @petrochenkov cc @rust-lang/compiler
2019-05-03 23:11:17 +00:00
Tyler Mandry
15dbe652ff Split out debuginfo from type info in MIR GeneratorLayout 2019-05-03 16:03:05 -07:00
David Wood
f346309562
Fix async fn lowering ICE with APIT.
This commit fixes an ICE where simple bindings (which aren't replaced
with replacement arguments during async fn lowering) were not being
visited in the def collector and thus caused an ICE during HIR lowering
for types that use their `DefId` at that point - such as `impl Trait`.
2019-05-03 22:36:35 +01:00
Christopher Vittal
db6f7a9d1a Update help message 2019-05-03 17:34:17 -04:00
Tyler Mandry
f7c2f2475a Make variant_fields inner an IndexVec 2019-05-03 14:25:22 -07:00
Eduard-Mihai Burtescu
ff174fe09e rustc: rename hir::def::Def to Res (short for "resolution"). 2019-05-03 22:50:19 +03:00