Commit Graph

95601 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
44f22e694c
Rollup merge of #62295 - RalfJung:miri-realloc, r=cramertj
miri realloc: do not require giving old size+align
2019-07-04 01:38:53 +02:00
Mazdak Farrokhzad
d93b52fd18
Rollup merge of #62287 - petrhosek:libunwind-link-attribute, r=tmandry
Use link attributes on extern "C" blocks with llvm-libuwind

When llvm-libunwind feature is enabled, we need to use link attribute on
extern "C" blocks to make sure that symbols provided by LLVM's libunwind
that's built as part of Rust's libunwind crate are re-exported.

This addresses issue #62088.
2019-07-04 01:38:52 +02:00
Mazdak Farrokhzad
d7e42cc61c
Rollup merge of #62268 - Zoxc:inherent_impls, r=eddyb
Clean up inherent_impls

Split out from https://github.com/rust-lang/rust/pull/61923.

r? @eddyb
2019-07-04 01:38:50 +02:00
Mazdak Farrokhzad
8867ba19de
Rollup merge of #62258 - petrochenkov:idclean, r=Centril
syntax: Unsupport `foo! bar { ... }` macros in the parser

Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606.

Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly).

cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
2019-07-04 01:38:49 +02:00
Mazdak Farrokhzad
944bda9abb
Rollup merge of #62252 - czipperz:change-mem-replace-doc-example, r=dtolnay
Update mem::replace example to not be identical to mem::take

This also adds assertions that the operations work as expected.
2019-07-04 01:38:47 +02:00
Mazdak Farrokhzad
88c007cd04
Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, r=dtolnay,Centril
Use mem::take instead of mem::replace with default
2019-07-04 01:38:46 +02:00
Mazdak Farrokhzad
6cfd474e33
Rollup merge of #62240 - arielb1:resolve-wf-fields, r=pnkfelix
wfcheck: resolve the type-vars in `AdtField` types

Normalization can leave some type-vars unresolved in its return type.
Make sure to resolve them so we have an infcx-independent type that can
be used with `needs_drop`.

Fixes #61402.

Closes #62212 - this PR fixes the root cause.
2019-07-04 01:38:44 +02:00
Mazdak Farrokhzad
740d5bd157
Rollup merge of #62173 - RalfJung:miri-interp, r=oli-obk
rename InterpretCx -> InterpCx

That's more consistent with InterpResult and InterpError.

r? @oli-obk
2019-07-04 01:38:42 +02:00
Mazdak Farrokhzad
e8a88f7d43
Rollup merge of #62039 - jeremystucki:needless_lifetimes, r=eddyb
Remove needless lifetimes (rustc)
2019-07-04 01:38:41 +02:00
bors
088b987307 Auto merge of #62335 - Mark-Simulacrum:rollup-0pcaz5a, r=Mark-Simulacrum
Rollup of 15 pull requests

Successful merges:

 - #62021 (MSVC link output improve)
 - #62064 (nth_back for chunks_exact)
 - #62128 (Adjust warning of -C extra-filename with -o.)
 - #62161 (Add missing links for TryFrom docs)
 - #62183 (std: Move a process test out of libstd)
 - #62186 (Add missing type urls in Into trait)
 - #62196 (Add Vec::leak)
 - #62199 (import gdb for explicit access to gdb.current_objfile())
 - #62229 (Enable intptrcast for explicit casts)
 - #62250 (Improve box clone doctests to ensure the documentation is valid)
 - #62255 (Switch tracking issue for `#![feature(slice_patterns)]`)
 - #62285 (Fix michaelwoerister's mailmap)
 - #62304 (HashMap is UnwindSafe)
 - #62319 (Fix mismatching Kleene operators)
 - #62327 (Fixed document bug, those replaced each other)

Failed merges:

r? @ghost
2019-07-03 14:29:08 +00:00
Mark Rousskov
6b43b50f0b
Rollup merge of #62327 - Flast:patch-1, r=Mark-Simulacrum
Fixed document bug, those replaced each other

Originally reported by #57686, introduced by #58005
2019-07-03 09:59:31 -04:00
Mark Rousskov
08e8c41904
Rollup merge of #62319 - ia0:fix_kleene, r=petrochenkov
Fix mismatching Kleene operators
2019-07-03 09:59:30 -04:00
Mark Rousskov
a0fcf5e6aa
Rollup merge of #62304 - SimonSapin:safe, r=eddyb
HashMap is UnwindSafe

Fixes https://github.com/rust-lang/rust/issues/62301, a regression in 1.36.0-pre which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
2019-07-03 09:59:28 -04:00
Mark Rousskov
7a033aad9d
Rollup merge of #62285 - Mark-Simulacrum:mailmap-mw, r=Centril
Fix michaelwoerister's mailmap

Noticed while going through some changes to thanks.

cc @michaelwoerister
r? @Centril
2019-07-03 09:59:27 -04:00
Mark Rousskov
ea6c1fcf34
Rollup merge of #62255 - Centril:slice-patterns-change-issue, r=varkor
Switch tracking issue for `#![feature(slice_patterns)]`

Switches the tracking issue for `#![feature(slice_patterns)]` to a fresh one in https://github.com/rust-lang/rust/issues/62254 due to new RFCs.

Closes https://github.com/rust-lang/rust/issues/23121.

r? @varkor
2019-07-03 09:59:25 -04:00
Mark Rousskov
8ca4a6a486
Rollup merge of #62250 - czipperz:improve-box-clone-doctests, r=GuillaumeGomez
Improve box clone doctests to ensure the documentation is valid
2019-07-03 09:59:24 -04:00
Mark Rousskov
d1db5e4a85
Rollup merge of #62229 - christianpoveda:intptrcast-explicit-casts, r=RalfJung
Enable intptrcast for explicit casts

I checked locally that this does not break miri on master. r? @RalfJung
2019-07-03 09:59:22 -04:00
Mark Rousskov
b8713e550d
Rollup merge of #62199 - cclauss:patch-1, r=nikomatsakis
import gdb for explicit access to gdb.current_objfile()
2019-07-03 09:59:21 -04:00
Mark Rousskov
aa7999aaee
Rollup merge of #62196 - cramertj:vec-leak, r=centril,withoutboats
Add Vec::leak
2019-07-03 09:59:20 -04:00
Mark Rousskov
37c58c63a7
Rollup merge of #62186 - GuillaumeGomez:add-missing-type-links-into, r=docs
Add missing type urls in Into trait

r? @rust-lang/docs
2019-07-03 09:59:18 -04:00
Mark Rousskov
05704e80bc
Rollup merge of #62183 - alexcrichton:fix-tests, r=nikomatsakis
std: Move a process test out of libstd

This commit moves a test out of libstd which is causing deadlocks on
musl on CI. Looks like the recent update in musl versions brings in some
internal updates to musl which makes `setgid` and `setuid` invalid to
call after a `fork` in a multithreaded program. The issue seen here is
that the child thread was attempting to grab a lock held by a
nonexistent thread, meaning that the child process simply deadlocked
causing the whole test to deadlock.

This commit moves the test to its own file with no threads which should
work.
2019-07-03 09:59:16 -04:00
Mark Rousskov
d9dfed8ca2
Rollup merge of #62161 - GuillaumeGomez:add-missing-tryfrom-links, r=docs
Add missing links for TryFrom docs

r? @rust-lang/docs
2019-07-03 09:59:15 -04:00
Mark Rousskov
25640092c7
Rollup merge of #62128 - ehuss:extra-filename-warning, r=matthewjasper
Adjust warning of -C extra-filename with -o.

If `--emit` includes multiple unnamed outputs, and `-o` was specified, and `-C extra-filename` was specified, the compiler would warn that `-C extra-filename` was ignored, but this is not true.  The "adapting" of the filenames includes the extra-filename info.

Since this is a little convoluted and hard to follow, here is a little chart to summarize when running with `rustc foo.rs -o xyz -C extra-filename=asdf`

`--emit` | Result
---------|--------
`link` | `xyz` (extra-filename ignored)
`link,dep-info` | `xyzasdf`, `xyzasdf.d` (this PR removes the incorrect warning)

As to whether or not this behavior is the best choice is another question.
2019-07-03 09:59:13 -04:00
Mark Rousskov
619df2e0c9
Rollup merge of #62064 - wizAmit:feature/chunks_exact_nth_back, r=scottmcm
nth_back for chunks_exact

wip nth_back for chunks_exact

working nth_back for chunks exact

Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>

r? @timvermeulen
r? @scottmcm
2019-07-03 09:59:12 -04:00
Mark Rousskov
7d5d59160a
Rollup merge of #62021 - crlf0710:msvc_link_output_improve, r=alexcrichton
MSVC link output improve

Resolves #35785.

However i haven't come up with a idea to add test case for this :(

r? @retep998
2019-07-03 09:59:10 -04:00
bors
8c6fb028ca Auto merge of #61995 - eddyb:hir-sep-ptr, r=petrochenkov
rustc: use a separate copy of P for HIR than for AST.

Note: this currently includes/is based on top of #61987.

Like #61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation.
There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle.

r? @petrochenkov cc @rust-lang/compiler
2019-07-03 10:57:39 +00:00
Jeremy Stucki
88c515da07
Revert changes to the standard library
Moved to its own PR
2019-07-03 10:01:03 +02:00
Jeremy Stucki
edcde7025c
Add missing lifetime specifier 2019-07-03 10:01:03 +02:00
Jeremy Stucki
b17cec509e
Add missing lifetime specifier 2019-07-03 10:01:03 +02:00
Jeremy Stucki
80f4c49c1b
Add missing lifetime specifier 2019-07-03 10:01:02 +02:00
Jeremy Stucki
3cd4df70a5
Add missing lifetime specifier 2019-07-03 10:01:02 +02:00
Jeremy Stucki
d28832dde9
Remove needless lifetimes 2019-07-03 10:01:02 +02:00
Jeremy Stucki
ec711767a7
Remove needless lifetimes 2019-07-03 10:01:02 +02:00
Jeremy Stucki
d50a3a7b86
Remove needless lifetimes 2019-07-03 10:01:01 +02:00
Jeremy Stucki
6ae80cf23f
Remove needless lifetimes 2019-07-03 10:01:01 +02:00
Jeremy Stucki
0477e07272
Remove needless lifetimes 2019-07-03 10:00:26 +02:00
Jeremy Stucki
87e8613fd4
Remove needless lifetimes 2019-07-03 10:00:23 +02:00
Kohei Takahashi
e5ede80a9a
Fixed document bug, those replaced each other
Introduced by #58005
2019-07-03 15:59:40 +09:00
bors
8301de16da Auto merge of #61775 - nikomatsakis:issue-56238-multiple-lifetimes-async-fn-region-solver, r=MatthewJasper
generalize impl trait to permit multiple lifetime bounds

Generalizes the region solver to support "pick constraints". These have the form:

```
pick R0 from [R1..Rn]
```

where `R1..Rn` are called the "option regions". The idea is that `R0` must be equal to *some* region in the set `R1..Rn`. These constraints are then used to handle cases like this:

```rust
fn foo<'a, 'b>(...) -> impl Trait<'a, 'b> { .. }
```

The problem here is that every region R in the hidden type must be equal to *either* `'a` *or* `'b` (or `'static`) -- in the past, the only kinds of constraints we had were outlives constraints, and since `'a` and `'b` are unrelated, there was no outlives constraint we could issue that would enforce that (`R: 'a` and `R: 'b` are both too strict, for example). But now we can issue a pick constraint: `pick R from ['a, 'b]`.

In general, solving pick constraints is tricky. We integrate them into the solver as follows. In general, during the propagation phase, we are monotonically growing a set of inference regions. To handle a case like `pick R from [O...]`, where `O...` represents the option regions, we do the following:

- Look for all the *lower bounds* of the region R -- that is, every region LB such that `R: LB` must hold.
- Look for all the *upper bounds* of the region R -- that is, every region UB such that `UB: R` must hold.
- Let the *viable options* be each option region O such that `UB: O` and `O: LB` for each UB, LB bound.
- Find the *minimal viable option* M, where `O: M` holds for every option region O.

If there is such a *minimal viable option*, then we make `R: M`. (This may in turn influence other bits of inference.) If there is no minimal viable option, either because all options were eliminated or because none of the remaining options are minimal, we do nothing. Ultimately, if the pick constraint is not satisfied, an error is reported.

For this logic, we currently require that the option regions O are always lifetime parameters. To determine the bounds, we walk the various outlives edges that were otherwise introduced.

r? @matthewjasper
cc @cramertj

Fixes #56238

TODO:

- [ ] Error messages include region variable info sometimes, how to fix?
- [ ] Tests for bare `existential type`  and other impl Trait usage
2019-07-03 03:47:47 +00:00
Petr Hosek
8d2f80bab3 Use link attributes on extern "C" blocks with llvm-libuwind
When llvm-libunwind feature is enabled, we need to use link attribute on
extern "C" blocks to make sure that symbols provided by LLVM's libunwind
that's built as part of Rust's libunwind crate are re-exported.

This addresses issue #62088.
2019-07-02 16:18:06 -07:00
Julien Cretin
dd702cc653 Fix mismatching Kleene operators 2019-07-03 00:37:25 +02:00
bors
0beb2ba16a Auto merge of #61268 - michaelwoerister:stabilize-pgo, r=alexcrichton
Stabilize support for Profile-guided Optimization

This PR makes profile-guided optimization available via the `-C profile-generate` / `-C profile-use` pair of commandline flags and adds end-user documentation for the feature to the [rustc book](https://doc.rust-lang.org/rustc/). The PR thus ticks the last two remaining checkboxes of the [stabilization tracking issue](https://github.com/rust-lang/rust/issues/59913).

From the tracking issue:
> Profile-guided optimization (PGO) is a common optimization technique for ahead-of-time compilers. It works by collecting data about a program's typical execution (e.g. probability of branches taken, typical runtime values of variables, etc) and then uses this information during program optimization for things like inlining decisions, machine code layout, or indirect call promotion.

If you are curious about how this can be used, there is a rendered version of the documentation this PR adds available [here](
https://github.com/michaelwoerister/rust/blob/stabilize-pgo/src/doc/rustc/src/profile-guided-optimization.md).

r? @alexcrichton
cc @rust-lang/compiler
2019-07-02 20:00:29 +00:00
Niko Matsakis
f7e00a55bb fix ICE with delay-span-bug 2019-07-02 14:23:38 -04:00
Niko Matsakis
0c2c2416bf address nits 2019-07-02 12:25:23 -04:00
Niko Matsakis
7f319a7a41 Update src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-no-fg.rs
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02 12:25:23 -04:00
Niko Matsakis
f130e9a64d Update src/test/ui/async-await/multiple-lifetimes/elided.rs
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02 12:25:23 -04:00
Niko Matsakis
1d93e3cef9 Update src/test/ui/async-await/multiple-lifetimes/fn-ptr.rs
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02 12:25:23 -04:00
Niko Matsakis
8f9a3aff8b Update src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02 12:25:23 -04:00
Niko Matsakis
5bd423a7ca introduce more tests covering async fn surface 2019-07-02 12:25:23 -04:00
Niko Matsakis
076b0d0f5c more nits + typos 2019-07-02 12:25:23 -04:00