]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAdd test to ensure const-prop fails gracefully
Wesley Wiser [Wed, 15 May 2019 10:06:33 +0000 (06:06 -0400)]
Add test to ensure const-prop fails gracefully

5 years agoRun const propagation at O2
Wesley Wiser [Wed, 8 May 2019 10:42:41 +0000 (06:42 -0400)]
Run const propagation at O2

5 years agoAdd some tests for constant propagation
Wesley Wiser [Sat, 4 May 2019 01:58:16 +0000 (21:58 -0400)]
Add some tests for constant propagation

The results aren't ideal but they represent the current state.

5 years agoDo some simple constant propagation in the ConstProp pass
Wesley Wiser [Mon, 29 Apr 2019 01:58:40 +0000 (21:58 -0400)]
Do some simple constant propagation in the ConstProp pass

5 years agoAuto merge of #60526 - alexcrichton:wasm-main-symbols, r=oli-obk
bors [Mon, 6 May 2019 20:54:30 +0000 (20:54 +0000)]
Auto merge of #60526 - alexcrichton:wasm-main-symbols, r=oli-obk

rustc: Always handle exported symbols on the wasm target

Currently when linking an artifact rustc will only conditionally call
the `Linker::export_symbols` function, but this causes issues on some
targets, like WebAssembly, where it means that executable outputs will
not have the same symbols exported that cdylib outputs have. This commit
sinks the conditional call to `export_symbols` inside the various
implementations of the function that still need it, and otherwise the
wasm linker is configured to always pass through symbol visibility
lists.

5 years agoAuto merge of #53645 - varkor:const-generics-redux, r=eddyb
bors [Mon, 6 May 2019 16:43:25 +0000 (16:43 +0000)]
Auto merge of #53645 - varkor:const-generics-redux, r=eddyb

The Genesis of Generic Germination

*Long had its coming been foretold: a collaborative effort with @yodaldevoid, set in motion by @jplatte, to beget a new Kind: one of a very different Sort to those that come before it. Amidst promises of ineffable powers previously thought unobtainable, few dared believe that the prophecies were true. But as they gazed upon that which claimed to be the Beginning, a few gentle sparks of hope fluttered deep within. It was not Time yet. But it was a Sign. And maybe, for some, that was enough.*

There's a long way to go, but we're at the point where we would benefit from GitHub's reviewing capabilities.

r? @eddyb

5 years agoImplement `ToTrace` for `ty::Const`
varkor [Mon, 6 May 2019 14:07:46 +0000 (15:07 +0100)]
Implement `ToTrace` for `ty::Const`

5 years agoResolve a couple of `unimplemented!()`s
varkor [Mon, 6 May 2019 13:17:48 +0000 (14:17 +0100)]
Resolve a couple of `unimplemented!()`s

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAuto merge of #60337 - fabric-and-ink:hiridification, r=Zoxc
bors [Mon, 6 May 2019 13:41:28 +0000 (13:41 +0000)]
Auto merge of #60337 - fabric-and-ink:hiridification, r=Zoxc

A bit of HirIdification

A small contribution to #50928.

5 years agoRemove incorrect FIXME
varkor [Mon, 6 May 2019 13:16:28 +0000 (14:16 +0100)]
Remove incorrect FIXME

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoClean up `push_const_name`
varkor [Mon, 6 May 2019 13:16:07 +0000 (14:16 +0100)]
Clean up `push_const_name`

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoImplement TypeFoldable for InferConst
varkor [Mon, 6 May 2019 13:05:26 +0000 (14:05 +0100)]
Implement TypeFoldable for InferConst

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoIgnore const parameters when constructing type bounds in rustdoc
varkor [Mon, 6 May 2019 12:55:28 +0000 (13:55 +0100)]
Ignore const parameters when constructing type bounds in rustdoc

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoShift const vars through binders
varkor [Mon, 6 May 2019 12:55:14 +0000 (13:55 +0100)]
Shift const vars through binders

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoRemove duplicate comment
varkor [Mon, 6 May 2019 12:54:59 +0000 (13:54 +0100)]
Remove duplicate comment

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAuto merge of #60565 - Mark-Simulacrum:mailmap-fixes, r=pietroalbini
bors [Mon, 6 May 2019 10:42:19 +0000 (10:42 +0000)]
Auto merge of #60565 - Mark-Simulacrum:mailmap-fixes, r=pietroalbini

Update mailmap to proper syntax

Also updates my entry to the proper name

5 years agoAuto merge of #60436 - Xanewok:update-rls, r=Manishearth
bors [Mon, 6 May 2019 06:00:43 +0000 (06:00 +0000)]
Auto merge of #60436 - Xanewok:update-rls, r=Manishearth

Update RLS and Cargo

Fixes the `test-fail` RLS toolstate caused by #59114.

r? @Centril @Manishearth

5 years agoAuto merge of #60569 - RalfJung:miri-visitor-generators, r=Centril
bors [Mon, 6 May 2019 03:11:14 +0000 (03:11 +0000)]
Auto merge of #60569 - RalfJung:miri-visitor-generators, r=Centril

fix typo in enum variant name

5 years agoAuto merge of #60261 - matklad:one-escape, r=petrochenkov
bors [Mon, 6 May 2019 00:16:16 +0000 (00:16 +0000)]
Auto merge of #60261 - matklad:one-escape, r=petrochenkov

introduce unescape module

A WIP PR to gauge early feedback

Currently, we deal with escape sequences twice: once when we [lex](https://github.com/rust-lang/rust/blob/112f7e9ac564e2cfcfc13d599c8376a219fde1bc/src/libsyntax/parse/lexer/mod.rs#L928-L1065) a string, and a second time when we [unescape](https://github.com/rust-lang/rust/blob/112f7e9ac564e2cfcfc13d599c8376a219fde1bc/src/libsyntax/parse/mod.rs#L313-L366) literals. Note that we also produce different sets of diagnostics in these two cases.

This PR aims to remove this duplication, by introducing a new `unescape` module as a single source of truth for character escaping rules.

I think this would be a useful cleanup by itself, but I also need this for https://github.com/rust-lang/rust/pull/59706.

In the current state, the PR has `unescape` module which fully (modulo bugs) deals with string and char literals. I am quite happy about the state of this module

What this PR doesn't have yet are:
* [x] handling of byte and byte string literals (should be simple to add)
* [x] good diagnostics
* [x] actual removal of code from lexer (giant `scan_char_or_byte` should go away completely)
* [x] performance check
* [x] general cleanup of the new code

Diagnostics will be the most labor-consuming bit here, but they are mostly a question of just correctly adjusting spans to sub-tokens. The current setup for diagnostics is that `unescape` produces a plain old `enum` with various problems, and they are rendered into `Handler` separately. This bit is not actually required (it is possible to just pass the `Handler` in), but I like the separation between diagnostics and logic this approach imposes, and such separation should again be useful for #59706

cc @eddyb , @petrochenkov

5 years agoAuto merge of #60567 - Manishearth:rollup-rjagqnw, r=Manishearth
bors [Sun, 5 May 2019 21:11:47 +0000 (21:11 +0000)]
Auto merge of #60567 - Manishearth:rollup-rjagqnw, r=Manishearth

Rollup of 5 pull requests

Successful merges:

 - #60131 (Fix broken link in rustc_plugin doc)
 - #60426 (Stop `-O`/`-C opt-level` and `-g`/`-C debuginfo` conflicting)
 - #60515 (use span instead of div for since version)
 - #60530 (rustc: rename all occurences of "freevar" to "upvar".)
 - #60536 (Correct code points to match their textual description)

Failed merges:

r? @ghost

5 years agofix typo in enum variant name
Ralf Jung [Sun, 5 May 2019 20:53:56 +0000 (22:53 +0200)]
fix typo in enum variant name

5 years agoRollup merge of #60536 - brainplot:fix-unicode-character, r=dtolnay
Manish Goregaokar [Sun, 5 May 2019 19:37:31 +0000 (12:37 -0700)]
Rollup merge of #60536 - brainplot:fix-unicode-character, r=dtolnay

Correct code points to match their textual description

Probably due to a copy-paste error, in the sentence

> For example, despite looking similar, the 'é' character is one Unicode code point while 'é' is two Unicode code points:

the two `é`'s were actually the same character in the text (i.e. the same Unicode character U+00E9).
The code listing below instead had two different Unicode characters for the two `é`s, as it was supposed to.
The example shown wasn't clear at first so I started inspecting the text and found this out.
I simply copied the character from the code listing to the description surrounding the code.
It's a minor thing but I thought it would make things clearer for others, especially since the example is about how Rust handles `char`s.

5 years agoRollup merge of #60530 - eddyb:unfreevars, r=oli-obk
Manish Goregaokar [Sun, 5 May 2019 19:37:30 +0000 (12:37 -0700)]
Rollup merge of #60530 - eddyb:unfreevars, r=oli-obk

rustc: rename all occurences of "freevar" to "upvar".

Most of the more recent code talks about "(closure) upvars", so I believe that's the name we want to use.
There's also the possibility of using "capture" which is more user-facing, but I'd rather not change *both* "freevar" and "upvar" to something else in this one PR.

cc @nikomatsakis @petrochenkov

5 years agoRollup merge of #60515 - euclio:div-in-heading, r=GuillaumeGomez
Manish Goregaokar [Sun, 5 May 2019 19:37:29 +0000 (12:37 -0700)]
Rollup merge of #60515 - euclio:div-in-heading, r=GuillaumeGomez

use span instead of div for since version

Fixes #60403.

r? @GuillaumeGomez

5 years agoRollup merge of #60426 - varkor:fix-duplicate-arg-handling, r=alexcrichton
Manish Goregaokar [Sun, 5 May 2019 19:37:27 +0000 (12:37 -0700)]
Rollup merge of #60426 - varkor:fix-duplicate-arg-handling, r=alexcrichton

Stop `-O`/`-C opt-level` and `-g`/`-C debuginfo` conflicting

Allow `-O` and `-C opt-level`, and `-g` and `-C debuginfo` to be specified simultaneously without conflict. In such cases, the rightmost provided option is chosen.

Fixes https://github.com/rust-lang/rust/issues/7493.
Fixes https://github.com/rust-lang/rust/issues/32352.

~Blocked on https://github.com/rust-lang-nursery/getopts/pull/79.~

r? @alexcrichton

5 years agoRollup merge of #60131 - agnxy:doc-link, r=ehuss
Manish Goregaokar [Sun, 5 May 2019 19:37:26 +0000 (12:37 -0700)]
Rollup merge of #60131 - agnxy:doc-link, r=ehuss

Fix broken link in rustc_plugin doc

fix #57489
r? @steveklabnik

5 years agoAuto merge of #60237 - saleemjaffer:issue-56166-miri-fntype-arg-passing, r=eddyb
bors [Sun, 5 May 2019 18:25:13 +0000 (18:25 +0000)]
Auto merge of #60237 - saleemjaffer:issue-56166-miri-fntype-arg-passing, r=eddyb

Move pointee_info_at from rustc_codegen_llvm to rustc_target.

Makes progress towards #56166.

This is a continuation of https://github.com/rust-lang/rust/pull/57150.

@oli-obk Should I close the older PR?

5 years agocode review fixes
Saleem Jaffer [Sun, 5 May 2019 18:09:04 +0000 (23:39 +0530)]
code review fixes

5 years agoUpdate mailmap to proper syntax
Mark Rousskov [Sun, 5 May 2019 18:06:59 +0000 (12:06 -0600)]
Update mailmap to proper syntax

Also updates my entry to the proper name

5 years agorustc: rename all occurences of "freevar" to "upvar".
Eduard-Mihai Burtescu [Sat, 4 May 2019 00:57:46 +0000 (03:57 +0300)]
rustc: rename all occurences of "freevar" to "upvar".

5 years agorustc: replace uses of with_freevars with the freevars query.
Eduard-Mihai Burtescu [Sat, 4 May 2019 00:47:16 +0000 (03:47 +0300)]
rustc: replace uses of with_freevars with the freevars query.

5 years agoAuto merge of #60541 - RalfJung:miri-visitor-generators, r=oli-obk
bors [Sun, 5 May 2019 15:28:08 +0000 (15:28 +0000)]
Auto merge of #60541 - RalfJung:miri-visitor-generators, r=oli-obk

fix Miri visiting generators

Fixes fall-out caused by https://github.com/rust-lang/rust/pull/59897.

r? @oli-obk

5 years agoAuto merge of #60544 - petrochenkov:parder, r=eddyb
bors [Sun, 5 May 2019 12:30:14 +0000 (12:30 +0000)]
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

5 years agoUpdate Cargo.lock
varkor [Sat, 4 May 2019 15:08:34 +0000 (16:08 +0100)]
Update Cargo.lock

5 years agoMove run-make test to run-make-fulldeps
varkor [Sat, 4 May 2019 13:53:22 +0000 (14:53 +0100)]
Move run-make test to run-make-fulldeps

5 years agoUpdate getopts to 0.2.19
varkor [Thu, 2 May 2019 09:32:56 +0000 (10:32 +0100)]
Update getopts to 0.2.19

5 years agoAdd comments
varkor [Wed, 1 May 2019 22:23:35 +0000 (23:23 +0100)]
Add comments

5 years agoAdd a run-make test for command aliases
varkor [Tue, 30 Apr 2019 20:52:54 +0000 (21:52 +0100)]
Add a run-make test for command aliases

5 years agoFix argument alias handling for -g and -C debuginfo
varkor [Tue, 30 Apr 2019 20:52:05 +0000 (21:52 +0100)]
Fix argument alias handling for -g and -C debuginfo

5 years agoFix argument alias handling for -O and -C opt-level
varkor [Tue, 30 Apr 2019 20:51:55 +0000 (21:51 +0100)]
Fix argument alias handling for -O and -C opt-level

5 years agoAuto merge of #60525 - eddyb:namespaces-not-kinds, r=petrochenkov
bors [Sun, 5 May 2019 06:34:13 +0000 (06:34 +0000)]
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

5 years agoAuto merge of #60508 - varkor:const-generics-fold-ct-err, r=petrochenkov
bors [Sun, 5 May 2019 03:39:16 +0000 (03:39 +0000)]
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.

5 years agoAuto merge of #60476 - froydnj:aarch64-profiling, r=alexcrichton
bors [Sun, 5 May 2019 00:40:38 +0000 (00:40 +0000)]
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.

5 years agoAuto merge of #60415 - jespersm:pr_unused_import_45268, r=petrochenkov
bors [Sat, 4 May 2019 21:50:11 +0000 (21:50 +0000)]
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.

5 years agoEarly error for mixing order of const and type parameters
varkor [Sat, 4 May 2019 13:38:10 +0000 (14:38 +0100)]
Early error for mixing order of const and type parameters

5 years agoRevert Cargo.lock changes accidentally introduced during rebase
Vadim Petrochenkov [Sat, 4 May 2019 21:12:38 +0000 (00:12 +0300)]
Revert Cargo.lock changes accidentally introduced during rebase

5 years agoDelegate SmallVec's stable_hash to array's stable_hash.
Jesper Steen Møller [Thu, 2 May 2019 18:16:48 +0000 (20:16 +0200)]
Delegate SmallVec's stable_hash to array's stable_hash.

5 years agoHash all of the import_ids for the TraitCandidate.
Jesper Steen Møller [Thu, 2 May 2019 13:08:03 +0000 (15:08 +0200)]
Hash all of the import_ids for the TraitCandidate.

5 years agoRemoved unneccesary reference for trait name
Jesper Steen Møller [Thu, 2 May 2019 11:40:12 +0000 (13:40 +0200)]
Removed unneccesary reference for trait name

5 years agoUse binding autoref, because we can.
Jesper Steen Møller [Thu, 2 May 2019 09:56:45 +0000 (11:56 +0200)]
Use binding autoref, because we can.

5 years agoReuse 'kind' parameter.
Jesper Steen Møller [Thu, 2 May 2019 06:31:15 +0000 (08:31 +0200)]
Reuse 'kind' parameter.

5 years agoImproved name: first_import_id
Jesper Steen Møller [Thu, 2 May 2019 06:30:16 +0000 (08:30 +0200)]
Improved name: first_import_id

5 years agoRevert the introduced typedefs
Jesper Steen Møller [Thu, 2 May 2019 06:27:57 +0000 (08:27 +0200)]
Revert the introduced typedefs

5 years agoFix misleading indentation
Jesper Steen Møller [Wed, 1 May 2019 13:17:43 +0000 (15:17 +0200)]
Fix misleading indentation

5 years agoFix #45268 by saving all NodeId's for resolved traits.
Jesper Steen Møller [Tue, 30 Apr 2019 13:59:29 +0000 (15:59 +0200)]
Fix #45268 by saving all NodeId's for resolved traits.

5 years agoRemove `Res::Label`
Vadim Petrochenkov [Sat, 4 May 2019 14:22:00 +0000 (17:22 +0300)]
Remove `Res::Label`

Paths can never resolve to labels

5 years agoRename `Res::kind_name` to `Res::descr` for consistency
Vadim Petrochenkov [Sat, 4 May 2019 12:22:00 +0000 (15:22 +0300)]
Rename `Res::kind_name` to `Res::descr` for consistency

5 years agoRename `PathResolution` to `PartialRes`
Vadim Petrochenkov [Sat, 4 May 2019 12:18:58 +0000 (15:18 +0300)]
Rename `PathResolution` to `PartialRes`

Don't use `PartialRes` when `Res` is enough

5 years agoAdd tests
varkor [Fri, 3 May 2019 13:42:38 +0000 (14:42 +0100)]
Add tests

5 years agoFix subst error for consts in wfcheck
varkor [Fri, 3 May 2019 13:42:32 +0000 (14:42 +0100)]
Fix subst error for consts in wfcheck

5 years agoFix subst error for consts in astconv
varkor [Fri, 3 May 2019 13:42:04 +0000 (14:42 +0100)]
Fix subst error for consts in astconv

5 years agoImprove subst error when parameter kinds mismatch
varkor [Fri, 3 May 2019 13:41:47 +0000 (14:41 +0100)]
Improve subst error when parameter kinds mismatch

5 years agoAuto merge of #60538 - matthiaskrgr:submodule_upd, r=eddyb
bors [Sat, 4 May 2019 13:08:58 +0000 (13:08 +0000)]
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

5 years agoremoving param_env from pointee_info_at
Saleem Jaffer [Sat, 4 May 2019 12:36:40 +0000 (18:06 +0530)]
removing param_env from pointee_info_at

5 years agomatch on type directlty
Ralf Jung [Sat, 4 May 2019 11:49:04 +0000 (13:49 +0200)]
match on type directlty

5 years agofix Miri visiting generators
Ralf Jung [Sat, 4 May 2019 11:14:56 +0000 (13:14 +0200)]
fix Miri visiting generators

5 years agoresolving conflicts
Saleem Jaffer [Sat, 4 May 2019 10:40:47 +0000 (16:10 +0530)]
resolving conflicts

5 years agoAuto merge of #60117 - sunfishcode:wasi-os, r=sunfishcode
bors [Sat, 4 May 2019 10:22:05 +0000 (10:22 +0000)]
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.

5 years agoadding HasParamEnv trait
Saleem Jaffer [Sat, 4 May 2019 09:32:22 +0000 (15:02 +0530)]
adding HasParamEnv trait

5 years agoadding is_freeze to TyLayoutMethods
Saleem Jaffer [Fri, 3 May 2019 07:35:10 +0000 (13:05 +0530)]
adding is_freeze to TyLayoutMethods

5 years agoremoving map_same from MaybeResult
Saleem Jaffer [Tue, 30 Apr 2019 06:49:53 +0000 (12:19 +0530)]
removing map_same from MaybeResult

5 years agosubmodules: update clippy from 2ed0b3bf to fc96aa03
Matthias Krüger [Sat, 4 May 2019 09:47:37 +0000 (11:47 +0200)]
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
````

5 years agoadd to_result to ty::MaybeResult
Saleem Jaffer [Thu, 25 Apr 2019 12:52:34 +0000 (18:22 +0530)]
add to_result to ty::MaybeResult

5 years agotidy fixes
Saleem Jaffer [Wed, 24 Apr 2019 15:55:56 +0000 (21:25 +0530)]
tidy fixes

5 years agoresolving conflicts
Saleem Jaffer [Wed, 24 Apr 2019 14:59:46 +0000 (20:29 +0530)]
resolving conflicts

5 years agoimpl `pointee_info_at` in TyLayout.
Daan de Graaf [Mon, 11 Mar 2019 20:26:49 +0000 (21:26 +0100)]
impl `pointee_info_at` in TyLayout.

5 years agoMake line fit within 100 character limit.
Daan de Graaf [Fri, 11 Jan 2019 10:26:47 +0000 (11:26 +0100)]
Make line fit within 100 character limit.

5 years agoAdd param_env parameter to pointee_info_at.
Daan de Graaf [Fri, 28 Dec 2018 14:19:23 +0000 (15:19 +0100)]
Add param_env parameter to pointee_info_at.

An associated type ParamEnv has been added to TyLayoutMethods to
facilitate this.

5 years agoRemove old pointee_info_at body.
Daan de Graaf [Fri, 28 Dec 2018 12:15:39 +0000 (13:15 +0100)]
Remove old pointee_info_at body.

5 years agoReturn instead of collecting to mut result.
Daan de Graaf [Fri, 28 Dec 2018 11:52:31 +0000 (12:52 +0100)]
Return instead of collecting to mut result.

5 years agoFix typo in src/librustc/ty/layout.rs
Oliver Scherer [Fri, 28 Dec 2018 11:23:23 +0000 (12:23 +0100)]
Fix typo in src/librustc/ty/layout.rs

Co-Authored-By: wildarch <daandegraaf9@gmail.com>
5 years agoMove pointee_info_at to TyLayoutMethods.
Daan de Graaf [Mon, 24 Dec 2018 16:52:50 +0000 (17:52 +0100)]
Move pointee_info_at to TyLayoutMethods.

The original implementation is still present at
librustc_codegen_llvm/abi.rs, should be removed later to prevent code
duplication.

5 years agoRemove `def_path_from_id`, `node_id_to_string`
Fabian Drinck [Sat, 27 Apr 2019 20:39:17 +0000 (22:39 +0200)]
Remove `def_path_from_id`, `node_id_to_string`

5 years agoReplace `NodeId` variant of `read`
Fabian Drinck [Sat, 27 Apr 2019 17:24:45 +0000 (19:24 +0200)]
Replace `NodeId` variant of `read`

5 years agoRemove obsolete comment
Fabian Drinck [Sat, 27 Apr 2019 17:23:00 +0000 (19:23 +0200)]
Remove obsolete comment

5 years agoAuto merge of #60537 - Centril:rollup-42jxz82, r=Centril
bors [Sat, 4 May 2019 07:40:13 +0000 (07:40 +0000)]
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

5 years agoRollup merge of #60527 - davidtwco:issue-60518, r=cramertj
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:34 +0000 (09:21 +0200)]
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

5 years agoRollup merge of #60521 - rasendubi:tidy-2018-edition, r=Centril
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:32 +0000 (09:21 +0200)]
Rollup merge of #60521 - rasendubi:tidy-2018-edition, r=Centril

Migrate tidy to rust 2018 edition

cc @Centril

5 years agoRollup merge of #60520 - matklad:rustfmt-all-the-new-things, r=Centril
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:31 +0000 (09:21 +0200)]
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

5 years agoRollup merge of #60517 - estebank:wording, r=davidtwco
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:29 +0000 (09:21 +0200)]
Rollup merge of #60517 - estebank:wording, r=davidtwco

Reword casting message

r? @davidtwco

5 years agoRollup merge of #60516 - JohnTitor:remove-typeck, r=matthewjasper
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:27 +0000 (09:21 +0200)]
Rollup merge of #60516 - JohnTitor:remove-typeck, r=matthewjasper

Remove TypeckMir

Fixes #60422

r? @matthewjasper

5 years agoRollup merge of #60513 - chrisvittal:remove-borrowck-compare, r=matthewjasper
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:26 +0000 (09:21 +0200)]
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

5 years agoRollup merge of #60486 - spastorino:place-related-refactors, r=oli-obk
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:24 +0000 (09:21 +0200)]
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

5 years agoRollup merge of #60449 - matthewjasper:impl-trait-outlives, r=pnkfelix
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:23 +0000 (09:21 +0200)]
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

5 years agoRollup merge of #60429 - estebank:pub-path, r=michaelwoerister
Mazdak Farrokhzad [Sat, 4 May 2019 07:21:21 +0000 (09:21 +0200)]
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.

5 years agoBump libc dependency to 0.2.54.
Dan Gohman [Fri, 3 May 2019 13:43:25 +0000 (06:43 -0700)]
Bump libc dependency to 0.2.54.

5 years agoCategorize WASI as an "OS" rather than as an "environment".
Dan Gohman [Fri, 19 Apr 2019 16:59:35 +0000 (09:59 -0700)]
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.

5 years agoCorrect code points to match their textual description
Gianluca Recchia [Sat, 4 May 2019 05:44:30 +0000 (07:44 +0200)]
Correct code points to match their textual description

5 years agoAuto merge of #59897 - tmandry:variantful-generators, r=eddyb
bors [Sat, 4 May 2019 03:18:14 +0000 (03:18 +0000)]
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

5 years agoAddress review comments
Tyler Mandry [Fri, 3 May 2019 23:11:39 +0000 (16:11 -0700)]
Address review comments