Commit Graph

95709 Commits

Author SHA1 Message Date
Mazdak Farrokhzad 26144fe869 Lowering: Fuse ExprKind::While logic + Cleanup. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad 547735457f Make WhileTrue into an EarlyLintPass lint. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad f01562af33 Make sure while-exprs require 'cond: bool' exactly. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad ebcc966ac1 Adjust incremental test while_loops.rs 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad 7d1cd41be3 while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad 4edfa6d4c9 Enforce 'cond: bool' in while-expr + improve reachability diags. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad e7b544ee83 min_const_fn: change error message due to changed desugaring. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad f8b32dfb27 Remove ExprKind::While from HIR. 2019-07-06 06:43:58 +02:00
bors 481068a707 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
2019-07-05 18:27:52 +00:00
Mazdak Farrokhzad e89bd8c308
Rollup merge of #62414 - jethrogb:jb/sgx-uninit, r=Mark-Simulacrum
Remove last use of mem::uninitialized in SGX

See #62397
2019-07-05 20:27:08 +02:00
Mazdak Farrokhzad cc453d9895
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
2019-07-05 20:27:06 +02:00
Mazdak Farrokhzad 3c2cba847b
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.
2019-07-05 20:27:05 +02:00
Mazdak Farrokhzad 4ac3e626a7
Rollup merge of #62390 - markebrooks:encourage, r=Centril
Update README.md

Let's not discourage contributions.
2019-07-05 20:27:04 +02:00
Mazdak Farrokhzad c5d18600ef
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.
2019-07-05 20:27:02 +02:00
Mazdak Farrokhzad 58f402aab7
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
2019-07-05 20:27:01 +02:00
Mazdak Farrokhzad 216a1871bb
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
2019-07-05 20:26:59 +02:00
Mazdak Farrokhzad 30aa2450e1
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
2019-07-05 20:26:58 +02:00
Mazdak Farrokhzad 2e86c006f7
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`.
2019-07-05 20:26:56 +02:00
Mazdak Farrokhzad b41a62ef69
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
2019-07-05 20:26:55 +02:00
Mazdak Farrokhzad 0224532493
Rollup merge of #62133 - petrochenkov:norustc, r=eddyb
Feature gate `rustc` attributes harder

Fixes https://github.com/rust-lang/rust/issues/62116
2019-07-05 20:26:54 +02:00
Mazdak Farrokhzad 40841e049a
Rollup merge of #62110 - nnethercote:improve-Ztime-passes, r=Zoxc
Improve -Ztime-passes

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

r? @Zoxc
2019-07-05 20:26:52 +02:00
Mazdak Farrokhzad 485a084b45
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) 🤔 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
2019-07-05 20:26:51 +02:00
Yuki Okushi 1640ab2e1f Fix test annotation 2019-07-06 02:06:39 +09:00
Yuki Okushi 211b52bb23 Update rustc-guide 2019-07-06 02:06:00 +09:00
Yuki Okushi db93d01493 Remove compile-pass from error codes' explanation 2019-07-06 02:06:00 +09:00
Yuki Okushi ce77031e96 Remove compile-pass from compiletest
Also change annotations in some tests
2019-07-06 02:06:00 +09:00
Jethro Beekman 7fb17d868b Remove last use of mem::uninitialized in SGX 2019-07-05 09:03:49 -07:00
Mark Rousskov f01e5e6ce7 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.
2019-07-05 10:14:24 -04:00
bors 853f30052d 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
2019-07-05 11:53:52 +00:00
Mazdak Farrokhzad 18081890ea
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
2019-07-05 13:53:13 +02:00
Mazdak Farrokhzad cc696b957b
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.
2019-07-05 13:53:11 +02:00
Mazdak Farrokhzad ccd925bc7d
Rollup merge of #62371 - Nemo157:fix-62288, r=Centril
Add tracking issue for Box::into_pin

Fixes #62288
2019-07-05 13:53:10 +02:00
Mazdak Farrokhzad 7d6e43177c
Rollup merge of #62324 - Centril:reduce-await-macro-reliance, r=cramertj
Reduce reliance on `await!(...)` macro

Only the last commit is new.

r? @cramertj
2019-07-05 13:53:09 +02:00
Mazdak Farrokhzad d3569ddf32
Rollup merge of #62323 - Centril:clarify-read-unaligned, r=RalfJung
Clarify unaligned fields in ptr::{read,write}_unaligned

r? @RalfJung
2019-07-05 13:53:07 +02:00
Mazdak Farrokhzad 84527e4676
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
2019-07-05 13:53:06 +02:00
Mazdak Farrokhzad 61256a8164
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
2019-07-05 13:53:04 +02:00
Mazdak Farrokhzad 4b21e20f8e
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
2019-07-05 13:53:02 +02:00
Mazdak Farrokhzad 1d45156866
Rollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJung
Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.

Refs #62061

r? @oli-obk
2019-07-05 13:53:00 +02:00
Mazdak Farrokhzad 0f92eb8a4a
Rollup merge of #62123 - jeremystucki:needless_lifetimes_std, r=alexcrichton
Remove needless lifetimes (std)

Split from #62039
2019-07-05 13:52:58 +02:00
Eduard-Mihai Burtescu 050a71b570 rustc_target: avoid negative register counts in the SysV x86_64 ABI. 2019-07-05 13:24:25 +03:00
bors f119bf2761 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
2019-07-05 06:55:48 +00:00
Ralf Jung 50510e4491 remove Scalar::is_null_ptr
Miri does not need it any more and it is otherwise unused
2019-07-05 08:44:19 +02:00
bors baab1914ec Auto merge of #62376 - Mark-Simulacrum:1.38-nightly, r=alexcrichton
Switch master to 1.38
2019-07-05 03:33:03 +00:00
Mark Rousskov 007d87f171 Permit use of mem::uninitialized via allow(deprecated) 2019-07-04 21:01:35 -04:00
Nicholas Nethercote 87b103d4a9 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.
2019-07-05 08:19:48 +10:00
Nicholas Nethercote 90419d36bd 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.
2019-07-05 08:19:43 +10:00
bors 4ca7a349da 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.
2019-07-04 22:14:08 +00:00
Mark Brooks f4b30f4bae
Update README.md 2019-07-04 17:35:26 -04:00
Matthew Jasper 1b7ffe5300 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.
2019-07-04 21:53:46 +01:00
Matthew Jasper 61ddf5e85c Create async version of the dynamic-drop test 2019-07-04 20:23:21 +01:00