]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #60638 - RalfJung:pin, r=sanxiyn
Mazdak Farrokhzad [Thu, 9 May 2019 16:34:53 +0000 (18:34 +0200)]
Rollup merge of #60638 - RalfJung:pin, r=sanxiyn

pin: make the to-module link more visible

Cc @gnzlbg

5 years agoRollup merge of #60601 - SimonSapin:cast, r=Kimundi
Mazdak Farrokhzad [Thu, 9 May 2019 16:34:51 +0000 (18:34 +0200)]
Rollup merge of #60601 - SimonSapin:cast, r=Kimundi

Add a `cast` method to raw pointers.

This is similar to `NonNull::cast`.

Compared to the `as` operator (which has a wide range of meanings depending on the input and output types), a call to this method:

* Can only go from a raw pointer to a raw pointer
* Cannot change the pointer’s `const`ness

… even when the pointed types are inferred based on context.

5 years agoAuto merge of #60668 - Zoxc:hir-map-vec, r=matthewjasper
bors [Thu, 9 May 2019 12:42:16 +0000 (12:42 +0000)]
Auto merge of #60668 - Zoxc:hir-map-vec, r=matthewjasper

Fix typo

5 years agoFix typo
John Kåre Alsaker [Thu, 9 May 2019 11:56:14 +0000 (13:56 +0200)]
Fix typo

5 years agoAuto merge of #60651 - Centril:rollup-zoamjfk, r=Centril
bors [Wed, 8 May 2019 22:59:23 +0000 (22:59 +0000)]
Auto merge of #60651 - Centril:rollup-zoamjfk, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #59979 (to_xe_bytes for isize and usize returns an array of different size)
 - #60491 (std: Update compiler-builtins crate)
 - #60550 (Add tests for concrete const types)
 - #60572 (Add test for #59972)
 - #60627 (test for #50518)
 - #60634 (Document + Cleanup lang_items.rs)
 - #60641 (Instead of ICEing on incorrect pattern, use delay_span_bug)
 - #60644 (Use `delay_span_bug` for "Failed to unify obligation")

Failed merges:

r? @ghost

5 years agoRollup merge of #60644 - estebank:abolish-ice, r=varkor
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:32 +0000 (00:58 +0200)]
Rollup merge of #60644 - estebank:abolish-ice, r=varkor

Use `delay_span_bug` for "Failed to unify obligation"

Fix #60283.

5 years agoRollup merge of #60641 - estebank:defer-ice, r=oli-obk
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:31 +0000 (00:58 +0200)]
Rollup merge of #60641 - estebank:defer-ice, r=oli-obk

Instead of ICEing on incorrect pattern, use delay_span_bug

Fix #60635.

5 years agoRollup merge of #60634 - Centril:lang-items-docs, r=oli-obk
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:29 +0000 (00:58 +0200)]
Rollup merge of #60634 - Centril:lang-items-docs, r=oli-obk

Document + Cleanup lang_items.rs

Byproduct of work on https://github.com/rust-lang/rust/issues/60607.

r? @oli-obk

5 years agoRollup merge of #60627 - matklad:test, r=estebank
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:28 +0000 (00:58 +0200)]
Rollup merge of #60627 - matklad:test, r=estebank

test for #50518

It was fixed somewhere between 1.28.0 and 1.31.1

closes #50518

r? @estebank

Where's the best place to add this test? I *think* we want "compile-pass" for this test (no need to run a binary, and not running saves us a millisecond of process creation) , but there's no compile-pass anymore.

Should this be UI test with empty stdout, stderr and zero return code?

5 years agoRollup merge of #60572 - tmandry:issue-59972, r=RalfJung,oli-obk
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:26 +0000 (00:58 +0200)]
Rollup merge of #60572 - tmandry:issue-59972, r=RalfJung,oli-obk

Add test for #59972

This PR adds a test for #59972, which was fixed in #59897.

Closes #59972.

r? @eddyb

5 years agoRollup merge of #60550 - skinny121:concrete_const_tests, r=varkor
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:25 +0000 (00:58 +0200)]
Rollup merge of #60550 - skinny121:concrete_const_tests, r=varkor

Add tests for concrete const types

In response to the request for help in https://github.com/rust-lang/rust/issues/44580#issuecomment-488819344, I have added several ui tests around the use of concrete const types, i.e. A<2>.

r? @varkor

5 years agoRollup merge of #60491 - alexcrichton:update-cb, r=nikomatsakis
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:23 +0000 (00:58 +0200)]
Rollup merge of #60491 - alexcrichton:update-cb, r=nikomatsakis

std: Update compiler-builtins crate

Pulls in a fix for ensuring that wasm targets have code in
compiler-builtins for `ldexp` which LLVM can generate references to.

5 years agoRollup merge of #59979 - stepancheg:num-size, r=ehuss
Mazdak Farrokhzad [Wed, 8 May 2019 22:58:22 +0000 (00:58 +0200)]
Rollup merge of #59979 - stepancheg:num-size, r=ehuss

to_xe_bytes for isize and usize returns an array of different size

... on different platforms.

Official rustdoc of
[`usize::to_le_bytes`](https://doc.rust-lang.org/std/primitive.usize.html#method.to_le_bytes)
displays signature

```
pub fn to_ne_bytes(self) -> [u8; 8]
```

which might be misleading: this function returns 4 bytes on 32-bit
systems.

With this commit applied rustdoc for `isize` and `usize` is this:
<img width="740" alt="2019-04-15_0020" src="https://user-images.githubusercontent.com/28969/56100765-9f69b380-5f14-11e9-974c-daa25edaa881.png">

5 years agoUse `delay_span_bug` for "Failed to unify obligation"
Esteban Küber [Wed, 8 May 2019 18:42:47 +0000 (11:42 -0700)]
Use `delay_span_bug` for "Failed to unify obligation"

5 years agoAuto merge of #60402 - michaelwoerister:update-profiler-rt-build, r=alexcrichton
bors [Wed, 8 May 2019 18:38:14 +0000 (18:38 +0000)]
Auto merge of #60402 - michaelwoerister:update-profiler-rt-build, r=alexcrichton

libprofiler_builtins: Set compilation flags more correctly for C code.

In particular, set `COMPILER_RT_HAS_FCNTL_LCK` and `COMPILER_RT_HAS_ATOMICS` as appropriate. This should get rid of the various runtime warnings when executing instrumented binaries.

The build script is using a heuristic here that hopefully is sufficient for the time being.

r? @alexcrichton

Fixes #59531.

5 years agoInstead of ICEing on incorrect pattern, use delay_span_bug
Esteban Küber [Wed, 8 May 2019 17:23:55 +0000 (10:23 -0700)]
Instead of ICEing on incorrect pattern, use delay_span_bug

5 years agoAuto merge of #60626 - matthiaskrgr:submodule_upd, r=oli-obk
bors [Wed, 8 May 2019 15:28:14 +0000 (15:28 +0000)]
Auto merge of #60626 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from fc96aa03 to 341c96af

Fixes clippy toolstate

Fixes https://github.com/rust-lang/rust/issues/60623

Changes:
````
rustup https://github.com/rust-lang/rust/pull/60586
Add test for #771.
Clean up while_loop tests
````

r? @Manishearth

5 years agopin: make the to-module link more visible
Ralf Jung [Wed, 8 May 2019 15:20:43 +0000 (17:20 +0200)]
pin: make the to-module link more visible

5 years agoAppVeyor: Update clang-cl from 7.0.0 to 8.0.0
Michael Woerister [Wed, 8 May 2019 15:05:02 +0000 (17:05 +0200)]
AppVeyor: Update clang-cl from 7.0.0 to 8.0.0

5 years agolibprofiler_builtins: Set compilation flags more correctly for C code.
Michael Woerister [Tue, 30 Apr 2019 08:46:21 +0000 (10:46 +0200)]
libprofiler_builtins: Set compilation flags more correctly for C code.

In particular, set COMPILER_RT_HAS_FCNTL_LCK and COMPILER_RT_HAS_ATOMICS
as appropriate.

5 years agostd: Update compiler-builtins crate
Alex Crichton [Thu, 2 May 2019 22:24:40 +0000 (15:24 -0700)]
std: Update compiler-builtins crate

Pulls in a fix for ensuring that wasm targets have code in
compiler-builtins for `ldexp` which LLVM can generate references to.

5 years agoDocument + Cleanup lang_items.rs
Mazdak Farrokhzad [Wed, 8 May 2019 01:05:32 +0000 (03:05 +0200)]
Document + Cleanup lang_items.rs

5 years agoAuto merge of #60246 - Zoxc:hir-map-vec, r=eddyb
bors [Wed, 8 May 2019 12:29:57 +0000 (12:29 +0000)]
Auto merge of #60246 - Zoxc:hir-map-vec, r=eddyb

Optimize HIR map

Builds on https://github.com/rust-lang/rust/pull/59042

cc @ljedrz
r? @eddyb

5 years agoRename HirMap to HirEntryMap and add some comments
John Kåre Alsaker [Wed, 8 May 2019 12:27:40 +0000 (14:27 +0200)]
Rename HirMap to HirEntryMap and add some comments

5 years agotest for #50518
Aleksey Kladov [Wed, 8 May 2019 06:56:26 +0000 (09:56 +0300)]
test for #50518

It was fixed somewhere between 1.28.0 and 1.31.1

closes #50518

5 years agoOptimize HIR map
John Kåre Alsaker [Wed, 24 Apr 2019 19:02:17 +0000 (21:02 +0200)]
Optimize HIR map

5 years agoAdd tests for concrete const types
ben [Sat, 4 May 2019 20:41:39 +0000 (08:41 +1200)]
Add tests for concrete const types

5 years agoAuto merge of #60378 - froydnj:apple-target-modifications, r=michaelwoerister
bors [Wed, 8 May 2019 08:26:48 +0000 (08:26 +0000)]
Auto merge of #60378 - froydnj:apple-target-modifications, r=michaelwoerister

conditionally modify darwin targets to macosx targets with versions

We need this behavior so that Rust LLVM IR objects match the target triple for Clang LLVM IR objects.  This matching then convinces the linker that yes, you really can do cross-language LTO with objects from different compilers.

The newly-added tests seem to pass locally on x86_64-unknown-linux-gnu.  I haven't done a full test run or tried the new compiler in an cross-language LTO setup yet.

5 years agosubmodules: update clippy from fc96aa03 to 341c96af
Matthias Krüger [Wed, 8 May 2019 06:19:29 +0000 (08:19 +0200)]
submodules: update clippy from fc96aa03 to 341c96af

Changes:
````
rustup https://github.com/rust-lang/rust/pull/60586
Add test for #771.
Clean up while_loop tests
````

5 years agoAuto merge of #60586 - cramertj:await, r=oli-obk
bors [Tue, 7 May 2019 22:33:12 +0000 (22:33 +0000)]
Auto merge of #60586 - cramertj:await, r=oli-obk

Implement built-in await syntax

Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.

This new syntax is not final, but is the consensus solution proposed by the lang team, as explained in https://boats.gitlab.io/blog/post/await-decision/

Fix https://github.com/rust-lang/rust/issues/51719
Fix https://github.com/rust-lang/rust/issues/51751
Fix https://github.com/rust-lang/rust/issues/60016

5 years agoImplement built-in await syntax
Taylor Cramer [Thu, 18 Apr 2019 19:55:23 +0000 (12:55 -0700)]
Implement built-in await syntax

Adds support for .await under the existing async_await feature gate.
Moves macro-like await! syntax to the await_macro feature gate.
Removes support for `await` as a non-keyword under the `async_await`
feature.

5 years agoAuto merge of #60612 - Centril:rollup-61drhqt, r=Centril
bors [Tue, 7 May 2019 19:39:52 +0000 (19:39 +0000)]
Auto merge of #60612 - Centril:rollup-61drhqt, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #60489 (Remove hamburger button from source code page)
 - #60535 (Correct handling of arguments in async fn)
 - #60579 (Rename `ParamTy::idx` to `ParamTy::index`)
 - #60583 (Fix parsing issue with negative literals as const generic arguments)
 - #60609 (Be a bit more explicit asserting over the vec rather than the len)

Failed merges:

r? @ghost

5 years agoRollup merge of #60609 - spastorino:be-explicit-on-mem-replace-doc, r=Centril
Mazdak Farrokhzad [Tue, 7 May 2019 17:30:11 +0000 (19:30 +0200)]
Rollup merge of #60609 - spastorino:be-explicit-on-mem-replace-doc, r=Centril

Be a bit more explicit asserting over the vec rather than the len

5 years agoRollup merge of #60583 - varkor:const-generics-emplace, r=petrochenkov
Mazdak Farrokhzad [Tue, 7 May 2019 17:30:09 +0000 (19:30 +0200)]
Rollup merge of #60583 - varkor:const-generics-emplace, r=petrochenkov

Fix parsing issue with negative literals as const generic arguments

5 years agoRollup merge of #60579 - varkor:typaram-index, r=eddyb
Mazdak Farrokhzad [Tue, 7 May 2019 17:30:07 +0000 (19:30 +0200)]
Rollup merge of #60579 - varkor:typaram-index, r=eddyb

Rename `ParamTy::idx` to `ParamTy::index`

This makes it consistent with `ParamConst` and `EarlyBoundRegion`.

5 years agoRollup merge of #60535 - taiki-e:async-fn-arguments, r=cramertj
Mazdak Farrokhzad [Tue, 7 May 2019 17:30:06 +0000 (19:30 +0200)]
Rollup merge of #60535 - taiki-e:async-fn-arguments, r=cramertj

Correct handling of arguments in async fn

Fixes #60509
Fixes #60566

r? @cramertj or @davidtwco

5 years agoRollup merge of #60489 - GuillaumeGomez:remove-hamburger, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 7 May 2019 17:30:05 +0000 (19:30 +0200)]
Rollup merge of #60489 - GuillaumeGomez:remove-hamburger, r=QuietMisdreavus

Remove hamburger button from source code page

Fixes #60483.

Screenshot:

<img width="575" alt="Screenshot 2019-05-03 at 00 12 51" src="https://user-images.githubusercontent.com/3050060/57110298-61ec8f00-6d38-11e9-85fd-d13be94b9c52.png">

cc @rust-lang/rustdoc

5 years agoAuto merge of #60277 - estebank:relate-ice, r=varkor
bors [Tue, 7 May 2019 16:45:14 +0000 (16:45 +0000)]
Auto merge of #60277 - estebank:relate-ice, r=varkor

Don't ICE when relating const type args

Fix #60263.

r? @varkor

5 years agoBe a bit more explicit asserting over the vec rather than the len
Santiago Pastorino [Tue, 7 May 2019 16:31:12 +0000 (13:31 -0300)]
Be a bit more explicit asserting over the vec rather than the len

5 years agochoose a more specific LLVM target on OS X when necessary
Nathan Froyd [Thu, 25 Apr 2019 20:04:37 +0000 (16:04 -0400)]
choose a more specific LLVM target on OS X when necessary

This behavior matches clang's behavior, and makes cross-language LTO
possible.

Fixes #60235.

5 years agoadd negative tests for OS X LLVM target changes
Nathan Froyd [Mon, 29 Apr 2019 20:57:29 +0000 (16:57 -0400)]
add negative tests for OS X LLVM target changes

5 years agoAuto merge of #60592 - davidtwco:generator-signature-deduction, r=eddyb
bors [Tue, 7 May 2019 13:49:36 +0000 (13:49 +0000)]
Auto merge of #60592 - davidtwco:generator-signature-deduction, r=eddyb

Deduce signature of generator on type mismatch

Contributes towards #54326.

r? @eddyb

5 years agoAdd a `cast` method to raw pointers.
Simon Sapin [Tue, 7 May 2019 11:32:07 +0000 (13:32 +0200)]
Add a `cast` method to raw pointers.

This is similar to `NonNull::cast`.

Compared to the `as` operator (which has a wide range of meanings
depending on the input and output types), a call to this method:

* Can only go from a raw pointer to a raw pointer
* Cannot change the pointer’s `const`ness

… even when the pointed types are inferred based on context.

5 years agoAuto merge of #60573 - Zoxc:dep-stream-prefix-2, r=michaelwoerister
bors [Tue, 7 May 2019 10:48:16 +0000 (10:48 +0000)]
Auto merge of #60573 - Zoxc:dep-stream-prefix-2, r=michaelwoerister

Only hash dep node indices of deps of anon tasks

Another change split out from https://github.com/rust-lang/rust/pull/60035.

r? @michaelwoerister

5 years agoTrust signature over return expr for generators.
David Wood [Mon, 6 May 2019 21:56:47 +0000 (22:56 +0100)]
Trust signature over return expr for generators.

This commit extends the logic used to determine what the expected
signature of a closure is so that it can also determine the expected
signature of a generator. This improves a diagnostic where the fn
signature was blamed instead of the generator body. It doesn't fix
fix the diagnostic for `async fn`.

5 years agoAuto merge of #60596 - ehuss:update-cargo, r=alexcrichton
bors [Tue, 7 May 2019 05:53:18 +0000 (05:53 +0000)]
Auto merge of #60596 - ehuss:update-cargo, r=alexcrichton

Update cargo

12 commits in beb8fcb5248dc2e6aa488af9613216d5ccb31c6a..759b6161a328db1d4863139e90875308ecd25a75
2019-04-30 23:58:00 +0000 to 2019-05-06 20:47:49 +0000
- Small things (rust-lang/cargo#6910)
- Fix skipping over invalid registry packages (rust-lang/cargo#6912)
- Fixes rust-lang/cargo#6874 (rust-lang/cargo#6905)
- doc: Format examples of version to ease reading (rust-lang/cargo#6907)
- fix more typos (codespell) (rust-lang/cargo#6903)
- Parse less JSON on null builds (rust-lang/cargo#6880)
- chore: Update opener to 0.4 (rust-lang/cargo#6902)
- Update documentation for auto-discovery. (rust-lang/cargo#6898)
- Update some doc links. (rust-lang/cargo#6897)
- Default Cargo.toml template provide help for completing the metadata (rust-lang/cargo#6881)
- Run 'cargo fmt --all' (rust-lang/cargo#6896)
- Refactor command definition (rust-lang/cargo#6894)

5 years agoAuto merge of #60464 - eddyb:not-overly-specific-pipelining, r=alexcrichton
bors [Tue, 7 May 2019 02:58:40 +0000 (02:58 +0000)]
Auto merge of #60464 - eddyb:not-overly-specific-pipelining, r=alexcrichton

rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output.

This is my take on #60006 / #60419 (see https://github.com/rust-lang/rust/pull/60006#discussion_r275983732).
I'm not too attached the "notifications" part, it's pretty much bikeshed material.
**EDIT**: for "artifact", @matklad pointed out Cargo already uses it (in https://github.com/rust-lang/rust/pull/60464#issuecomment-488576998)

The first two commits are fixes that could be landed independently, especially the `compiletest` one, which removes the need for any of the normalization added in #60006 to land the test.

The last commit enables the emission for all outputs, which was my main suggestion for #60006, mostly to show that it's minimal and not really a "scope creep" (as suggested in https://github.com/rust-lang/rust/pull/60006#discussion_r279964081).

cc @alexcrichton @nnethercote

5 years agocompiletest: uniformly normalize paths, so they all work on all platforms.
Eduard-Mihai Burtescu [Tue, 7 May 2019 01:49:26 +0000 (04:49 +0300)]
compiletest: uniformly normalize paths, so they all work on all platforms.

5 years agoAdd test for #59972
Tyler Mandry [Mon, 6 May 2019 00:23:47 +0000 (17:23 -0700)]
Add test for #59972

5 years agorustc_codegen_ssa: emit artifact notifications for the main link product too.
Eduard-Mihai Burtescu [Thu, 2 May 2019 02:49:57 +0000 (05:49 +0300)]
rustc_codegen_ssa: emit artifact notifications for the main link product too.

5 years agorustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the...
Eduard-Mihai Burtescu [Thu, 2 May 2019 02:06:33 +0000 (05:06 +0300)]
rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output.

5 years agocompiletest: only use `make_exe_name` for tests that end up being executed.
Eduard-Mihai Burtescu [Thu, 2 May 2019 02:06:08 +0000 (05:06 +0300)]
compiletest: only use `make_exe_name` for tests that end up being executed.

5 years agoUpdate cargo
Eric Huss [Tue, 7 May 2019 01:19:21 +0000 (18:19 -0700)]
Update cargo

5 years agoAuto merge of #60531 - Centril:sort-features, r=oli-obk
bors [Tue, 7 May 2019 00:06:36 +0000 (00:06 +0000)]
Auto merge of #60531 - Centril:sort-features, r=oli-obk

Enforce sorting of accepted and removed features

Fixes https://github.com/rust-lang/rust/issues/60361 with mechanism introduced in https://github.com/rust-lang/rust/pull/60373.

r? @oli-obk

5 years agoserialize: add missing Encodable impl for Path.
Eduard-Mihai Burtescu [Thu, 2 May 2019 02:05:58 +0000 (05:05 +0300)]
serialize: add missing Encodable impl for Path.

5 years agoAdd test for current behaviour.
David Wood [Mon, 6 May 2019 19:45:47 +0000 (20:45 +0100)]
Add test for current behaviour.

This commit adds a test for the current behaviour of signature deduction
of generators when there is a type mismatch between the return type of
the function body and the signature.

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 agoRemove resolved FIXME
varkor [Mon, 6 May 2019 16:00:34 +0000 (17:00 +0100)]
Remove resolved FIXME

5 years ago`token::LArrow` can begin arguments
varkor [Mon, 6 May 2019 16:00:01 +0000 (17:00 +0100)]
`token::LArrow` can begin arguments

`<-` may indicate the start of a negative const argument.

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 agoRename `ParamTy::idx` to `ParamTy::index`
varkor [Mon, 6 May 2019 12:12:04 +0000 (13:12 +0100)]
Rename `ParamTy::idx` to `ParamTy::index`

5 years agoOnly hash dep node indices of deps of anon tasks
John Kåre Alsaker [Tue, 16 Apr 2019 07:59:55 +0000 (09:59 +0200)]
Only hash dep node indices of deps of anon tasks

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 agoto_xe_bytes for isize and usize returns an array of different size
Stepan Koltsov [Sun, 14 Apr 2019 23:00:50 +0000 (00:00 +0100)]
to_xe_bytes for isize and usize returns an array of different size

... on different platforms.

Official rustdoc of
[`usize::to_le_bytes`](https://doc.rust-lang.org/std/primitive.usize.html#method.to_le_bytes)
displays signature

```
pub fn to_ne_bytes(self) -> [u8; 8]
```

which might be misleading: this function returns 4 bytes on 32-bit
systems.

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 agoAdd tests for by-ref binding
Taiki Endo [Sun, 5 May 2019 15:01:20 +0000 (00:01 +0900)]
Add tests for by-ref binding

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.