Commit graph

94764 commits

Author SHA1 Message Date
Mazdak Farrokhzad
8917b8e32c
Rollup merge of #61791 - Centril:cleanup-check_pat_path, r=petrochenkov
Small cleanup in `check_pat_path`
2019-06-13 14:52:00 +02:00
Mazdak Farrokhzad
e70a1062ac
Rollup merge of #61766 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from c0dbd34b to bd33a97c

Changes:
````
Fix implicit_return docs
rustup https://github.com/rust-lang/rust/pull/61758/files
Remove wrong lifetime from LintContext
Workaround for rust-lang/rustfmt#3615
Fixing eta with respect to lazy evaluation.
````
r? @oli-obk
2019-06-13 14:51:59 +02:00
Mazdak Farrokhzad
e45c83ca23
Rollup merge of #61757 - sfackler:deprecate-once-init, r=alexcrichton
Deprecate ONCE_INIT in future 1.38 release

Once::new() has been a stable const fn for a while now.

Closes #61746
2019-06-13 14:51:57 +02:00
Mazdak Farrokhzad
ca06f8896b
Rollup merge of #61720 - alexcrichton:libstd-cfg-if-dep, r=sfackler
std: Remove internal definitions of `cfg_if!` macro

This is duplicated in a few locations throughout the sysroot to work
around issues with not exporting a macro in libstd but still wanting it
available to sysroot crates to define blocks. Nowadays though we can
simply depend on the `cfg-if` crate on crates.io, allowing us to use it
from there!
2019-06-13 14:51:56 +02:00
Mazdak Farrokhzad
a0d05150c9
Rollup merge of #61598 - estebank:const-idx, r=oli-obk
Handle index out of bound errors during const eval without panic

Fix #61595
2019-06-13 14:51:53 +02:00
bors
96636f3eb8 Auto merge of #61743 - RalfJung:miri, r=oli-obk
update miri

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

r? @oli-obk
2019-06-13 08:28:15 +00:00
Ralf Jung
4e8626e4af update miri 2019-06-13 10:03:12 +02:00
Matthias Krüger
64d279bb84 submodules: update clippy from c0dbd34b to 7b2a7a22
Changes:
````
Fix wrong lifetime of TyCtxt
travis: Wait at most 30 minutes for base test
Typos and minor grammar corrections
Adds lint for integer division
redundant_closure_for_method_calls fixes: lint does not trigger when there is a difference in mutability lint does not trigger when the method belongs to a trait which is not implemebted directly (Deref)
Fix implicit_return docs
rustup https://github.com/rust-lang/rust/pull/61758/files
Remove wrong lifetime from LintContext
Workaround for rust-lang/rustfmt#3615
Fixing eta with respect to lazy evaluation.
````
2019-06-13 08:25:08 +02:00
Steven Fackler
72e99f57c5 Deprecate ONCE_INIT
Once::new() has been a stable const fn for a while now.

Closes #61746
2019-06-12 21:32:51 -07:00
bors
e011fe1c13 Auto merge of #61597 - lnicola:bump-rand, r=alexcrichton
Bump dirs, rand and redox_users

Part of #57724.
2019-06-13 04:19:28 +00:00
Mazdak Farrokhzad
a947b75196 Small cleanup in check_pat_path. 2019-06-13 04:58:12 +02:00
bors
d8f50ab0ea Auto merge of #61789 - Centril:rollup-hhyvopq, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #60376 (Stabilize Option::xor)
 - #61398 (Stabilize copy_within)
 - #61629 (Hygienize macros in the standard library)
 - #61675 (Include frame pointer for bare metal RISC-V targets)
 - #61750 (Fix x.py install)
 - #61761 (Add an alias for x86_64-sun-solaris target tuple)
 - #61762 (rustbuild: fix libtest_stamp)
 - #61763 (ci: fix ci stats upload condition)
 - #61776 (Fix typos in error_codes)

Failed merges:

r? @ghost
2019-06-13 01:32:17 +00:00
Mazdak Farrokhzad
af281d24ca
Rollup merge of #61776 - JohnTitor:fix-typo-in-error-codes, r=Centril
Fix typos in error_codes

`observedin` should be `observed in`.
2019-06-13 01:49:37 +02:00
Mazdak Farrokhzad
3272e6e750
Rollup merge of #61763 - pietroalbini:azure-fix-condition, r=alexcrichton
ci: fix ci stats upload condition

The condition I suggested in #61632 was not correct and it errors out while evaluating. This fixes the condition. [Example of a failure](https://dev.azure.com/rust-lang/rust/_build/results?buildId=543).

r? @alexcrichton
2019-06-13 01:49:35 +02:00
Mazdak Farrokhzad
555b2d9250
Rollup merge of #61762 - Keruspe:rustbuild-libtest-fix, r=Mark-Simulacrum
rustbuild: fix libtest_stamp

Looks like an obvious copy/paste typo
2019-06-13 01:49:33 +02:00
Mazdak Farrokhzad
b03ffbc69a
Rollup merge of #61761 - lzutao:target-tuple-solaris, r=varkor
Add an alias for x86_64-sun-solaris target tuple

Closes #40531

r? @varkor
2019-06-13 01:49:32 +02:00
Mazdak Farrokhzad
4cbae09efa
Rollup merge of #61750 - tmandry:fix-install, r=Mark-Simulacrum
Fix x.py install

Make sure we look for save analysis in the right place. Fixes #61703.

r? @Mark-Simulacrum
cc @petrhosek @cramertj
2019-06-13 01:49:31 +02:00
Mazdak Farrokhzad
0d8d08d067
Rollup merge of #61675 - fintelia:riscv-frame-pointer, r=nagisa
Include frame pointer for bare metal RISC-V targets

This changes the default setting to enable the use of the frame pointer register when targeting RISC-V. On that architecture there is a dedicated frame pointer register which LLVM would otherwise never use so there is no increase in register pressure. Further, since these are bare metal targets, getting backtraces without the frame pointer is considerably more difficult (you can't just ask the OS to load the ELF executable and parse DWARF symbols). It is true that this setting can also be changed with the `-C force-frame-pointers` flag but that won't impact the compilation of the standard library, meaning that backtraces from, say, a panic handler would be useless.
2019-06-13 01:49:29 +02:00
Mazdak Farrokhzad
96b58301a3
Rollup merge of #61629 - petrochenkov:stdmac, r=alexcrichton
Hygienize macros in the standard library

Same as https://github.com/rust-lang/rust/pull/55597, but for all macros in the standard library.
Nested macro calls will now call what they are intended to call rather than whatever is in the closest scope at call site.
Technically this is a breaking change, so crater run would probably be useful.

---

One exception that is not hygienized is calls to `panic!(...)`.
Macros defined in libcore do not want to call `core::panic`.
What they really want to call is either `std::panic` or `core::panic` depending on `no_std` settings.
EDIT: After some thought, recursive calls to `panic` from `panic` itself probably do want to use `$crate` (UPDATE: done).

Calling `std::panic` from macros defined in std and "whatever `panic` is in scope" from macros defined in libcore is probably even worse than always calling "whatever `panic` is in scope", so I kept the existing code.

The only way to do the std/core switch correctly that I'm aware of is to define a built-in panic macro that would dispatch to `std::panic` or `core::panic` using compiler magic.
Then standard library macros could delegate to this built-in macro.
The macro could be named `panic` too, that would fix https://github.com/rust-lang/rust/issues/61567.
(This PR doesn't do that.)

---
cc https://github.com/rust-lang/rust/issues/56389
cc https://github.com/rust-lang/rust/issues/61567
Fixes https://github.com/rust-lang/rust/issues/61699
r? @alexcrichton
2019-06-13 01:49:27 +02:00
Mazdak Farrokhzad
a1ff450a68
Rollup merge of #61398 - kennytm:stabilize-copy-within, r=SimonSapin
Stabilize copy_within

Closes #54236.
2019-06-13 01:49:26 +02:00
Mazdak Farrokhzad
b35aeae5b4
Rollup merge of #60376 - lzutao:stabilize-option_xor, r=SimonSapin
Stabilize Option::xor

FCP done in https://github.com/rust-lang/rust/issues/50512#issuecomment-469527554 .

Closes #50512 .
2019-06-13 01:49:24 +02:00
Esteban Küber
ef6240a3e3 Handle index out of bound errors during const eval without panic 2019-06-12 14:58:53 -07:00
bors
2887008e0c Auto merge of #61426 - Zoxc:just-tcx-mir-building, r=eddyb
Use a single lifetime for MIR construction

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

r? @eddyb
2019-06-12 19:24:40 +00:00
Lzu Tao
7c8644dc23 Add an alias for x86_64-sun-solaris target tuple 2019-06-12 19:04:43 +00:00
Vadim Petrochenkov
eb09daa762 Hygienize macros in the standard library 2019-06-12 20:27:29 +03:00
John Kåre Alsaker
d3e1181b1c Use a single lifetime for MIR construction 2019-06-12 19:27:00 +02:00
Laurențiu Nicola
b888eb92c5 Bump some of the crates using rand 2019-06-12 19:39:14 +03:00
bors
55cee44671 Auto merge of #61612 - nnethercote:improve-parse_bottom_expr, r=petrochenkov
Special-case literals in `parse_bottom_expr`.

This makes parsing faster, particularly for code with large constants,
for two reasons:
- it skips all the keyword comparisons for literals;
- it skips the allocation done by the `mk_expr` call in
  `parse_literal_maybe_minus`.

r? @petrochenkov
2019-06-12 16:30:05 +00:00
Yuki Okushi
b8f1491f6e Fix typos 2019-06-13 00:37:30 +09:00
bors
24ddd16154 Auto merge of #61722 - eddyb:vowel-exclusion-zone, r=oli-obk
rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.

This first lifetime parameter of `TyCtxt` has been phantom for a while, thanks to @Zoxc, but was never removed, and I'm doing this now in preparation for removing the `'gcx`/`'tcx` split.

I wasn't going to do this as a separate step, and instead start converting uses of `TyCtxt` to a single-lifetime alias of it (e.g. `type TyCx<'tcx> = TyCtxt<'tcx, 'tcx, 'tcx>;`) but it turns out (as @Zoxc rightly predicted) that there is far more fallout from not needing a lifetime for the first parameter of `TyCtxt`.

That is, going from `TyCtxt<'a, 'gcx, 'tcx>` to `TyCtxt<'tcx, 'gcx, 'tcx>` (the first commit in this PR) has the largest amount of fallout out of all the changes we might make (because it can require removing the `'a` parameter of `struct`s containing `tcx: TyCtxt<'a, ...>`), and is the hardest to automate (because `'a` is used everywhere, not just with `TyCtxt`, unlike, say `'gcx, 'tcx` -> `'tcx`).

So I'm submitting this now to get it out of the way and reduce further friction in the future.

**EDIT**: for the `rustfmt` commit, I used https://github.com/rust-lang/rustfmt/issues/1324#issuecomment-482109952, and manually filtered out some noise, like in #61735, but unlike that PR, there was also a weird bug to work around.
It should be reviewed separately, and dropped if unwanted.

cc @rust-lang/compiler r? @nikomatsakis
2019-06-12 13:41:43 +00:00
Eduard-Mihai Burtescu
4c98cb6f75 rustc_codegen_llvm: deny(internal). 2019-06-12 16:06:35 +03:00
Eduard-Mihai Burtescu
87b6b86468 rustc_codegen_llvm: deny(unused_lifetimes). 2019-06-12 16:02:03 +03:00
Pietro Albini
2cd516c1c3
ci: fix ci stats upload condition
The condition I suggested in #61632 was not correct and it errors out
while evaluating. This fixes the condition.

Example of a failure:
https://dev.azure.com/rust-lang/rust/_build/results?buildId=543
2019-06-12 14:21:59 +02:00
bors
3d7a1c9dc8 Auto merge of #61587 - alexcrichton:distcheck-no-assertions, r=pietroalbini
ci: Disable LLVM/debug assertions for distcheck

The purpose of distcheck is to test `./x.py test` from a tarball, not to
test that all assertions pass all the time. These assertions are largely
just redundant with other builders, so skip the assertions for now and
save a good chunk of time on CI.

cc #61185
2019-06-12 10:51:16 +00:00
Eduard-Mihai Burtescu
fff08cb043 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-12 13:38:28 +03:00
Eduard-Mihai Burtescu
21ac960334 rustc: remove some unnecessary lifetimes in -> TyCtxt methods. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
17cdd356da rustc: replace TyCtxt<'tcx, 'gcx, 'tcx> with TyCtxt<'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
2441253508 Fix fallout from deny(unused_lifetimes). 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
37799a5552 rustc: replace TyCtxt<'a, 'gcx, 'tcx> with TyCtxt<'tcx, 'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Marc-Antoine Perennou
e7b5586cd6 rustbuild: fix libtest_stamp
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-12 10:18:16 +02:00
bors
3f511ade5b Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkov
Allow attributes in formal function parameters

Implements https://github.com/rust-lang/rust/issues/60406.

This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made.

**TODO**

- [x] Forbid some built-in attributes.
- [x] Expand cfg/cfg_attr
2019-06-12 07:38:01 +00:00
bors
c4797fa4f4 Auto merge of #61758 - Centril:rollup-ew2uxng, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #60187 (Generator optimization: Overlap locals that never have storage live at the same time)
 - #61348 (Implement Clone::clone_from for Option and Result)
 - #61568 (Use Symbol, Span in libfmt_macros)
 - #61632 (ci: Collect CPU usage statistics on Azure)
 - #61654 (use pattern matching for slices destructuring)
 - #61671 (implement nth_back for Range(Inclusive))
 - #61688 (is_fp and is_floating_point do the same thing, remove the former)
 - #61705 (Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS)
 - #61734 (Migrate rust-by-example to MdBook2)

Failed merges:

r? @ghost
2019-06-12 04:57:35 +00:00
Mazdak Farrokhzad
4748b5b13d
Rollup merge of #61734 - mati865:books, r=alexcrichton
Migrate rust-by-example to MdBook2
2019-06-12 04:22:56 +02:00
Mazdak Farrokhzad
adea1317c2
Rollup merge of #61705 - petrhosek:llvm-cflags, r=alexcrichton
Pass cflags rather than cxxflags to LLVM as CMAKE_C_FLAGS

We mistakenly pass cxxflags from the configuration to LLVM build as
CMAKE_C_FLAGS.
2019-06-12 04:22:55 +02:00
Mazdak Farrokhzad
ba5b04ac46
Rollup merge of #61688 - RalfJung:is-floating-point, r=cramertj
is_fp and is_floating_point do the same thing, remove the former

also consistently mark all these `is_*` methods for inlining
2019-06-12 04:22:53 +02:00
Mazdak Farrokhzad
3a8dc44f3c
Rollup merge of #61671 - koalatux:nth-back-range, r=KodrAus
implement nth_back for Range(Inclusive)

This is part of  #54054.
2019-06-12 04:22:51 +02:00
Mazdak Farrokhzad
9f22708ced
Rollup merge of #61654 - Electron-libre:use_slice_patterns_in_rustc, r=oli-obk,Centril
use pattern matching for slices destructuring

refs #61542

Use slices pattern where it seems to make sense .
2019-06-12 04:22:50 +02:00
Mazdak Farrokhzad
6933034a40
Rollup merge of #61632 - alexcrichton:azure-pipelines-cpu, r=pietroalbini
ci: Collect CPU usage statistics on Azure

This commit adds a script which we'll execute on Azure Pipelines which
is intended to run in the background and passively collect CPU usage
statistics for our builders. The intention here is that we can use this
information over time to diagnose issues with builders, see where we can
optimize our build, fix parallelism issues, etc. This might not end up
being too useful in the long run but it's data we've wanted to collect
for quite some time now, so here's a stab at it!

Comments about how this is intended to work can be found in the python
script used here to collect CPU usage statistics.

Closes #48828
2019-06-12 04:22:48 +02:00
Mazdak Farrokhzad
d78260d781
Rollup merge of #61568 - Mark-Simulacrum:symbol-fmt-macros, r=estebank
Use Symbol, Span in libfmt_macros

I'm not super happy with this, personally, but I think it might be a decent start -- happy to take suggestions as to how to expand this or change things further.

r? @estebank

Fixes #60795
2019-06-12 04:22:47 +02:00
Mazdak Farrokhzad
b5184e56a4
Rollup merge of #61348 - dronesforwork-forks:clone-from, r=KodrAus
Implement Clone::clone_from for Option and Result

See https://github.com/rust-lang/rust/issues/28481
2019-06-12 04:22:45 +02:00