]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #62245 - RalfJung:miri-extra-fn, r=eddyb,zackmdavis
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:37:54 +0000 (02:37 +0200)]
Rollup merge of #62245 - RalfJung:miri-extra-fn, r=eddyb,zackmdavis

Miri engine: support extra function (pointer) values

We want to add basic support for `dlsym` in Miri (needed to run the latest version of `getrandom`). For that to work, `dlsym` needs to return *something* that can be stored in a function pointer and later called.

So we add a new `ExtraFnVal` type to the `Machine` trait, and enable Miri's memory to associate allocation IDs with such values, so that `create_fn_alloc` and `get_fn` can work on *both* `Instance` (this is used for "normal" function pointers) and `ExtraFnVal`.

Cc @oli-obk

5 years agoRollup merge of #62151 - alexcrichton:update-openssl, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 6 Jul 2019 00:37:53 +0000 (02:37 +0200)]
Rollup merge of #62151 - alexcrichton:update-openssl, r=Mark-Simulacrum

Update linked OpenSSL version

This bumps our linked OpenSSL version from 1.1.1a to 1.1.1c, picking up
some various bug fixes and minor security issue fixes.

5 years agoAuto merge of #62419 - Centril:rollup-82umycq, r=Centril
bors [Fri, 5 Jul 2019 18:27:52 +0000 (18:27 +0000)]
Auto merge of #62419 - Centril:rollup-82umycq, r=Centril

Rollup of 13 pull requests

Successful merges:

 - #61545 (Implement another internal lints)
 - #62110 (Improve -Ztime-passes)
 - #62133 (Feature gate `rustc` attributes harder)
 - #62158 (Add MemoryExtra in InterpretCx constructor params)
 - #62168 (The (almost) culmination of HirIdification)
 - #62193 (Create async version of the dynamic-drop test)
 - #62369 (Remove `compile-pass` from compiletest)
 - #62380 (rustc_target: avoid negative register counts in the SysV x86_64 ABI.)
 - #62381 (Fix a typo in Write::write_vectored docs)
 - #62390 (Update README.md)
 - #62396 (remove Scalar::is_null_ptr)
 - #62406 (Lint on invalid values passed to x.py --warnings)
 - #62414 (Remove last use of mem::uninitialized in SGX)

Failed merges:

r? @ghost

5 years agoRollup merge of #62414 - jethrogb:jb/sgx-uninit, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:08 +0000 (20:27 +0200)]
Rollup merge of #62414 - jethrogb:jb/sgx-uninit, r=Mark-Simulacrum

Remove last use of mem::uninitialized in SGX

See #62397

5 years agoRollup merge of #62406 - Mark-Simulacrum:warnings-lint, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:06 +0000 (20:27 +0200)]
Rollup merge of #62406 - Mark-Simulacrum:warnings-lint, r=RalfJung

Lint on invalid values passed to x.py --warnings

This also introduces support for `--warnings allow` and fixes --warnings
being overridden by the configuration file, config.toml.

Fixes #62402

r? @RalfJung

5 years agoRollup merge of #62396 - RalfJung:miri-no-null, r=alexcrichton
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:05 +0000 (20:27 +0200)]
Rollup merge of #62396 - RalfJung:miri-no-null, r=alexcrichton

remove Scalar::is_null_ptr

Comparing pointers should be done more carefully than that. With https://github.com/rust-lang/miri/pull/825, Miri does not need it any more and it is otherwise unused.

5 years agoRollup merge of #62390 - markebrooks:encourage, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:04 +0000 (20:27 +0200)]
Rollup merge of #62390 - markebrooks:encourage, r=Centril

Update README.md

Let's not discourage contributions.

5 years agoRollup merge of #62381 - pawroman:fix_typo_in_write_vectored, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:02 +0000 (20:27 +0200)]
Rollup merge of #62381 - pawroman:fix_typo_in_write_vectored, r=Centril

Fix a typo in Write::write_vectored docs

Fixed what seems like a typo. "Copy to from" is extremely confusing.

5 years agoRollup merge of #62380 - eddyb:x64-sysv-regs, r=nagisa
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:27:01 +0000 (20:27 +0200)]
Rollup merge of #62380 - eddyb:x64-sysv-regs, r=nagisa

rustc_target: avoid negative register counts in the SysV x86_64 ABI.

Because `needed_{int,sse}` and `{int,sse}_regs` were only used with integer literals, they were inferred to `i32` and `{int,sse}_regs` could therefore be negative.
There was a check which prevented that, but *only* for aggregate arguments, not scalars.

Fixes #62350.

r? @nagisa or @rkruppe

5 years agoRollup merge of #62369 - JohnTitor:remove-compile-pass, r=petrochenkov
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:59 +0000 (20:26 +0200)]
Rollup merge of #62369 - JohnTitor:remove-compile-pass, r=petrochenkov

Remove `compile-pass` from compiletest

This is a part of #62277.
Removes `compile-pass` from compiletest (and modify some tests' annotations).

r? @Centril

5 years agoRollup merge of #62193 - matthewjasper:dynamic-drop-async, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:58 +0000 (20:26 +0200)]
Rollup merge of #62193 - matthewjasper:dynamic-drop-async, r=Centril

Create async version of the dynamic-drop test

Some of the tests in dynamic-drop have been cut:
* The tests that are just simpler versions of other tests - these tests are already fairly slow due to all of the unwinding and async functions have more control flow paths than normal functions.
* The union test - it's for an unstable feature that has an RFC to remove it.
* The generator test - there aren't async generators yet.
* The tests that show values being leaked - these can be added once the issue is fixed.

r? @Centril
cc  #62121 @cramertj

5 years agoRollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=Zoxc
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:56 +0000 (20:26 +0200)]
Rollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=Zoxc

The (almost) culmination of HirIdification

It's finally over.

This PR removes old `FIXME`s and renames some functions so that the `HirId` variant has the shorter name.
All that remains (and rightfully so) is stuff in `resolve`, `save_analysis` and (as far as I can tell) in a few places where we can't replace `NodeId` with `HirId`.

5 years agoRollup merge of #62158 - christianpoveda:ecx-memory-extra, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:55 +0000 (20:26 +0200)]
Rollup merge of #62158 - christianpoveda:ecx-memory-extra, r=RalfJung

Add MemoryExtra in InterpretCx constructor params

This is to avoid modifying `MemoryExtra` inside `InterpretCx` after initialization. Related miri PR: https://github.com/rust-lang/miri/pull/792

r? @RalfJung

5 years agoRollup merge of #62133 - petrochenkov:norustc, r=eddyb
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:54 +0000 (20:26 +0200)]
Rollup merge of #62133 - petrochenkov:norustc, r=eddyb

Feature gate `rustc` attributes harder

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

5 years agoRollup merge of #62110 - nnethercote:improve-Ztime-passes, r=Zoxc
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:52 +0000 (20:26 +0200)]
Rollup merge of #62110 - nnethercote:improve-Ztime-passes, r=Zoxc

Improve -Ztime-passes

Two improvements that make `-Ztime-passes` more useful.

r? @Zoxc

5 years agoRollup merge of #61545 - flip1995:internal_lints, r=oli-obk
Mazdak Farrokhzad [Fri, 5 Jul 2019 18:26:51 +0000 (20:26 +0200)]
Rollup merge of #61545 - flip1995:internal_lints, r=oli-obk

Implement another internal lints

cc #49509

This adds ~~two~~ one internal lint~~s~~:
1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669
2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~

~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~

TODO (not directly relevant for review):
- [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb)
- [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870
- [x] Check explicitly for the `{declare,impl}_lint_pass!` macros

r? @oli-obk

5 years agoFix test annotation
Yuki Okushi [Fri, 5 Jul 2019 17:06:39 +0000 (02:06 +0900)]
Fix test annotation

5 years agoUpdate rustc-guide
Yuki Okushi [Thu, 4 Jul 2019 11:56:13 +0000 (20:56 +0900)]
Update rustc-guide

5 years agoRemove compile-pass from error codes' explanation
Yuki Okushi [Thu, 4 Jul 2019 11:52:26 +0000 (20:52 +0900)]
Remove compile-pass from error codes' explanation

5 years agoRemove compile-pass from compiletest
Yuki Okushi [Thu, 4 Jul 2019 10:28:20 +0000 (19:28 +0900)]
Remove compile-pass from compiletest

Also change annotations in some tests

5 years agoRemove last use of mem::uninitialized in SGX
Jethro Beekman [Fri, 5 Jul 2019 16:03:49 +0000 (09:03 -0700)]
Remove last use of mem::uninitialized in SGX

5 years agoLint on invalid values passed to x.py --warnings
Mark Rousskov [Fri, 5 Jul 2019 11:24:58 +0000 (07:24 -0400)]
Lint on invalid values passed to x.py --warnings

This also introduces support for `--warnings allow` and fixes --warnings
being overridden by the configuration file, config.toml.

5 years agoAuto merge of #62407 - Centril:rollup-g0zmff7, r=Centril
bors [Fri, 5 Jul 2019 11:53:52 +0000 (11:53 +0000)]
Auto merge of #62407 - Centril:rollup-g0zmff7, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #62123 ( Remove needless lifetimes (std))
 - #62150 (Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.)
 - #62169 (Derive which queries to save using the proc macro)
 - #62238 (Fix code block information icon position)
 - #62292 (Move `async || ...` closures into `#![feature(async_closure)]`)
 - #62323 (Clarify unaligned fields in ptr::{read,write}_unaligned)
 - #62324 (Reduce reliance on `await!(...)` macro)
 - #62371 (Add tracking issue for Box::into_pin)
 - #62383 (Improve error span for async type inference error)
 - #62388 (Break out of the correct number of scopes in loops)

Failed merges:

r? @ghost

5 years agoRollup merge of #62388 - rust-lang:fix-loop-break-mir-generation, r=eddyb
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:13 +0000 (13:53 +0200)]
Rollup merge of #62388 - rust-lang:fix-loop-break-mir-generation, r=eddyb

Break out of the correct number of scopes in loops

We were incorrectly breaking out of one too many drop scopes when
generating MIR for loops and breakable blocks, resulting in use after
free and associated borrow checker warnings.

This wasn't noticed because the scope that we're breaking out of twice
is only used for temporaries that are created for adjustments applied to
the loop. Since loops generally propagate coercions to the `break`
expressions, the only case we see this is when the type of the loop is a
smart pointer to a trait object.

Closes #62312

5 years agoRollup merge of #62383 - Aaron1011:fix/async-error-span, r=varkor
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:11 +0000 (13:53 +0200)]
Rollup merge of #62383 - Aaron1011:fix/async-error-span, r=varkor

Improve error span for async type inference error

Fixes #62382

Previously, we would point at the spawn of the 'await' expression,
instead of the actual expression with an unknown type.

5 years agoRollup merge of #62371 - Nemo157:fix-62288, r=Centril
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:10 +0000 (13:53 +0200)]
Rollup merge of #62371 - Nemo157:fix-62288, r=Centril

Add tracking issue for Box::into_pin

Fixes #62288

5 years agoRollup merge of #62324 - Centril:reduce-await-macro-reliance, r=cramertj
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:09 +0000 (13:53 +0200)]
Rollup merge of #62324 - Centril:reduce-await-macro-reliance, r=cramertj

Reduce reliance on `await!(...)` macro

Only the last commit is new.

r? @cramertj

5 years agoRollup merge of #62323 - Centril:clarify-read-unaligned, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:07 +0000 (13:53 +0200)]
Rollup merge of #62323 - Centril:clarify-read-unaligned, r=RalfJung

Clarify unaligned fields in ptr::{read,write}_unaligned

r? @RalfJung

5 years agoRollup merge of #62292 - Centril:split-async-closures, r=cramertj
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:06 +0000 (13:53 +0200)]
Rollup merge of #62292 - Centril:split-async-closures, r=cramertj

Move `async || ...` closures into `#![feature(async_closure)]`

The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`.

New tracking issue: https://github.com/rust-lang/rust/issues/62290

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

cc https://github.com/rust-lang/rust/issues/62149

r? @varkor

5 years agoRollup merge of #62238 - GuillaumeGomez:fix-code-block-information-icon-pos, r=QuietM...
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:04 +0000 (13:53 +0200)]
Rollup merge of #62238 - GuillaumeGomez:fix-code-block-information-icon-pos, r=QuietMisdreavus

Fix code block information icon position

Fixes #62118.

A screenshot of the fix:

<img width="720" alt="Screenshot 2019-06-29 at 18 28 59" src="https://user-images.githubusercontent.com/3050060/60386900-edb23b80-9a9b-11e9-9f4f-0f343674348c.png">

r? @rust-lang/rustdoc

5 years agoRollup merge of #62169 - Zoxc:store-query-results, r=eddyb
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:02 +0000 (13:53 +0200)]
Rollup merge of #62169 - Zoxc:store-query-results, r=eddyb

Derive which queries to save using the proc macro

Based on https://github.com/rust-lang/rust/pull/62166.

r? @eddyb

5 years agoRollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJung
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:53:00 +0000 (13:53 +0200)]
Rollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJung

Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.

Refs #62061

r? @oli-obk

5 years agoRollup merge of #62123 - jeremystucki:needless_lifetimes_std, r=alexcrichton
Mazdak Farrokhzad [Fri, 5 Jul 2019 11:52:58 +0000 (13:52 +0200)]
Rollup merge of #62123 - jeremystucki:needless_lifetimes_std, r=alexcrichton

 Remove needless lifetimes (std)

Split from #62039

5 years agorustc_target: avoid negative register counts in the SysV x86_64 ABI.
Eduard-Mihai Burtescu [Thu, 4 Jul 2019 16:31:52 +0000 (19:31 +0300)]
rustc_target: avoid negative register counts in the SysV x86_64 ABI.

5 years agoAuto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddyb
bors [Fri, 5 Jul 2019 06:55:48 +0000 (06:55 +0000)]
Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddyb

Remove io::Result from syntax::print

Since we're now writing directly to the vector, there's no need to
thread results through the whole printing infrastructure

5 years agoremove Scalar::is_null_ptr
Ralf Jung [Fri, 5 Jul 2019 06:44:16 +0000 (08:44 +0200)]
remove Scalar::is_null_ptr

Miri does not need it any more and it is otherwise unused

5 years agoAuto merge of #62376 - Mark-Simulacrum:1.38-nightly, r=alexcrichton
bors [Fri, 5 Jul 2019 03:33:03 +0000 (03:33 +0000)]
Auto merge of #62376 - Mark-Simulacrum:1.38-nightly, r=alexcrichton

Switch master to 1.38

5 years agoPermit use of mem::uninitialized via allow(deprecated)
Mark Rousskov [Thu, 4 Jul 2019 15:24:56 +0000 (11:24 -0400)]
Permit use of mem::uninitialized via allow(deprecated)

5 years agoAdd a "total" measurement to -Ztime-passes.
Nicholas Nethercote [Tue, 25 Jun 2019 03:52:07 +0000 (13:52 +1000)]
Add a "total" measurement to -Ztime-passes.

This is useful for getting the total compilation time at the end.
To do this, the patch changes `print_time_passes_entry` to not increment
the depth, which means that `print_time_passes_entry_internal` is no
longer needed.

5 years agoRemove `solve_nll_region_constraints` measurements from `-Ztime-passes` output.
Nicholas Nethercote [Tue, 25 Jun 2019 00:04:47 +0000 (10:04 +1000)]
Remove `solve_nll_region_constraints` measurements from `-Ztime-passes` output.

Because it pollutes the output with hundreds or thousands of
uninteresting lines for which the time duration is always(?) 0.000s.

5 years agoAuto merge of #62153 - alexcrichton:parallel-compress, r=Mark-Simulacrum
bors [Thu, 4 Jul 2019 22:14:08 +0000 (22:14 +0000)]
Auto merge of #62153 - alexcrichton:parallel-compress, r=Mark-Simulacrum

Update the `rust-installer` submodule

This pulls in a commit which uses parallel xz encoding which should
hopefully help shave some time off the dist builders which spend an
inordinate amount of time compressing this data.

5 years agoUpdate README.md
Mark Brooks [Thu, 4 Jul 2019 21:35:26 +0000 (17:35 -0400)]
Update README.md

5 years agoBreak out of the correct number of scopes in loops
Matthew Jasper [Thu, 4 Jul 2019 20:53:46 +0000 (21:53 +0100)]
Break out of the correct number of scopes in loops

We were incorrectly breaking out of one too many drop scopes when
generating MIR for loops and breakable blocks, resulting in use after
free and associated borrow checker warnings.

This wasn't noticed because the scope that we're breaking out of twice
is only used for temporaries that are created for adjustments applied to
the loop. Since loops generally propagate coercions to the `break`
expressions, the only case we see this is when the type of the loop is a
smart pointer to a trait object.

5 years agoCreate async version of the dynamic-drop test
Matthew Jasper [Thu, 27 Jun 2019 20:46:23 +0000 (21:46 +0100)]
Create async version of the dynamic-drop test

5 years agoUpdate the `rust-installer` submodule
Alex Crichton [Wed, 26 Jun 2019 15:24:43 +0000 (08:24 -0700)]
Update the `rust-installer` submodule

This pulls in a commit which uses parallel xz encoding which should
hopefully help shave some time off the dist builders which spend an
inordinate amount of time compressing this data.

5 years agoAuto merge of #61392 - Zoxc:single-interner, r=eddyb
bors [Thu, 4 Jul 2019 18:44:49 +0000 (18:44 +0000)]
Auto merge of #61392 - Zoxc:single-interner, r=eddyb

Use a single CtxtInterners

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

r? @eddyb

5 years agoImprove error span for async type inference error
Aaron Hill [Thu, 4 Jul 2019 18:20:04 +0000 (14:20 -0400)]
Improve error span for async type inference error

Fixes #62382

Previously, we would point at the spawn of the 'await' expression,
instead of the actual expression with an unknown type.

5 years agoFix a typo in Write::write_vectored docs
Paweł Romanowski [Thu, 4 Jul 2019 16:44:34 +0000 (18:44 +0200)]
Fix a typo in Write::write_vectored docs

5 years agoSwitch master to 1.38
Mark Rousskov [Thu, 4 Jul 2019 14:05:50 +0000 (10:05 -0400)]
Switch master to 1.38

5 years agoImplement mem::{zeroed,uninitialized} in terms of MaybeUninit.
Alex Gaynor [Wed, 26 Jun 2019 11:50:30 +0000 (07:50 -0400)]
Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.

Refs #62061

5 years agoAdd tracking issue for Box::into_pin
Wim Looman [Thu, 4 Jul 2019 10:55:23 +0000 (12:55 +0200)]
Add tracking issue for Box::into_pin

5 years agoinfer: fix a Region-related debug message
ljedrz [Tue, 2 Jul 2019 07:43:33 +0000 (09:43 +0200)]
infer: fix a Region-related debug message

5 years agofix a dep_graph doc regarding type_of_item
ljedrz [Tue, 2 Jul 2019 06:45:56 +0000 (08:45 +0200)]
fix a dep_graph doc regarding type_of_item

5 years agoinfer::error_reporting: adjust 2 debug messages
ljedrz [Fri, 28 Jun 2019 07:41:32 +0000 (09:41 +0200)]
infer::error_reporting: adjust 2 debug messages

5 years agorename hir::map::opt_local_def_id*
ljedrz [Thu, 27 Jun 2019 09:49:08 +0000 (11:49 +0200)]
rename hir::map::opt_local_def_id*

5 years agorename hir::map::local_def_id_from_hir_id to local_def_id
ljedrz [Thu, 27 Jun 2019 09:28:14 +0000 (11:28 +0200)]
rename hir::map::local_def_id_from_hir_id to local_def_id

5 years agorename hir::map::local_def_id to local_def_id_from_node_id
ljedrz [Thu, 27 Jun 2019 09:16:59 +0000 (11:16 +0200)]
rename hir::map::local_def_id to local_def_id_from_node_id

5 years agoremove FIXMEs for functions that won't go away
ljedrz [Thu, 27 Jun 2019 08:02:55 +0000 (10:02 +0200)]
remove FIXMEs for functions that won't go away

5 years agoimprove validity error range printing for singleton ranges
Ralf Jung [Mon, 1 Jul 2019 17:19:19 +0000 (19:19 +0200)]
improve validity error range printing for singleton ranges

5 years agoturns out that dangling pointer branch is dead code; remove it and improve the error...
Ralf Jung [Mon, 1 Jul 2019 17:11:32 +0000 (19:11 +0200)]
turns out that dangling pointer branch is dead code; remove it and improve the error that actually gets shown a bit

5 years agouse get_size_and_align to test if an allocation is live
Ralf Jung [Mon, 1 Jul 2019 09:26:28 +0000 (11:26 +0200)]
use get_size_and_align to test if an allocation is live

5 years agoAdd missing lifetime specifier
Jeremy Stucki [Thu, 4 Jul 2019 08:42:24 +0000 (10:42 +0200)]
Add missing lifetime specifier

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
5 years agomake Memory::get_fn take a Scalar like most of the Memory API surface
Ralf Jung [Mon, 1 Jul 2019 09:16:18 +0000 (11:16 +0200)]
make Memory::get_fn take a Scalar like most of the Memory API surface

5 years agofix for tidy
Ralf Jung [Sun, 30 Jun 2019 13:35:39 +0000 (15:35 +0200)]
fix for tidy

5 years agofix determinig the size of foreign static allocations
Ralf Jung [Sun, 30 Jun 2019 13:29:04 +0000 (15:29 +0200)]
fix determinig the size of foreign static allocations

5 years agoadd machine hook to handle calls to 'extra' function values
Ralf Jung [Sun, 30 Jun 2019 13:06:13 +0000 (15:06 +0200)]
add machine hook to handle calls to 'extra' function values

5 years agoAdd basic support for "other" kinds of values for function pointers, determined by...
Ralf Jung [Sun, 30 Jun 2019 11:51:18 +0000 (13:51 +0200)]
Add basic support for "other" kinds of values for function pointers, determined by the machine instance.

So far, however, calling such a function will fail.

5 years agoptr::{read,write}_unaligned: use no_run and reword slightly.
Mazdak Farrokhzad [Thu, 4 Jul 2019 07:54:37 +0000 (09:54 +0200)]
ptr::{read,write}_unaligned: use no_run and reword slightly.

5 years agoFix merge conflicts
Christian Poveda [Thu, 4 Jul 2019 06:45:29 +0000 (01:45 -0500)]
Fix merge conflicts

5 years agoClarify unaligned fields in ptr::read_unaligned.
Mazdak Farrokhzad [Wed, 3 Jul 2019 02:05:05 +0000 (04:05 +0200)]
Clarify unaligned fields in ptr::read_unaligned.

5 years agoAuto merge of #62355 - Centril:rollup-xnxtcgm, r=Centril
bors [Wed, 3 Jul 2019 23:39:36 +0000 (23:39 +0000)]
Auto merge of #62355 - Centril:rollup-xnxtcgm, r=Centril

Rollup of 16 pull requests

Successful merges:

 - #62039 (Remove needless lifetimes (rustc))
 - #62173 (rename InterpretCx -> InterpCx)
 - #62240 (wfcheck: resolve the type-vars in `AdtField` types)
 - #62249 (Use mem::take instead of mem::replace with default)
 - #62252 (Update mem::replace example to not be identical to mem::take)
 - #62258 (syntax: Unsupport `foo! bar { ... }` macros in the parser)
 - #62268 (Clean up inherent_impls)
 - #62287 (Use link attributes on extern "C" blocks with llvm-libuwind)
 - #62295 (miri realloc: do not require giving old size+align)
 - #62297 (refactor check_for_substitution)
 - #62316 (When possible without changing semantics, implement Iterator::last in terms of DoubleEndedIterator::next_back for types in liballoc and libcore.)
 - #62317 (Migrate `compile-pass` annotations to `build-pass`)
 - #62337 (Fix bucket in CPU usage script)
 - #62344 (simplify Option::get_or_insert)
 - #62346 (enable a few more tests in Miri and update the comment for others)
 - #62351 (remove bogus example from drop_in_place)

Failed merges:

r? @ghost

5 years agoRollup merge of #62351 - RalfJung:drop-in-place, r=cramertj
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:39:04 +0000 (01:39 +0200)]
Rollup merge of #62351 - RalfJung:drop-in-place, r=cramertj

remove bogus example from drop_in_place

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

5 years agoRollup merge of #62346 - RalfJung:miri-tests, r=Centril
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:39:02 +0000 (01:39 +0200)]
Rollup merge of #62346 - RalfJung:miri-tests, r=Centril

enable a few more tests in Miri and update the comment for others

5 years agoRollup merge of #62344 - matklad:simplify-option, r=sfackler
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:39:01 +0000 (01:39 +0200)]
Rollup merge of #62344 - matklad:simplify-option, r=sfackler

simplify Option::get_or_insert

I am pretty sure that the optimized result will be the same, and it's one `unsafe` less in the stdlib!

5 years agoRollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:59 +0000 (01:38 +0200)]
Rollup merge of #62337 - Mark-Simulacrum:fix-cpu-usage-script, r=alexcrichton

Fix bucket in CPU usage script

r? @alexcrichton

5 years agoRollup merge of #62317 - JohnTitor:move-tests-to-build-pass, r=Centril
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:58 +0000 (01:38 +0200)]
Rollup merge of #62317 - JohnTitor:move-tests-to-build-pass, r=Centril

Migrate `compile-pass` annotations to `build-pass`

This is a part of #62277.

As a first step, the `compile-pass` tests are migrated to `build-pass`.

r? @cramertj
cc @Centril

5 years agoRollup merge of #62316 - khuey:efficient_last, r=sfackler
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:56 +0000 (01:38 +0200)]
Rollup merge of #62316 - khuey:efficient_last, r=sfackler

When possible without changing semantics, implement Iterator::last in terms of DoubleEndedIterator::next_back for types in liballoc and libcore.

Provided that the iterator has finite length and does not trigger user-provided code, this is safe.

What follows is a full list of the DoubleEndedIterators in liballoc/libcore and whether this optimization is safe, and if not, why not.

src/liballoc/boxed.rs
Box: Pass through to avoid defeating optimization of the underlying DoubleIterator implementation. This has no correctness impact.

src/liballoc/collections/binary_heap.rs
Iter: Pass through to avoid defeating optimizations on slice::Iter
IntoIter: Not safe, changes Drop order
Drain: Not safe, changes Drop order

src/liballoc/collections/btree/map.rs
Iter: Safe to call next_back, invokes no user defined code.
IterMut: ditto
IntoIter: Not safe, changes Drop order
Keys: Safe to call next_back, invokes no user defined code.
Values: ditto
ValuesMut: ditto
Range: ditto
RangeMut: ditto

src/liballoc/collections/btree/set.rs
Iter: Safe to call next_back, invokes no user defined code.
IntoIter: Not safe, changes Drop order
Range: Safe to call next_back, invokes no user defined code.

src/liballoc/collections/linked_list.rs
Iter: Safe to call next_back, invokes no user defined code.
IterMut: ditto
IntoIter: Not safe, changes Drop order

src/liballoc/collections/vec_deque.rs
Iter: Safe to call next_back, invokes no user defined code.
IterMut: ditto
IntoIter: Not safe, changes Drop order
Drain: ditto

src/liballoc/string.rs
Drain: Safe because return type is a primitive (char)

src/liballoc/vec.rs
IntoIter: Not safe, changes Drop order
Drain: ditto
Splice: ditto

src/libcore/ascii.rs
EscapeDefault: Safe because return type is a primitive (u8)

src/libcore/iter/adapters/chain.rs
Chain: Not safe, invokes user defined code (Iterator impl)

src/libcore/iter/adapters/flatten.rs
FlatMap: Not safe, invokes user defined code (Iterator impl)
Flatten: ditto
FlattenCompat: ditto

src/libcore/iter/adapters/mod.rs
Rev: Not safe, invokes user defined code (Iterator impl)
Copied: ditto
Cloned: Not safe, invokes user defined code (Iterator impl and T::clone)
Map: Not safe, invokes user defined code (Iterator impl + closure)
Filter: ditto
FilterMap: ditto
Enumerate: Not safe, invokes user defined code (Iterator impl)
Skip: ditto
Fuse: ditto
Inspect: ditto

src/libcore/iter/adapters/zip.rs
Zip: Not safe, invokes user defined code (Iterator impl)

src/libcore/iter/range.rs
ops::Range: Not safe, changes Drop order, but ALREADY HAS SPECIALIZATION
ops::RangeInclusive: ditto

src/libcore/iter/sources.rs
Repeat: Not safe, calling last should iloop.
Empty: No point, iterator is at most one item long.
Once: ditto
OnceWith: ditto

src/libcore/option.rs
Item: No point, iterator is at most one item long.
Iter: ditto
IterMut: ditto
IntoIter: ditto

src/libcore/result.rs
Iter: No point, iterator is at most one item long
IterMut: ditto
IntoIter: ditto

src/libcore/slice/mod.rs
Split: Not safe, invokes user defined closure
SplitMut: ditto
RSplit: ditto
RSplitMut: ditto
Windows: Safe, already has specialization
Chunks: ditto
ChunksMut: ditto
ChunksExact: ditto
ChunksExactMut: ditto
RChunks: ditto
RChunksMut: ditto
RChunksExact: ditto
RChunksExactMut: ditto

src/libcore/str/mod.rs
Chars: Safe, already has specialization
CharIndices: ditto
Bytes: ditto
Lines: Safe to call next_back, invokes no user defined code.
LinesAny: Deprecated
Everything that is generic over P: Pattern: Not safe because Pattern invokes user defined code.
SplitWhitespace: Safe to call next_back, invokes no user defined code.
SplitAsciiWhitespace: ditto

This is attempt 2 of #60130.

r? @sfackler

5 years agoRollup merge of #62297 - matklad:peek-delimited, r=petrochenkov
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:55 +0000 (01:38 +0200)]
Rollup merge of #62297 - matklad:peek-delimited, r=petrochenkov

refactor check_for_substitution

No behavior change, just flatter and simpler code.

r? @petrochenkov

5 years agoRollup merge of #62295 - RalfJung:miri-realloc, r=cramertj
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:53 +0000 (01:38 +0200)]
Rollup merge of #62295 - RalfJung:miri-realloc, r=cramertj

miri realloc: do not require giving old size+align

5 years agoRollup merge of #62287 - petrhosek:libunwind-link-attribute, r=tmandry
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:52 +0000 (01:38 +0200)]
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.

5 years agoRollup merge of #62268 - Zoxc:inherent_impls, r=eddyb
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:50 +0000 (01:38 +0200)]
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

5 years agoRollup merge of #62258 - petrochenkov:idclean, r=Centril
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:49 +0000 (01:38 +0200)]
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

5 years agoRollup merge of #62252 - czipperz:change-mem-replace-doc-example, r=dtolnay
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:47 +0000 (01:38 +0200)]
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.

5 years agoRollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, r=dtolnay...
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:46 +0000 (01:38 +0200)]
Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, r=dtolnay,Centril

Use mem::take instead of mem::replace with default

5 years agoRollup merge of #62240 - arielb1:resolve-wf-fields, r=pnkfelix
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:44 +0000 (01:38 +0200)]
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.

5 years agoRollup merge of #62173 - RalfJung:miri-interp, r=oli-obk
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:42 +0000 (01:38 +0200)]
Rollup merge of #62173 - RalfJung:miri-interp, r=oli-obk

rename InterpretCx -> InterpCx

That's more consistent with InterpResult and InterpError.

r? @oli-obk

5 years agoRollup merge of #62039 - jeremystucki:needless_lifetimes, r=eddyb
Mazdak Farrokhzad [Wed, 3 Jul 2019 23:38:41 +0000 (01:38 +0200)]
Rollup merge of #62039 - jeremystucki:needless_lifetimes, r=eddyb

Remove needless lifetimes (rustc)

5 years agoReduce reliance on feature(await_macro).
Mazdak Farrokhzad [Wed, 3 Jul 2019 22:25:14 +0000 (00:25 +0200)]
Reduce reliance on feature(await_macro).

5 years agoAdjust tests wrt. 'async_closure' feature gate.
Mazdak Farrokhzad [Tue, 2 Jul 2019 02:12:29 +0000 (04:12 +0200)]
Adjust tests wrt. 'async_closure' feature gate.

5 years agoAdd separate 'async_closure' feature gate.
Mazdak Farrokhzad [Tue, 2 Jul 2019 02:10:19 +0000 (04:10 +0200)]
Add separate 'async_closure' feature gate.

5 years agoremove bogus example from drop_in_place
Ralf Jung [Wed, 3 Jul 2019 18:13:42 +0000 (20:13 +0200)]
remove bogus example from drop_in_place

5 years agoenable a few more tests in Miri and update the comment for others
Ralf Jung [Wed, 3 Jul 2019 17:41:16 +0000 (19:41 +0200)]
enable a few more tests in Miri and update the comment for others

5 years agosimplify Option::get_or_insert
Aleksey Kladov [Wed, 3 Jul 2019 17:17:05 +0000 (20:17 +0300)]
simplify Option::get_or_insert

5 years agoAuto merge of #62335 - Mark-Simulacrum:rollup-0pcaz5a, r=Mark-Simulacrum
bors [Wed, 3 Jul 2019 14:29:08 +0000 (14:29 +0000)]
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

5 years agoFix bucket in CPU usage script
Mark Rousskov [Wed, 3 Jul 2019 14:19:59 +0000 (10:19 -0400)]
Fix bucket in CPU usage script

5 years agoRollup merge of #62327 - Flast:patch-1, r=Mark-Simulacrum
Mark Rousskov [Wed, 3 Jul 2019 13:59:31 +0000 (09:59 -0400)]
Rollup merge of #62327 - Flast:patch-1, r=Mark-Simulacrum

Fixed document bug, those replaced each other

Originally reported by #57686, introduced by #58005

5 years agoRollup merge of #62319 - ia0:fix_kleene, r=petrochenkov
Mark Rousskov [Wed, 3 Jul 2019 13:59:30 +0000 (09:59 -0400)]
Rollup merge of #62319 - ia0:fix_kleene, r=petrochenkov

Fix mismatching Kleene operators

5 years agoRollup merge of #62304 - SimonSapin:safe, r=eddyb
Mark Rousskov [Wed, 3 Jul 2019 13:59:28 +0000 (09:59 -0400)]
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>`.

5 years agoRollup merge of #62285 - Mark-Simulacrum:mailmap-mw, r=Centril
Mark Rousskov [Wed, 3 Jul 2019 13:59:27 +0000 (09:59 -0400)]
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

5 years agoRollup merge of #62255 - Centril:slice-patterns-change-issue, r=varkor
Mark Rousskov [Wed, 3 Jul 2019 13:59:25 +0000 (09:59 -0400)]
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