Commit Graph

92712 Commits

Author SHA1 Message Date
David Wood
b05d5db87b
Ensure that drop order of async fn matches fn.
This commit modifies the lowering of `async fn` arguments so that the
drop order matches the equivalent `fn`.

Previously, async function arguments were lowered as shown below:

    async fn foo(<pattern>: <ty>) {
      async move {
      }
    } // <-- dropped as you "exit" the fn

    // ...becomes...
    fn foo(__arg0: <ty>) {
      async move {
        let <pattern> = __arg0;
      } // <-- dropped as you "exit" the async block
    }

After this PR, async function arguments will be lowered as:

    async fn foo(<pattern>: <ty>, <pattern>: <ty>, <pattern>: <ty>) {
      async move {
      }
    } // <-- dropped as you "exit" the fn

    // ...becomes...
    fn foo(__arg0: <ty>, __arg1: <ty>, __arg2: <ty>) {
      async move {
        let __arg2 = __arg2;
        let <pattern> = __arg2;
        let __arg1 = __arg1;
        let <pattern> = __arg1;
        let __arg0 = __arg0;
        let <pattern> = __arg0;
      } // <-- dropped as you "exit" the async block
    }

If `<pattern>` is a simple ident, then it is lowered to a single
`let <pattern> = <pattern>;` statement as an optimization.
2019-05-01 14:40:59 +01:00
bors
47e0803d5c Auto merge of #60195 - varkor:commontypes-to-common, r=eddyb
Split `CommonTypes` into `CommonTypes` and `CommonLifetimes`

The so-called "`CommonTypes`" contains more than just types.

r? @eddyb
2019-05-01 09:32:58 +00:00
bors
834bd1959c Auto merge of #60280 - varkor:const-param-invariance, r=eddyb
Fix indexing issue for const parameter invariance

We were previously not taking account of the parent parameters.

r? @eddyb
cc @Zoxc
2019-05-01 03:06:13 +00:00
bors
96ee0ba59e Auto merge of #60204 - jethrogb:jb/rtunwrap-debug-print, r=alexcrichton
Debug-print error when using rtunwrap

When I added this macro a while back I didn't have a way to make it print the failure for all types that you might want to unwrap. Now, I came up with a solution.
2019-04-30 22:46:28 +00:00
bors
7c71bc3208 Auto merge of #60262 - michaelwoerister:pgo-preinlining-pass, r=alexcrichton
PGO: Add a run-make test that makes sure that PGO profiling data is used by the compiler during optimizations.

From the tests comment section:
```
# This test makes sure that PGO profiling data leads to cold functions being
# marked as `cold` and hot functions with `inlinehint`.
# The test program contains an `if` were actual execution only ever takes the
# `else` branch. Accordingly, we expect the function that is never called to
# be marked as cold.
```

r? @alexcrichton
2019-04-30 19:52:13 +00:00
Michael Woerister
7c4cc01f79 Work around missing tac command on macOS in PGO run-make test. 2019-04-30 17:38:01 +02:00
bors
5b7baa53c9 Auto merge of #60416 - Centril:rollup-bbyyz9x, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #60344 (Don't try to render auto-trait bounds with any inference variables)
 - #60354 (Cleanup declare_features! for 'accepted' with a uniform style + sort them)
 - #60362 (Cleanup 'active' declare_features! with uniform style + sorting.)
 - #60382 (Revert "Update Source Code Pro fonts to version 2.030")
 - #60399 (Update clippy)
 - #60400 (Remove functions to simplify handling of feature(bind_by_move_pattern_guards))
 - #60408 (Add missing f16c_target_feature check to typeck collect)

Failed merges:

r? @ghost
2019-04-30 15:19:40 +00:00
Mazdak Farrokhzad
71a1b80213
Rollup merge of #60408 - gnzlbg:f16c2, r=Centril
Add missing f16c_target_feature check to typeck collect
2019-04-30 16:10:33 +02:00
Mazdak Farrokhzad
008e21d6f6
Rollup merge of #60400 - JohnTitor:simplify-feature, r=matthewjasper
Remove functions to simplify handling of feature(bind_by_move_pattern_guards)

Fixes #59192

r? @matthewjasper
2019-04-30 16:10:31 +02:00
Mazdak Farrokhzad
e11ba74d99
Rollup merge of #60399 - Manishearth:clippyup, r=Manishearth
Update clippy

None
2019-04-30 16:10:30 +02:00
Mazdak Farrokhzad
32dac8c61d
Rollup merge of #60382 - Manishearth:revert-code-font, r=GuillaumeGomez
Revert "Update Source Code Pro fonts to version 2.030"

Temporary fix for https://github.com/rust-lang/rust/issues/60365

https://github.com/rust-lang/rust/pull/60146 updated all fonts (not just the fonts that were buggy), however it looks like the new Source Code Pro is buggy.

We should test this out of tree: `cargo doc` on anything, replace the font in `target/doc`, and use `python -m SimpleHTTPServer` to see what's going on.

Till we figure that out, I'll just back this out.

r? @GuillaumeGomez

This reverts commit 6bafc58ced.
2019-04-30 16:10:29 +02:00
Mazdak Farrokhzad
8a17bbfb28
Rollup merge of #60362 - Centril:cleanup-declare-features-active, r=oli-obk
Cleanup 'active' declare_features! with uniform style + sorting.

r? @oli-obk

(added the FIXME you wanted)
cc https://github.com/rust-lang/rust/pull/60354
cc https://github.com/rust-lang/rust/issues/60361
2019-04-30 16:10:27 +02:00
Mazdak Farrokhzad
17cb922b8b
Rollup merge of #60354 - Centril:cleanup-declare-features-accepted, r=oli-obk
Cleanup declare_features! for 'accepted' with a uniform style + sort them

r? @oli-obk

cc https://github.com/rust-lang/rust/pull/60362
cc https://github.com/rust-lang/rust/issues/60361
2019-04-30 16:10:26 +02:00
Mazdak Farrokhzad
6547de2bdd
Rollup merge of #60344 - Aaron1011:fix/tower-hyper, r=eddyb
Don't try to render auto-trait bounds with any inference variables

Previously, we checked if the target of a projection type was itself an
inference variable. However, for Rustdoc rendering purposes, there's no
distinction between an inference variable ('_') and a type containing
one (e.g. (MyStruct<u8, _>)) - we don't want to render either of them.

Fixes #60269

Due to the complexity of the original bug, which spans three different
crates (hyper, tower-hyper, and tower), I have been unable to create a
minimized reproduction for the issue.
2019-04-30 16:10:25 +02:00
bors
862a8784ab Auto merge of #60159 - estebank:type-mismatch-cast, r=oli-obk
Suggest `try_into` when possible

CC #47168
2019-04-30 12:28:11 +00:00
gnzlbg
076241e774 Add missing f16c_target_feature check to typeck collect 2019-04-30 12:32:34 +02:00
Michael Woerister
7acead5e0a Add local LLD to the PATH for run-make-fulldeps tests. 2019-04-30 10:01:54 +02:00
Yuki OKUSHI
4945594c24 Remove functions to simplify 2019-04-30 17:00:36 +09:00
Manish Goregaokar
382e350f50 Update clippy 2019-04-29 22:37:00 -07:00
bors
f843ad60ef Auto merge of #60389 - Centril:rollup-nefreyr, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #59869 (SGX target: implemented vectored I/O)
 - #60238 (Update rustfmt to 1.2.2)
 - #60276 (Cleanup the MIR visitor)
 - #60380 (Fix line number display in source view)

Failed merges:

r? @ghost
2019-04-30 02:27:07 +00:00
Mazdak Farrokhzad
116dcff2c3
Rollup merge of #60380 - GuillaumeGomez:fix-line-number-display, r=Manishearth
Fix line number display in source view

Fixes #60310.

r? rust-lang/rustdoc

cc @Manishearth

screenshot of the fix:

<img width="798" alt="Screenshot 2019-04-29 at 23 12 20" src="https://user-images.githubusercontent.com/3050060/56927541-b7286680-6ad4-11e9-9215-42dc4ef42691.png">
2019-04-30 03:28:39 +02:00
Mazdak Farrokhzad
ada68c9d19
Rollup merge of #60276 - matthewjasper:cleanup-mir-visitor, r=estebank
Cleanup the MIR visitor

* Remove useless `BasicBlock` parameters on methods with `Location`s.
* Prefer `visit_terminator_kind` to `visit_terminator`.
* Remove `Region` from PlaceContexts. `visit_rvalue` should be used when the region is important.
* Remove unused visitor methods.
2019-04-30 03:28:38 +02:00
Mazdak Farrokhzad
1ec56d8550
Rollup merge of #60238 - topecongiro:rustfmt-1.2.2, r=alexcrichton
Update rustfmt to 1.2.2
2019-04-30 03:28:37 +02:00
Mazdak Farrokhzad
c54b77ca2d
Rollup merge of #59869 - jethrogb:jb/sgx-iovec, r=sfackler
SGX target: implemented vectored I/O

r? @sfackler

Includes #59857
2019-04-30 03:28:35 +02:00
Mazdak Farrokhzad
3c00dfdf81 Cleanup 'active' declare_features! with uniform style + sorting. 2019-04-30 03:23:23 +02:00
Esteban Küber
31eb5cc730 Account for const fns to avoid incorrect suggestions 2019-04-29 17:14:31 -07:00
Jethro Beekman
09f4008da5 SGX target: implemented vectored I/O 2019-04-29 16:48:22 -07:00
Jethro Beekman
7e624ce2c2 SGX target: don't unwind on usercall index out of bounds 2019-04-29 16:46:29 -07:00
bors
03122e1bac Auto merge of #60006 - nnethercote:json-for-pipelining, r=alexcrichton
In JSON output, emit a directive after metadata is generated.

To implement pipelining, Cargo needs to know when metadata generation is
finished. This is done via a new JSON "directive".

Unfortunately, metadata file writing currently occurs very late during
compilation, so pipelining won't produce a speed-up. Moving metadata
file writing earlier will be a follow-up.

r? @alexcrichton
2019-04-29 23:35:01 +00:00
Nicholas Nethercote
7bcb0cffb6 In JSON output, emit a directive after metadata is generated.
To implement pipelining, Cargo needs to know when metadata generation is
finished. This commit adds code to do that. Unfortunately, metadata file
writing currently occurs very late during compilation, so pipelining
won't produce a speed-up. Moving metadata file writing earlier will be a
follow-up.

The change involves splitting the existing `Emitter::emit` method in
two: `Emitter::emit_diagnostic` and `Emitter::emit_directive`.

The JSON directives look like this:
```
{"directive":"metadata file written: liba.rmeta"}
```
The functionality is behind the `-Z emit-directives` option, and also
requires `--error-format=json`.
2019-04-30 08:51:57 +10:00
Esteban Küber
4e84b619f4 Add test 2019-04-29 14:38:26 -07:00
Esteban Küber
4b1297baf7 Suggest try_into when possible 2019-04-29 14:38:26 -07:00
Manish Goregaokar
7aab005341 Revert "Update Source Code Pro fonts to version 2.030"
This reverts commit 6bafc58ced.
2019-04-29 14:15:28 -07:00
Guillaume Gomez
10b9370286 Fix line number display in source view 2019-04-29 23:13:30 +02:00
bors
00859e3e65 Auto merge of #60377 - Centril:rollup-42fxe9u, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #59946 (Fix equivalent string in escape_default docs)
 - #60256 (Option::flatten)
 - #60305 (hir: remove LoweredNodeId)
 - #60334 (Stabilized vectored IO)
 - #60353 (Add test not to forget resolved ICE)
 - #60356 (Stabilize str::as_mut_ptr)
 - #60358 (Clarify the short explanation of E0207)
 - #60359 (resolve: Consider erroneous imports used to avoid duplicate diagnostics)
 - #60360 (Add test case for labeled break in const assignment)

Failed merges:

r? @ghost
2019-04-29 20:40:49 +00:00
Mazdak Farrokhzad
04942105ef
Rollup merge of #60360 - rasendubi:const-labeled-break, r=Centril
Add test case for labeled break in const assignment

Fixes #51350.
2019-04-29 22:22:46 +02:00
Mazdak Farrokhzad
4369f03620
Rollup merge of #60359 - petrochenkov:imperruse, r=estebank
resolve: Consider erroneous imports used to avoid duplicate diagnostics

Supersedes https://github.com/rust-lang/rust/pull/60295
Fixes https://github.com/rust-lang/rust/issues/48244
r? @estebank
2019-04-29 22:22:45 +02:00
Mazdak Farrokhzad
49946dd1b6
Rollup merge of #60358 - nickolay:patch-1, r=GuillaumeGomez
Clarify the short explanation of E0207

After being greatly improved in #33692, https://doc.rust-lang.org/error-index.html#E0207 uses terminology from the related RFC, which is different from the [reference](https://doc.rust-lang.org/reference/items/implementations.html), e.g. "self type" instead of "implementing type" and "trait reference" instead of "implemented trait".

It probably makes no difference to an experienced reader, but for a newbie like me it added to the confusion as you can't look up the definition of the terms being used and can't be sure you've guessed correctly...

I would also move the link to RFC to the top, as it seems to be the only doc that attempts to explain what the third criteria entails), but it seems to go against the accepted style.
2019-04-29 22:22:44 +02:00
Mazdak Farrokhzad
c9b70144a3
Rollup merge of #60356 - JohnTitor:stabilize-as-mut-ptr, r=Centril
Stabilize str::as_mut_ptr

Closes #58215
2019-04-29 22:22:42 +02:00
Mazdak Farrokhzad
3091961621
Rollup merge of #60353 - JohnTitor:add-test, r=Centril
Add test not to forget resolved ICE

closes #55499

I added the example as a test.

r? @pnkfelix
2019-04-29 22:22:41 +02:00
Mazdak Farrokhzad
ead8d81301
Rollup merge of #60334 - sfackler:stable-iovec, r=alexcrichton
Stabilized vectored IO

This renames `std::io::IoVec` to `std::io::IoSlice` and
`std::io::IoVecMut` to `std::io::IoSliceMut`, and stabilizes
`std::io::IoSlice`, `std::io::IoSliceMut`,
`std::io::Read::read_vectored`, and `std::io::Write::write_vectored`.

Closes #58452

r? @alexcrichton
2019-04-29 22:22:40 +02:00
Mazdak Farrokhzad
67b7f5779d
Rollup merge of #60305 - ljedrz:remove_LoweredNodeId, r=Zoxc
hir: remove LoweredNodeId

It seems that we no longer need it, because nowadays we just want the `HirId` most of the time.
2019-04-29 22:22:38 +02:00
Mazdak Farrokhzad
bdf3a01065
Rollup merge of #60256 - ethanboxx:master, r=alexcrichton
Option::flatten

This PR makes this possible.
```rust
assert_eq!(Some(6), Some(Some(6)).flatten());
assert_eq!(Some(6), Some(Some(6)).into());
```
2019-04-29 22:22:36 +02:00
Mazdak Farrokhzad
eb3c53071a
Rollup merge of #59946 - mernen:patch-2, r=ehuss
Fix equivalent string in escape_default docs

This newline should be escaped.
2019-04-29 22:22:34 +02:00
bors
a55c2eb325 Auto merge of #60355 - Manishearth:clippyup, r=centril
Update clippy

r? @centril
2019-04-29 17:44:15 +00:00
Manish Goregaokar
505cae2a76 Update clippy 2019-04-29 08:48:17 -07:00
bors
96d565be01 Auto merge of #60039 - rasendubi:assert-trailing-junk, r=alexcrichton
Make assert! ensure the macro is parsed completely

Fixes https://github.com/rust-lang/rust/issues/60024
2019-04-29 14:50:17 +00:00
Michael Woerister
c95f5e31c7 bootstrap: Don't add LLVM's bin directory to the PATH for tool invocations. 2019-04-29 14:55:29 +02:00
Michael Woerister
29cf3f54ab compiletest: Make LLVM's bin directory available to run-make-fulldeps tests. 2019-04-29 14:38:25 +02:00
ljedrz
d536ec4d39 hir: remove LoweredNodeId 2019-04-29 12:12:11 +02:00