Commit graph

93043 commits

Author SHA1 Message Date
Michael Woerister
e65ef96eaf 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.
2019-05-08 17:02:58 +02:00
bors
b92d360c6c 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.
2019-05-08 08:26:48 +00:00
bors
33cde4aac2 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
2019-05-07 22:33:12 +00:00
Taylor Cramer
fe8760cb84 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.
2019-05-07 14:45:53 -07:00
bors
cfdc84a009 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
2019-05-07 19:39:52 +00:00
Mazdak Farrokhzad
2d6da83763
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
2019-05-07 19:30:11 +02:00
Mazdak Farrokhzad
9995bb5855
Rollup merge of #60583 - varkor:const-generics-emplace, r=petrochenkov
Fix parsing issue with negative literals as const generic arguments
2019-05-07 19:30:09 +02:00
Mazdak Farrokhzad
e280818cb0
Rollup merge of #60579 - varkor:typaram-index, r=eddyb
Rename `ParamTy::idx` to `ParamTy::index`

This makes it consistent with `ParamConst` and `EarlyBoundRegion`.
2019-05-07 19:30:07 +02:00
Mazdak Farrokhzad
535db2f357
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
2019-05-07 19:30:06 +02:00
Mazdak Farrokhzad
4e233583d0
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
2019-05-07 19:30:05 +02:00
bors
17dba3b6e4 Auto merge of #60277 - estebank:relate-ice, r=varkor
Don't ICE when relating const type args

Fix #60263.

r? @varkor
2019-05-07 16:45:14 +00:00
Santiago Pastorino
b98bf88d32
Be a bit more explicit asserting over the vec rather than the len 2019-05-07 13:31:12 -03:00
Nathan Froyd
97ba4c95d0 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.
2019-05-07 11:09:39 -04:00
Nathan Froyd
1516087ca9 add negative tests for OS X LLVM target changes 2019-05-07 11:09:39 -04:00
bors
f5371a5ac7 Auto merge of #60592 - davidtwco:generator-signature-deduction, r=eddyb
Deduce signature of generator on type mismatch

Contributes towards #54326.

r? @eddyb
2019-05-07 13:49:36 +00:00
bors
c6ac575648 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
2019-05-07 10:48:16 +00:00
David Wood
f2919a31c8
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`.
2019-05-07 07:44:12 +01:00
bors
55c48b4e82 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)
2019-05-07 05:53:18 +00:00
bors
b8fa4cb31d 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
2019-05-07 02:58:40 +00:00
Eduard-Mihai Burtescu
c89a13179e compiletest: uniformly normalize paths, so they all work on all platforms. 2019-05-07 05:09:19 +03:00
Eduard-Mihai Burtescu
bb1c67dde4 rustc_codegen_ssa: emit artifact notifications for the main link product too. 2019-05-07 04:49:54 +03:00
Eduard-Mihai Burtescu
1618c079ab rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output. 2019-05-07 04:49:54 +03:00
Eduard-Mihai Burtescu
f0e43fc986 compiletest: only use make_exe_name for tests that end up being executed. 2019-05-07 04:49:54 +03:00
Eric Huss
fc72e56e78 Update cargo 2019-05-06 18:19:21 -07:00
bors
eeedd3a6e1 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
2019-05-07 00:06:36 +00:00
Eduard-Mihai Burtescu
9a2ee0aaef serialize: add missing Encodable impl for Path. 2019-05-07 02:47:45 +03:00
David Wood
a416a19153
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.
2019-05-06 23:40:19 +01:00
bors
f64ed09157 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.
2019-05-06 20:54:30 +00:00
bors
a19cf18c7d 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
2019-05-06 16:43:25 +00:00
varkor
e570fe5b22 Remove resolved FIXME 2019-05-06 17:00:34 +01:00
varkor
594685b5a2 token::LArrow can begin arguments
`<-` may indicate the start of a negative const argument.
2019-05-06 17:00:01 +01:00
varkor
9a2772aff0 Implement ToTrace for ty::Const 2019-05-06 15:07:46 +01:00
varkor
5fc0395053 Resolve a couple of unimplemented!()s
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-06 14:58:21 +01:00
bors
c3b8ab5199 Auto merge of #60337 - fabric-and-ink:hiridification, r=Zoxc
A bit of HirIdification

A small contribution to #50928.
2019-05-06 13:41:28 +00:00
varkor
c0454f0638 Remove incorrect FIXME
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-06 14:16:28 +01:00
varkor
670cf11de2 Clean up push_const_name
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-06 14:16:07 +01:00
varkor
c6197541f7 Implement TypeFoldable for InferConst
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-06 14:05:26 +01:00
varkor
ad78fcf524 Ignore const parameters when constructing type bounds in rustdoc
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-06 13:55:28 +01:00
varkor
59ebd1b7c2 Shift const vars through binders
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-06 13:55:14 +01:00
varkor
638d1d34ff Remove duplicate comment
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-06 13:54:59 +01:00
varkor
c3694e5ee6 Rename ParamTy::idx to ParamTy::index 2019-05-06 13:12:04 +01:00
John Kåre Alsaker
97d3ad066d Only hash dep node indices of deps of anon tasks 2019-05-06 13:57:33 +02:00
bors
d98a165e39 Auto merge of #60565 - Mark-Simulacrum:mailmap-fixes, r=pietroalbini
Update mailmap to proper syntax

Also updates my entry to the proper name
2019-05-06 10:42:19 +00:00
bors
7ac02005f3 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
2019-05-06 06:00:43 +00:00
bors
eda0699443 Auto merge of #60569 - RalfJung:miri-visitor-generators, r=Centril
fix typo in enum variant name
2019-05-06 03:11:14 +00:00
bors
46d0ca00ad 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](112f7e9ac5/src/libsyntax/parse/lexer/mod.rs (L928-L1065)) a string, and a second time when we [unescape](112f7e9ac5/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
2019-05-06 00:16:16 +00:00
bors
40bd145cbe 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
2019-05-05 21:11:47 +00:00
Ralf Jung
dc54cd0c60 fix typo in enum variant name 2019-05-05 22:53:56 +02:00
Manish Goregaokar
ff7ef116fb
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.
2019-05-05 12:37:31 -07:00
Manish Goregaokar
2c7712b3f1
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
2019-05-05 12:37:30 -07:00