Commit graph

128449 commits

Author SHA1 Message Date
Jonas Schievink
fea2ad8a0a
Rollup merge of #77340 - pickfire:patch-9, r=kennytm
Alloc vec use imported path

mem::ManuallyDrop::new -> ManuallyDrop::new

cc @the8472
2020-09-30 20:56:21 +02:00
Jonas Schievink
054ba3db2d
Rollup merge of #77338 - pickfire:patch-7, r=jyn514
Fix typo in alloc vec comment

cc @the8472
2020-09-30 20:56:19 +02:00
Jonas Schievink
4e5178301b
Rollup merge of #77331 - hameerabbasi:issue-74906, r=lcnr
Add test for async/await combined with const-generics.

Fixes #74906.
2020-09-30 20:56:17 +02:00
Jonas Schievink
c46f5784a6
Rollup merge of #77328 - hyd-dev:assert-to-rtassert, r=Amanieu
Use `rtassert!` instead of `assert!` from the child process after fork() in std::sys::unix::process::Command::spawn()

As discussed in #73894, `assert!` panics on failure, which is not signal-safe, and `rtassert!` is a suitable replacement.

Fixes #73894.

r? @Amanieu @cuviper @joshtriplett
2020-09-30 20:56:15 +02:00
Jonas Schievink
b85081d46a
Rollup merge of #77322 - rust-lang:wesleywiser-patch-1, r=steveklabnik
Add unstable book docs for `-Zunsound-mir-opts`

The `-Zunsound-mir-opts` flag was added in #76899.
2020-09-30 20:56:14 +02:00
Jonas Schievink
d4add198be
Rollup merge of #77296 - tmiasko:liveness-option, r=ecstatic-morse
liveness: Use Option::None to represent absent live nodes

No functional changes intended.
2020-09-30 20:56:12 +02:00
Jonas Schievink
87387fd23e
Rollup merge of #77284 - josephlr:mem, r=Mark-Simulacrum
library: Forward compiler-builtins "mem" feature

This fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/53

Now users will be able to do:
```
cargo build -Zbuild-std=core -Zbuild-std-features=compiler-builtins-mem
```
and correctly get the Rust implemenations for `memcpy` and friends.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-09-30 20:56:10 +02:00
Jonas Schievink
a4dc8dae02
Rollup merge of #77280 - petrochenkov:llvmcomp, r=Mark-Simulacrum
Ensure that all LLVM components requested by tests are available on CI

Addresses https://github.com/rust-lang/rust/pull/75064#issuecomment-667722652

I used an environment variable because passing a command line option all the way from CI to compiletest would be just too much hassle for this task.
I added a new variable, but any of the already existing ones defined by CI could be used instead.
r? @Mark-Simulacrum
2020-09-30 20:56:09 +02:00
Jonas Schievink
7ad03dd91d
Rollup merge of #77233 - ssomers:btree_size_matters, r=Mark-Simulacrum
BTreeMap: keep an eye out on the size of the main components

r? @Mark-Simulacrum
2020-09-30 20:56:07 +02:00
Jonas Schievink
248d6bf1e2
Rollup merge of #77037 - matthiaskrgr:cl42ppy, r=Dylan-DPC
more tiny clippy cleanups

commits stand alone and can be reviewed one by one
2020-09-30 20:56:05 +02:00
bors
d92d28e523 Auto merge of #77298 - jyn514:bootstrap-config, r=Mark-Simulacrum
Don't warn if the config file is somewhere other than `config.toml`

Previously, `config.config` was always hardcoded as `"config.toml"`.
I thought that it was being overridden with the actual value later, but
it turns out `flags.config` was being completely discarded. This keeps
`config.config` in sync with `flags.config`.

Fixes https://github.com/rust-lang/rust/issues/77293
r? `@Mark-Simulacrum`
cc `@davidtwco`
2020-09-30 15:03:09 +00:00
bors
939cc3e445 Auto merge of #77281 - tmiasko:liveness-everybody, r=oli-obk
Liveness analysis for everybody

Perform liveness analysis for every body instead of limiting it to fns.

Fixes #77169.
2020-09-30 12:44:31 +00:00
bors
511ed9f235 Auto merge of #77356 - RalfJung:miri, r=RalfJung
update miri

Fixes https://github.com/rust-lang/rust/issues/77310
r? `@ghost` Cc `@rust-lang/miri`
2020-09-30 10:08:28 +00:00
Ralf Jung
19d8eaf444 update miri 2020-09-30 10:49:15 +02:00
bors
12f667fac3 Auto merge of #77294 - shepmaster:try-anchors, r=pietroalbini
Use YAML anchors for try builds

r? `@pietroalbini`
2020-09-30 07:57:48 +00:00
bors
c0127e4dbf Auto merge of #77292 - lzutao:std_asm, r=Amanieu
Prefer asm! in std - all in sgx module

Similar to the change in #76669 but all `llvm_asm!` is gate in x86/x86_64 target.
Godbolt:
- https://rust.godbolt.org/z/h7nG1h
- https://rust.godbolt.org/z/xx39hW
2020-09-30 05:27:16 +00:00
bors
6ac6c67574 Auto merge of #77069 - sexxi-goose:closure_print_2, r=nikomatsakis
pretty.rs: Update Closure and Generator print

More detailed outline: https://github.com/rust-lang/project-rfc-2229/pull/17

Closes: https://github.com/rust-lang/project-rfc-2229/issues/11

r? `@nikomatsakis`
cc `@eddyb` `@davidtwco` `@estebank`
2020-09-30 03:10:47 +00:00
bors
0d9afb6717 Auto merge of #77133 - tmandry:bootstrap-host, r=Mark-Simulacrum
bootstrap: Always build for host, even when target is given

This changes the behavior from *not* building for host whenever an
explicit target is specified. I find this much less confusing.

You can still disable host steps by passing an explicit empty list for
host.

Fixes #76990.

r? `@Mark-Simulacrum`
2020-09-30 00:59:12 +00:00
Tomasz Miąsko
93e3db30e9 liveness: Use Option::None to represent absent live nodes
No functional changes intended.
2020-09-30 00:00:00 +00:00
Tyler Mandry
bf7aeaa617 Filter out empty items in bootstrap:🎏:split 2020-09-29 22:50:57 +00:00
bors
0d97f7a968 Auto merge of #77289 - TimDiekmann:alloc-ref-by-ref, r=Amanieu
Change `AllocRef::by_ref` to take `&self` instead of `&mut self`

r? `@Amanieu`
2020-09-29 22:13:37 +00:00
Tomasz Miąsko
924e8aaaf2 Liveness analysis for everybody
Perform liveness analysis for every body instead of limiting it to fns.
2020-09-29 23:45:31 +02:00
Tyler Mandry
63eaa60294 Use --host='' instead of --host ''
Trying to fix a problem in CI. Maybe some version of Docker is not
passing '' args correctly?
2020-09-29 20:13:52 +00:00
bors
381b445ff5 Auto merge of #77274 - tmiasko:liveness-cnd, r=lcnr
Liveness refactoring continued

* Move body_owner field from IrMaps to Liveness (the only user of the field).
* Use upvars instead of FnKind to check for closures (avoids FnKind, will be useful when checking all bodies, not just fns).
* Use visit_param to add variables corresponding to params.
* Store upvars_mentioned inside Liveness struct.
* Inline visitor implementation for IrMaps, avoiding unnecessary indirection.
* Test interaction with automatically_derived attribute (not covered by any of existing tests).

No functional changes intended.
2020-09-29 19:25:10 +00:00
bors
9b77a6a200 Auto merge of #77145 - pietroalbini:refactor-build-manifest-versions, r=Mark-Simulacrum
Refactor versions detection in build-manifest

This PR refactors how `build-manifest` handles versions, making the following changes:

* `build-manifest` now detects the "package releases" on its own, without relying on rustbuild providing them through CLI arguments. This drastically simplifies calling the tool outside of `x.py`, and will allow to ship the prebuilt tool in a tarball in the future, with the goal of stopping to invoke `x.py` during `promote-release`.
* The `tar` command is not used to extract the version and the git hash from tarballs anymore. The `flate2` and `tar` crates are used instead. This makes detecting those pieces of data way faster, as the archive is decompressed just once and we stop parsing the archive once all the information is retrieved.
* The code to extract the version and the git hash now stores all the collected data dynamically, without requiring to add new fields to the `Builder` struct every time.

I tested the changes locally and it should behave the same as before.

r? `@Mark-Simulacrum`
2020-09-29 16:41:53 +00:00
Ivan Tham
f9b625f8e0
Alloc vec use imported path
mem::ManuallyDrop::new -> ManuallyDrop::new
2020-09-29 23:00:02 +08:00
Ivan Tham
b141e49d87
Fix typo in alloc vec comment 2020-09-29 22:33:57 +08:00
bors
4d52dc4790 Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morse
Clean up diagnostics for arithmetic operation errors

Plus a small tweak to a range pattern error message.
2020-09-29 14:28:58 +00:00
bors
9e34b72964 Auto merge of #77253 - jyn514:crate-link, r=Manishearth
Resolve `crate` in intra-doc links properly across crates

Closes https://github.com/rust-lang/rust/issues/77193; see https://github.com/rust-lang/rust/issues/77193#issuecomment-699065946 for an explanation of what's going on here.
~~This also fixes the BTreeMap docs that have been broken for a while; see the description on the second commit for why and how.~~ Nope, see the second commit for why the link had to be changed.

r? `@Manishearth`
cc `@dylni`

`@dylni` note that this doesn't solve your original problem - now _both_ `with_code` and `crate::with_code` will be broken links. However this will fix a lot of other broken links (in particular I think https://docs.rs/sqlx/0.4.0-beta.1/sqlx/query/struct.Query.html is because of this bug). I'll open another issue for resolving additional docs in the new scope.
2020-09-29 12:11:17 +00:00
Hameer Abbasi
2c38504055 Add test for async/await combined with const-generics. 2020-09-29 13:19:51 +02:00
Vadim Petrochenkov
9340ee4380 Ensure that all LLVM components requested by tests are available on CI 2020-09-29 11:42:27 +03:00
hyd-dev
a2526b416f
Use rtassert! instead of assert! from the child process after fork() in std::sys::unix::process::Command::spawn()
`assert!` panics on failure, which is not signal-safe.
2020-09-29 15:16:46 +08:00
bors
26373fb4ba Auto merge of #77275 - petrochenkov:interpid, r=varkor
expand: Stop normalizing `NtIdent`s before passing them to built-in macros

Built-in macros should be able to deal with `NtIdents` in the input by themselves like any other parser code.

You can't imagine how bad mutable AST visitors are, *especially* if they are modifying tokens.
This is one step towards removing token visiting from the visitor infrastructure (https://github.com/rust-lang/rust/pull/77271 also works in this direction.)
2020-09-29 05:14:36 +00:00
Wesley Wiser
63bb51d3ac
Add unstable book docs for -Zunsound-mir-opts 2020-09-28 22:48:07 -04:00
bors
48cab67447 Auto merge of #77257 - ecstatic-morse:optimize-int-range-from-pat, r=Mark-Simulacrum
Optimize `IntRange::from_pat`, then shrink `ParamEnv`

Resolves #77058.

r? `@Mark-Simulacrum`
cc `@vandenheuvel`

Looking at the output of `perf report` for #76244, the hot instructions seemed to be around the call to `pat_constructor` in `IntRange::from_pat`. I carried out an obvious optimization, but it actually made the instruction count higher (see #77075). However, it seems to have mitigated whatever was causing the pipeline stalls, so when combined with #76244, it's a net win.

As you can see below, the regression in #76244 seems to have originated from something measured by `stalled-cycles-backend`. I'll try to collect some finer-grained stats to see if I can isolate it. I wish I had a better idea of what was going on here. I'd like to prevent the regression from reappearing in the future due to small changes in unrelated code.

<details>
<summary>Current `master`:</summary>

```
 Performance counter stats for 'cargo +baseline-stage1 check':

          2,275.67 msec task-clock:u              #    0.998 CPUs utilized
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            49,826      page-faults:u             #    0.022 M/sec
     5,117,221,678      cycles:u                  #    2.249 GHz
       299,655,943      stalled-cycles-frontend:u #    5.86% frontend cycles idle
     2,284,213,395      stalled-cycles-backend:u  #   44.64% backend cycles idle
     8,051,871,959      instructions:u            #    1.57  insn per cycle
                                                  #    0.28  stalled cycles per insn
     1,359,589,402      branches:u                #  597.447 M/sec
         7,359,347      branch-misses:u           #    0.54% of all branches

       2.281030026 seconds time elapsed

       2.108197000 seconds user
       0.164183000 seconds sys
```
</details>

<details>
<summary>Shrink `ParamEnv` without changing `IntRange::from_pat`:</summary>

```
 Performance counter stats for 'cargo +perf-stage1 check':

          2,751.79 msec task-clock:u              #    0.996 CPUs utilized
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            50,103      page-faults:u             #    0.018 M/sec
     6,260,590,019      cycles:u                  #    2.275 GHz
       317,355,920      stalled-cycles-frontend:u #    5.07% frontend cycles idle
     3,397,743,582      stalled-cycles-backend:u  #   54.27% backend cycles idle
     8,276,224,367      instructions:u            #    1.32  insn per cycle
                                                  #    0.41  stalled cycles per insn
     1,370,453,386      branches:u                #  498.023 M/sec
         7,281,031      branch-misses:u           #    0.53% of all branches

       2.763265838 seconds time elapsed

       2.544578000 seconds user
       0.204548000 seconds sys
```
</details>

<details>
<summary>Shrink `ParamEnv` and change `IntRange::from_pat`: </summary>

```
 Performance counter stats for 'cargo +perf-stage1 check':

          2,295.57 msec task-clock:u              #    0.996 CPUs utilized
                 0      context-switches:u        #    0.000 K/sec
                 0      cpu-migrations:u          #    0.000 K/sec
            49,959      page-faults:u             #    0.022 M/sec
     5,151,407,066      cycles:u                  #    2.244 GHz
       324,517,829      stalled-cycles-frontend:u #    6.30% frontend cycles idle
     2,301,671,001      stalled-cycles-backend:u  #   44.68% backend cycles idle
     8,130,868,329      instructions:u            #    1.58  insn per cycle
                                                  #    0.28  stalled cycles per insn
     1,356,618,512      branches:u                #  590.972 M/sec
         7,323,800      branch-misses:u           #    0.54% of all branches

       2.304509653 seconds time elapsed

       2.128090000 seconds user
       0.163909000 seconds sys
```
</details>
2020-09-29 02:29:13 +00:00
Tyler Mandry
6bd57e3531 Bump bootstrap version and update changelog 2020-09-28 20:15:43 +00:00
Tyler Mandry
ed975054aa Update CI scripts to accommodate --host change 2020-09-28 20:15:43 +00:00
Vadim Petrochenkov
4a4a7f8599 expand: Minor fn ptr call cleanup 2020-09-28 23:10:48 +03:00
Vadim Petrochenkov
85ef265dbe expand: Stop un-interpolating NtIdents before passing them to built-in macros
This was a big hack, and built-in macros should be able to deal with `NtIdents` in the input by themselves like any other parser code.
2020-09-28 23:10:44 +03:00
Tyler Mandry
52ca5ca7b7 Remove skip_only_host_steps
And make tests explicitly list their hosts and targets.
2020-09-28 19:32:46 +00:00
Tyler Mandry
e715c7f234 bootstrap: Always build for host, even when target is given
This changes the behavior from *not* building for host whenever an
explicit target is specified. I find this much less confusing.

You can still disable host steps by passing an explicit empty list for
host.

Fixes #76990.
2020-09-28 19:32:46 +00:00
varkor
c0b105780e Fix run-make-fulldeps tests 2020-09-28 19:44:53 +01:00
bors
fc2daaae61 Auto merge of #77302 - RalfJung:rollup-n8gg3v6, r=RalfJung
Rollup of 7 pull requests

Successful merges:

 - #76454 (UI to unit test for those using Cell/RefCell/UnsafeCell)
 - #76474 (Add option to pass a custom codegen backend from a driver)
 - #76711 (diag: improve closure/generic parameter mismatch)
 - #77170 (Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]`)
 - #77194 (Add doc alias for iterator fold)
 - #77288 (fix building libstd for Miri on macOS)
 - #77295 (Update unstable-book: Fix ABNF in inline assembly docs)

Failed merges:

r? `@ghost`
2020-09-28 18:02:45 +00:00
Ralf Jung
d9c11929a5
Rollup merge of #77295 - jethrogb:jb/unstable-book-asm, r=Amanieu
Update unstable-book: Fix ABNF in inline assembly docs

r? @Amanieu
2020-09-28 18:39:49 +02:00
Ralf Jung
a966f54bbb
Rollup merge of #77288 - RalfJung:miri-macos, r=Amanieu
fix building libstd for Miri on macOS

Fixes a Miri regression introduced by https://github.com/rust-lang/rust/pull/75295
Cc @tmiasko @Amanieu
2020-09-28 18:39:47 +02:00
Ralf Jung
aba966a592
Rollup merge of #77194 - pickfire:patch-7, r=withoutboats
Add doc alias for iterator fold

fold is known in python and javascript as reduce,
not sure about inject but it was written in doc there.

This was my first confusion when coming into rust, I somehow cannot find where is reduce, sometimes I still forget that it is known as `fold`.
2020-09-28 18:39:46 +02:00
Ralf Jung
85a59d40f1
Rollup merge of #77170 - ecstatic-morse:const-fn-ptr, r=oli-obk
Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]`

`rustc_allow_const_fn_ptr` was a hack to work around the lack of an escape hatch for the "min `const fn`" checks in const-stable functions. Now that we have co-opted `allow_internal_unstable` for this purpose, we no longer need a bespoke attribute.

Now this functionality is gated under `const_fn_fn_ptr_basics` (how concise!), and `#[allow_internal_unstable(const_fn_fn_ptr_basics)]` replaces `#[rustc_allow_const_fn_ptr]`. `const_fn_fn_ptr_basics` allows function pointer types to appear in the arguments and locals of a `const fn` as well as function pointer casts to be performed inside a `const fn`. Both of these were allowed in constants and statics already. Notably, this does **not** allow users to invoke function pointers in a const context. Presumably, we will use a nicer name for that (`const_fn_ptr`?).

r? @oli-obk
2020-09-28 18:39:44 +02:00
Ralf Jung
88ae20d8aa
Rollup merge of #76711 - davidtwco:issue-51154-param-closure, r=estebank
diag: improve closure/generic parameter mismatch

Fixes #51154.

This PR improves the diagnostic when a type parameter is expected and a closure is found, noting that each closure has a distinct type and therefore could not always match the caller-chosen type of the parameter.

r? @estebank
2020-09-28 18:39:42 +02:00
Ralf Jung
6a8cdbd285
Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk
Add option to pass a custom codegen backend from a driver

This allows the driver to pass information to the codegen backend. For example the headcrab debugger may in the future want to use cg_clif to JIT code to be injected in the debuggee. This would PR make it possible to tell cg_clif which symbol can be found at which address and to tell it to inject the JITed code into the right process.

This PR may also help with https://github.com/rust-lang/miri/pull/1540 by allowing miri to provide a codegen backend that only emits metadata and doesn't perform any codegen.

cc @nbaksalyar (headcrab)
cc @RalfJung (miri)
2020-09-28 18:39:40 +02:00
Ralf Jung
734c57d45c
Rollup merge of #76454 - poliorcetics:ui-to-unit-test-1, r=matklad
UI to unit test for those using Cell/RefCell/UnsafeCell

Helps with #76268.

I'm working on all files using `Cell` and moving them to unit tests when possible.

r? @matklad
2020-09-28 18:39:39 +02:00