]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoUpdate books
Eric Huss [Tue, 29 Sep 2020 22:36:08 +0000 (15:36 -0700)]
Update books

3 years agoAuto merge of #77274 - tmiasko:liveness-cnd, r=lcnr
bors [Tue, 29 Sep 2020 19:25:10 +0000 (19:25 +0000)]
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.

3 years agoAuto merge of #77145 - pietroalbini:refactor-build-manifest-versions, r=Mark-Simulacrum
bors [Tue, 29 Sep 2020 16:41:53 +0000 (16:41 +0000)]
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`

3 years agoAuto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morse
bors [Tue, 29 Sep 2020 14:28:58 +0000 (14:28 +0000)]
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.

3 years agoAuto merge of #77253 - jyn514:crate-link, r=Manishearth
bors [Tue, 29 Sep 2020 12:11:17 +0000 (12:11 +0000)]
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.

3 years agoAuto merge of #77275 - petrochenkov:interpid, r=varkor
bors [Tue, 29 Sep 2020 05:14:36 +0000 (05:14 +0000)]
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.)

3 years agoAuto merge of #77257 - ecstatic-morse:optimize-int-range-from-pat, r=Mark-Simulacrum
bors [Tue, 29 Sep 2020 02:29:13 +0000 (02:29 +0000)]
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>

3 years agoexpand: Minor fn ptr call cleanup
Vadim Petrochenkov [Mon, 28 Sep 2020 20:10:48 +0000 (23:10 +0300)]
expand: Minor fn ptr call cleanup

3 years agoexpand: Stop un-interpolating `NtIdent`s before passing them to built-in macros
Vadim Petrochenkov [Sun, 27 Sep 2020 16:47:52 +0000 (19:47 +0300)]
expand: Stop un-interpolating `NtIdent`s 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.

3 years agoFix run-make-fulldeps tests
varkor [Mon, 28 Sep 2020 18:44:53 +0000 (19:44 +0100)]
Fix run-make-fulldeps tests

3 years agoAuto merge of #77302 - RalfJung:rollup-n8gg3v6, r=RalfJung
bors [Mon, 28 Sep 2020 18:02:45 +0000 (18:02 +0000)]
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`

3 years agoRollup merge of #77295 - jethrogb:jb/unstable-book-asm, r=Amanieu
Ralf Jung [Mon, 28 Sep 2020 16:39:49 +0000 (18:39 +0200)]
Rollup merge of #77295 - jethrogb:jb/unstable-book-asm, r=Amanieu

Update unstable-book: Fix ABNF in inline assembly docs

r? @Amanieu

3 years agoRollup merge of #77288 - RalfJung:miri-macos, r=Amanieu
Ralf Jung [Mon, 28 Sep 2020 16:39:47 +0000 (18:39 +0200)]
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

3 years agoRollup merge of #77194 - pickfire:patch-7, r=withoutboats
Ralf Jung [Mon, 28 Sep 2020 16:39:46 +0000 (18:39 +0200)]
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`.

3 years agoRollup merge of #77170 - ecstatic-morse:const-fn-ptr, r=oli-obk
Ralf Jung [Mon, 28 Sep 2020 16:39:44 +0000 (18:39 +0200)]
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

3 years agoRollup merge of #76711 - davidtwco:issue-51154-param-closure, r=estebank
Ralf Jung [Mon, 28 Sep 2020 16:39:42 +0000 (18:39 +0200)]
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

3 years agoRollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk
Ralf Jung [Mon, 28 Sep 2020 16:39:40 +0000 (18:39 +0200)]
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)

3 years agoRollup merge of #76454 - poliorcetics:ui-to-unit-test-1, r=matklad
Ralf Jung [Mon, 28 Sep 2020 16:39:39 +0000 (18:39 +0200)]
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

3 years agoAuto merge of #76899 - wesleywiser:experimental_unsound_mir_opts_flag, r=oli-obk
bors [Mon, 28 Sep 2020 15:32:27 +0000 (15:32 +0000)]
Auto merge of #76899 - wesleywiser:experimental_unsound_mir_opts_flag, r=oli-obk

[mir-opt] Introduce a new flag to enable experimental/unsound mir opts

This implements part of https://github.com/rust-lang/compiler-team/issues/319. The exact name of this flag was not decided as part of that MCP and some people expressed that it should include "unsound" in some way.

I've chosen to use `enable-experimental-unsound-mir-opts` as the name. While long, I don't think that matters too much as really it will only be used by some mir-opt tests. If you object or have a better name, please leave a comment!

r? `@oli-obk`
cc `@rust-lang/wg-mir-opt` `@RalfJung`

3 years agoUpdate unstable-book: Fix ABNF in inline assembly docs
Jethro Beekman [Mon, 28 Sep 2020 13:57:21 +0000 (15:57 +0200)]
Update unstable-book: Fix ABNF in inline assembly docs

3 years agoAuto merge of #77236 - matthewjasper:defer-typeof-impl-trait, r=davidtwco
bors [Mon, 28 Sep 2020 12:47:23 +0000 (12:47 +0000)]
Auto merge of #77236 - matthewjasper:defer-typeof-impl-trait, r=davidtwco

Compute underlying type of impl trait types later in compilation

Also change a `bug!` to `delay_span_bug`
Closes #74018

3 years agoAuto merge of #77282 - glaubitz:sparc-linux, r=nagisa
bors [Mon, 28 Sep 2020 10:37:41 +0000 (10:37 +0000)]
Auto merge of #77282 - glaubitz:sparc-linux, r=nagisa

Add missing definitions required by the sparc-unknown-linux-gnu target

This PR adds a few missing definitions required by sparc-unknown-linux-target which were discovered during build tests.

3 years agoAuto merge of #77261 - oli-obk:const_generic_array_serializer, r=matthewjasper
bors [Mon, 28 Sep 2020 08:33:00 +0000 (08:33 +0000)]
Auto merge of #77261 - oli-obk:const_generic_array_serializer, r=matthewjasper

Deduplicate and generalize some (de/)serializer impls

I noticed this while implementing #77227 and getting a "not implemented for [T; 16]" error. There's likely more things we can deduplicate in this file, but I didn't need any additional changes.

3 years agofix building libstd for Miri on macOS
Ralf Jung [Mon, 28 Sep 2020 08:32:05 +0000 (10:32 +0200)]
fix building libstd for Miri on macOS

3 years agoAuto merge of #77265 - vandenheuvel:chalkup, r=Dylan-DPC
bors [Mon, 28 Sep 2020 06:20:02 +0000 (06:20 +0000)]
Auto merge of #77265 - vandenheuvel:chalkup, r=Dylan-DPC

Update chalk to 0.29.0

3 years agoAuto merge of #77008 - fortanix:raoul/lvi-tests, r=Mark-Simulacrum
bors [Mon, 28 Sep 2020 03:28:04 +0000 (03:28 +0000)]
Auto merge of #77008 - fortanix:raoul/lvi-tests, r=Mark-Simulacrum

LVI hardening tests

Mitigating the speculative execution LVI attack against SGX enclaves requires compiler changes (i.e., adding lfences). This pull requests adds various tests to check if this happens correctly.

3 years agoAuto merge of #75295 - tmiasko:fds, r=Amanieu
bors [Mon, 28 Sep 2020 00:58:40 +0000 (00:58 +0000)]
Auto merge of #75295 - tmiasko:fds, r=Amanieu

Reopen standard file descriptors when they are missing on Unix

The syscalls returning a new file descriptors generally return lowest-numbered
file descriptor not currently opened, without any exceptions for those
corresponding to stdin, sdout, or stderr.

Previously when any of standard file descriptors has been closed before starting
the application, operations on std::io::{stderr,stdin,stdout} were likely to
either succeed while being performed on unrelated file descriptor, or fail with
EBADF which is silently ignored.

Avoid the issue by using /dev/null as a replacement when the standard file
descriptors are missing.

The implementation is based on the one found in musl. It was selected among a
few others on the basis of the lowest overhead in the case when all descriptors
are already present (measured on GNU/Linux).

Closes #57728.
Closes #46981.
Closes #60447.

Benefits:
* Makes applications robust in the absence of standard file descriptors.
* Upholds IntoRawFd / FromRawFd safety contract (which was broken previously).

Drawbacks:
* Additional syscall during startup.
* The standard descriptors might have been closed intentionally.
* Requires /dev/null.

Alternatives:
* Check if stdin, stdout, stderr are opened and provide no-op substitutes in std::io::{stdin,stdout,stderr} without reopening them directly.
* Leave the status quo, expect robust applications to reopen them manually.

3 years agoRemove unnecessary -Zunsound-mir-opts uses in tests
Wesley Wiser [Sat, 19 Sep 2020 13:58:13 +0000 (09:58 -0400)]
Remove unnecessary -Zunsound-mir-opts uses in tests

3 years ago[mir-opt] Introduce a new flag to enable experimental/unsound mir opts
Wesley Wiser [Sat, 19 Sep 2020 00:14:27 +0000 (20:14 -0400)]
[mir-opt] Introduce a new flag to enable experimental/unsound mir opts

3 years agolibrary/std: Set OS raw type definitions for sparc-unknown-linux-gnu
John Paul Adrian Glaubitz [Sun, 27 Sep 2020 22:14:59 +0000 (00:14 +0200)]
library/std: Set OS raw type definitions for sparc-unknown-linux-gnu

3 years agolibrary/std/sys_common: Define MIN_ALIGN for sparc-unknown-linux-gnu
John Paul Adrian Glaubitz [Sun, 27 Sep 2020 22:08:42 +0000 (00:08 +0200)]
library/std/sys_common: Define MIN_ALIGN for sparc-unknown-linux-gnu

3 years agolibrary/{panic_,}unwind: Add definitions for sparc-unknow-linux-gnu
John Paul Adrian Glaubitz [Sun, 27 Sep 2020 22:05:40 +0000 (00:05 +0200)]
library/{panic_,}unwind: Add definitions for sparc-unknow-linux-gnu

3 years agoliveness: Test interaction with automatically_derived attribute
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
liveness: Test interaction with automatically_derived attribute

3 years agoliveness: Inline visitor implementation for IrMaps
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
liveness: Inline visitor implementation for IrMaps

3 years agoliveness: Store upvars_mentioned inside Liveness struct
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
liveness: Store upvars_mentioned inside Liveness struct

3 years agoliveness: Use visit_param to add variables corresponding to params
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
liveness: Use visit_param to add variables corresponding to params

3 years agoliveness: Use upvars instead of FnKind to check for closures
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
liveness: Use upvars instead of FnKind to check for closures

Avoiding FnKind will make it easier to run liveness analysis on all
bodies in the future, not just fn-like things.

3 years agoliveness: Move body_owner field from IrMaps to Liveness
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
liveness: Move body_owner field from IrMaps to Liveness

The Liveness struct is the only user of body_owner field.  Move the
field there.

3 years agoAuto merge of #77242 - ecstatic-morse:dataflow-switch-int, r=jonas-schievink
bors [Sun, 27 Sep 2020 21:54:49 +0000 (21:54 +0000)]
Auto merge of #77242 - ecstatic-morse:dataflow-switch-int, r=jonas-schievink

Replace `discriminant_switch_effect` with more general version

#68528 added a new edge-specific effect for `SwitchInt` terminators, `discriminant_switch_effect`, to the dataflow framework. While this accomplished the short-term goal of making drop elaboration more precise, it wasn't really useful in other contexts: It only supported `SwitchInt`s on the discriminant of an `enum` and did not allow effects to be applied along the "otherwise" branch. In const-propagation, for example, arbitrary edge-specific effects for the targets of a `SwitchInt` can be used to remember the value a `match` scrutinee must have in each arm.

This PR replaces `discriminant_switch_effect` with a more general `switch_int_edge_effects` method. The new method has a slightly different interface from the other edge-specific effect methods (e.g. `call_return_effect`). This divergence is explained in the new method's documentation, and reading the changes to the various dataflow impls as well as `direction.rs` should further clarify things. This PR should not change behavior.

3 years agoReopen standard streams when they are closed on Unix
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
Reopen standard streams when they are closed on Unix

The syscalls returning a new file descriptors generally use
lowest-numbered file descriptor not currently opened, without any
exceptions for those corresponding to the standard streams.

Previously when any of standard streams has been closed before starting
the application, operations on std::io::{stderr,stdin,stdout} objects
were likely to operate on other logically unrelated file resources
opened afterwards.

Avoid the issue by reopening the standard streams when they are closed.

3 years agoAuto merge of #77229 - tmiasko:liveness, r=lcnr
bors [Sun, 27 Sep 2020 19:38:01 +0000 (19:38 +0000)]
Auto merge of #77229 - tmiasko:liveness, r=lcnr

Small improvements in liveness pass

* Remove redundant debug logging (`add_variable` already contains logging).
* Remove redundant fields for a number of live nodes and variables.
* Delay conversion from a symbol to a string until linting.
* Inline contents of specials struct.
* Remove unnecessary local variable exit_ln.
* Use newtype_index for Variable and LiveNode.
* Access live nodes directly through self.lnks[ln].

No functional changes intended (except those related to the logging).

3 years agoRemove feature gate test for `rustc_allow_const_fn_ptr`
Dylan MacKenzie [Sun, 27 Sep 2020 18:51:40 +0000 (11:51 -0700)]
Remove feature gate test for `rustc_allow_const_fn_ptr`

3 years agoMark `min_const_fn_fn_ptr` test as gate test
Dylan MacKenzie [Thu, 24 Sep 2020 23:49:12 +0000 (16:49 -0700)]
Mark `min_const_fn_fn_ptr` test as gate test

3 years agoBless tests
Dylan MacKenzie [Thu, 24 Sep 2020 23:18:49 +0000 (16:18 -0700)]
Bless tests

3 years agoUpdate tests with new feature gate
Dylan MacKenzie [Thu, 24 Sep 2020 23:18:41 +0000 (16:18 -0700)]
Update tests with new feature gate

3 years agoRemove `rustc_allow_const_fn_ptr`
Dylan MacKenzie [Thu, 24 Sep 2020 23:15:41 +0000 (16:15 -0700)]
Remove `rustc_allow_const_fn_ptr`

This 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 the
bespoke attribute.

3 years agoAdd a feature gate for basic function pointer use in `const fn`
Dylan MacKenzie [Thu, 24 Sep 2020 23:17:03 +0000 (16:17 -0700)]
Add a feature gate for basic function pointer use in `const fn`

3 years agoAuto merge of #77272 - jonas-schievink:rollup-dydo5kn, r=jonas-schievink
bors [Sun, 27 Sep 2020 17:27:26 +0000 (17:27 +0000)]
Auto merge of #77272 - jonas-schievink:rollup-dydo5kn, r=jonas-schievink

Rollup of 7 pull requests

Successful merges:

 - #76839 (Add asm! support for MIPS)
 - #77203 (Check for missing const-stability attributes in `rustc_passes`)
 - #77249 (Separate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints)
 - #77252 (reduce overlong line)
 - #77256 (Fix typo in ExpnData documentation)
 - #77262 (Remove duplicate comment)
 - #77263 (Clean up trivial if let)

Failed merges:

r? `@ghost`

3 years agoRollup merge of #77263 - bugadani:cleanup, r=lcnr
Jonas Schievink [Sun, 27 Sep 2020 16:37:29 +0000 (18:37 +0200)]
Rollup merge of #77263 - bugadani:cleanup, r=lcnr

Clean up trivial if let

3 years agoRollup merge of #77262 - bugadani:redundant-comment, r=Dylan-DPC
Jonas Schievink [Sun, 27 Sep 2020 16:37:28 +0000 (18:37 +0200)]
Rollup merge of #77262 - bugadani:redundant-comment, r=Dylan-DPC

Remove duplicate comment

3 years agoRollup merge of #77256 - jyn514:typo, r=Aaron1011
Jonas Schievink [Sun, 27 Sep 2020 16:37:26 +0000 (18:37 +0200)]
Rollup merge of #77256 - jyn514:typo, r=Aaron1011

Fix typo in ExpnData documentation

This mis-highlighted the entire documentation as code: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/hygiene/struct.ExpnData.html#structfield.krate

3 years agoRollup merge of #77252 - tshepang:overlong, r=jyn514
Jonas Schievink [Sun, 27 Sep 2020 16:37:24 +0000 (18:37 +0200)]
Rollup merge of #77252 - tshepang:overlong, r=jyn514

reduce overlong line

3 years agoRollup merge of #77249 - jyn514:private-links, r=Manishearth
Jonas Schievink [Sun, 27 Sep 2020 16:37:23 +0000 (18:37 +0200)]
Rollup merge of #77249 - jyn514:private-links, r=Manishearth

Separate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints

This is not ideal because it means `deny(broken_intra_doc_links)` will
no longer `deny(private_intra_doc_links)`. However, it can't be fixed
with a new lint group, because `broken` is already in the `rustdoc` lint
group; there would need to be a way to nest groups somehow.

This also removes the early `return` so that the link will be generated
even though it gives a warning.

r? @Manishearth
cc @ecstatic-morse (https://github.com/rust-lang/rust/pull/77242#issuecomment-699565095)

3 years agoRollup merge of #77203 - ecstatic-morse:const-stability-attr-checks, r=oli-obk
Jonas Schievink [Sun, 27 Sep 2020 16:37:21 +0000 (18:37 +0200)]
Rollup merge of #77203 - ecstatic-morse:const-stability-attr-checks, r=oli-obk

Check for missing const-stability attributes in `rustc_passes`

Currently, this happens as a side effect of `is_min_const_fn`, which is non-obvious. Also adds a test for this case, since we didn't seem to have one before.

3 years agoRollup merge of #76839 - lzutao:mips-asm, r=Amanieu
Jonas Schievink [Sun, 27 Sep 2020 16:37:20 +0000 (18:37 +0200)]
Rollup merge of #76839 - lzutao:mips-asm, r=Amanieu

Add asm! support for MIPS

For now, I only add support for mips32.
mips64 may come in future PRs if I could learn more about the target.

3 years agoUse relative links instead of intra-doc links
Joshua Nelson [Sun, 27 Sep 2020 03:44:12 +0000 (23:44 -0400)]
Use relative links instead of intra-doc links

Previously, `BTreeMap` tried to link to `crate::collections`, intending
for the link to go to `std/collections/index.html`. But `BTreeMap` is
defined in `alloc`, so after the fix in the previous commit, the links
instead went to `alloc/collections/index.html`, which has almost no
information.

This changes it to link to `index.html`, which only works when viewing
from `std::collections::BTreeMap`, the most common place to visit the
docs. Fixing it to work from anywhere would require the docs for
`std::collections` to be duplicated in `alloc::collections`, which in
turn would require HashMap to be `alloc` for intra-doc links to work
(https://github.com/rust-lang/rust/issues/74481).

3 years agoAuto merge of #77259 - dgbo:master, r=kennytm
bors [Sun, 27 Sep 2020 15:14:55 +0000 (15:14 +0000)]
Auto merge of #77259 - dgbo:master, r=kennytm

update stdarch submodule

This commit update the src/stdarch submodule, we primarily want to include [https://github.com/rust-lang/stdarch/pull/918](url) which provides prefetch hints for aarch64. This PR could deliver ~20% performance gain on our aarch64 server in Filecoin. Wish this could be used as soon as possible.

Thanks.

3 years agoAdd documentation for `private_intra_doc_links`
Joshua Nelson [Sun, 27 Sep 2020 14:07:00 +0000 (10:07 -0400)]
Add documentation for `private_intra_doc_links`

3 years agoResolve `crate` properly across crates
Joshua Nelson [Sun, 27 Sep 2020 02:32:20 +0000 (22:32 -0400)]
Resolve `crate` properly across crates

3 years agoSeparate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints
Joshua Nelson [Sun, 27 Sep 2020 01:27:55 +0000 (21:27 -0400)]
Separate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints

This is not ideal because it means `deny(broken_intra_doc_links)` will
no longer `deny(private_intra_doc_links)`. However, it can't be fixed
with a new lint group, because `broken` is already in the `rustdoc` lint
group; there would need to be a way to nest groups somehow.

This also removes the early `return` so that the link will be generated
even though it gives a warning.

3 years agoUpdate chalk to 0.29.0
Bram van den Heuvel [Sun, 27 Sep 2020 13:54:07 +0000 (15:54 +0200)]
Update chalk to 0.29.0

3 years agoAuto merge of #77118 - exrook:stability-generic-parameters-2, r=varkor
bors [Sun, 27 Sep 2020 12:51:21 +0000 (12:51 +0000)]
Auto merge of #77118 - exrook:stability-generic-parameters-2, r=varkor

 Stability annotations on generic parameters (take 2.5)

Rebase of #72314 + more tests

Implements rust-lang/wg-allocators#2.

3 years agoAdd option to pass a custom codegen backend from a driver
bjorn3 [Tue, 8 Sep 2020 11:44:41 +0000 (13:44 +0200)]
Add option to pass a custom codegen backend from a driver

3 years agoAuto merge of #71274 - RalfJung:raw-init-check-aggregate, r=petrochenkov
bors [Sun, 27 Sep 2020 10:17:09 +0000 (10:17 +0000)]
Auto merge of #71274 - RalfJung:raw-init-check-aggregate, r=petrochenkov

might_permit_raw_init: also check aggregate fields

This is the next step for https://github.com/rust-lang/rust/issues/66151: when doing `mem::zeroed`/`mem::uninitialized`, also recursively check fields of aggregates (except for arrays) for whether they permit zero/uninit initialization.

3 years agoClean up trivial if let
Dániel Buga [Sun, 27 Sep 2020 09:54:50 +0000 (11:54 +0200)]
Clean up trivial if let

3 years agoRemove duplicate comment
Dániel Buga [Sun, 27 Sep 2020 09:00:46 +0000 (11:00 +0200)]
Remove duplicate comment

3 years agoupdate tokei and ripgrep in cargotest
Ralf Jung [Sun, 27 Sep 2020 08:58:42 +0000 (10:58 +0200)]
update tokei and ripgrep in cargotest

3 years agoAuto merge of #76955 - jyn514:refactor-diagnostics, r=euclio
bors [Sun, 27 Sep 2020 08:12:29 +0000 (08:12 +0000)]
Auto merge of #76955 - jyn514:refactor-diagnostics, r=euclio

Refactor and fix intra-doc link diagnostics, and fix links to primitives

Closes https://github.com/rust-lang/rust/issues/76925, closes https://github.com/rust-lang/rust/issues/76693, closes https://github.com/rust-lang/rust/issues/76692.

Originally I only meant to fix #76925. But the hack with `has_primitive` was so bad it was easier to fix the primitive issues than to try and work around it.

Note that this still has one bug: `std::primitive::i32::MAX` does not resolve. However, this fixes the ICE so I'm fine with fixing the link in a later PR.

This is part of a series of refactors to make #76467 possible.

This is best reviewed commit-by-commit; it has detailed commit messages.

r? `@euclio`

3 years agofix redundant delarations of const_fn_transmute
Dong Bo [Sun, 27 Sep 2020 07:13:32 +0000 (15:13 +0800)]
fix redundant delarations of const_fn_transmute

3 years agoupdate stdarch submodule
Dong Bo [Sun, 27 Sep 2020 05:41:08 +0000 (13:41 +0800)]
update stdarch submodule

3 years agoAuto merge of #77154 - fusion-engineering-forks:lazy-stdio, r=dtolnay
bors [Sun, 27 Sep 2020 04:50:46 +0000 (04:50 +0000)]
Auto merge of #77154 - fusion-engineering-forks:lazy-stdio, r=dtolnay

Remove std::io::lazy::Lazy in favour of SyncOnceCell

The (internal) std::io::lazy::Lazy was used to lazily initialize the stdout and stdin buffers (and mutexes). It uses atexit() to register a destructor to flush the streams on exit, and mark the streams as 'closed'. Using the stream afterwards would result in a panic.

Stdout uses a LineWriter which contains a BufWriter that will flush the buffer on drop. This one is important to be executed during shutdown, to make sure no buffered output is lost. It also forbids access to stdout afterwards, since the buffer is already flushed and gone.

Stdin uses a BufReader, which does not implement Drop. It simply forgets any previously read data that was not read from the buffer yet. This means that in the case of stdin, the atexit() function's only effect is making stdin inaccessible to the program, such that later accesses result in a panic. This is uncessary, as it'd have been safe to access stdin during shutdown of the program.

---

This change removes the entire io::lazy module in favour of SyncOnceCell. SyncOnceCell's fast path is much faster (a single atomic operation) than locking a sys_common::Mutex on every access like Lazy did.

However, SyncOnceCell does not use atexit() to drop the contained object during shutdown.

As noted above, this is not a problem for stdin. It simply means stdin is now usable during shutdown.

The atexit() call for stdout is moved to the stdio module. Unlike the now-removed Lazy struct, SyncOnceCell does not have a 'gone and unusable' state that panics. Instead of adding this again, this simply replaces the buffer with one with zero capacity. This effectively flushes the old buffer *and* makes any writes afterwards pass through directly without touching a buffer, making print!() available during shutdown without panicking.

---

In addition, because the contents of the SyncOnceCell are no longer dropped, we can now use `&'static` instead of `Arc` in `Stdout` and `Stdin`. This also saves two levels of indirection in `stdin()` and `stdout()`, since Lazy effectively stored a `Box<Arc<T>>`, and SyncOnceCell stores the `T` directly.

3 years agoFix typo in ExpnData documentation
Joshua Nelson [Sun, 27 Sep 2020 04:09:45 +0000 (00:09 -0400)]
Fix typo in ExpnData documentation

This mis-highlighted the entire documentation as code.

3 years agoRevert "Add an unused field of type `Option<DefId>` to `ParamEnv` struct."
Dylan MacKenzie [Wed, 23 Sep 2020 01:30:53 +0000 (18:30 -0700)]
Revert "Add an unused field of type `Option<DefId>` to `ParamEnv` struct."

This reverts commit ab83d372ed5b1799d418afe83c468e4c5973cc34.

3 years agoSpeed up `IntRange::from_pat`
Dylan MacKenzie [Tue, 22 Sep 2020 19:41:30 +0000 (12:41 -0700)]
Speed up `IntRange::from_pat`

Previously, this method called the more general `pat_constructor`
function, which can return other pattern variants besides `IntRange`.
Then it throws away any non-`IntRange` variants. Specialize it so work
is only done when it could result in an `IntRange`.

3 years agoAdd MIPS asm! support
Lzu Tao [Wed, 16 Sep 2020 15:35:58 +0000 (15:35 +0000)]
Add MIPS asm! support

This patch also:
* Add soft-float supports: only f32
* zero-extend i8/i16 to i32 because MIPS only supports register-length
  arithmetic.
* Update table in asm! chapter in unstable book.

3 years agoAuto merge of #76986 - jonas-schievink:ret-in-reg, r=nagisa
bors [Sun, 27 Sep 2020 02:35:11 +0000 (02:35 +0000)]
Auto merge of #76986 - jonas-schievink:ret-in-reg, r=nagisa

Return values up to 128 bits in registers

This fixes https://github.com/rust-lang/rust/issues/26494#issuecomment-619506345 by making Rust's default ABI pass return values up to 128 bits in size in registers, just like the System V ABI.

The result is that these methods from the comment linked above now generate the same code, making the Rust ABI as efficient as the `"C"` ABI:

```rust
pub struct Stats { x: u32, y: u32, z: u32, }

pub extern "C" fn sum_c(a: &Stats, b: &Stats) -> Stats {
    return Stats {x: a.x + b.x, y: a.y + b.y, z: a.z + b.z };
}

pub fn sum_rust(a: &Stats, b: &Stats) -> Stats {
    return Stats {x: a.x + b.x, y: a.y + b.y, z: a.z + b.z };
}
```

```asm
sum_rust:
movl (%rsi), %eax
addl (%rdi), %eax
movl 4(%rsi), %ecx
addl 4(%rdi), %ecx
movl 8(%rsi), %edx
addl 8(%rdi), %edx
shlq $32, %rcx
orq %rcx, %rax
retq
```

3 years agoreduce overlong line
Tshepang Lekhonkhobe [Sun, 27 Sep 2020 02:22:55 +0000 (04:22 +0200)]
reduce overlong line

3 years agoRemove intra-doc link
Dylan MacKenzie [Sun, 27 Sep 2020 00:29:55 +0000 (17:29 -0700)]
Remove intra-doc link

3 years agoAuto merge of #77247 - jonas-schievink:rollup-r6ehh8h, r=jonas-schievink
bors [Sun, 27 Sep 2020 00:16:45 +0000 (00:16 +0000)]
Auto merge of #77247 - jonas-schievink:rollup-r6ehh8h, r=jonas-schievink

Rollup of 10 pull requests

Successful merges:

 - #76917 (Add missing code examples on HashMap types)
 - #77107 (Enable const propagation into operands at mir_opt_level=2)
 - #77129 (Update cargo)
 - #77167 (Fix FIXME in core::num test: Check sign of zero in min/max tests.)
 - #77184 (Rust vec bench import specific rand::RngCore)
 - #77208 (Late link args order)
 - #77209 (Fix documentation highlighting in ty::BorrowKind)
 - #77231 (Move helper function for `missing_const_for_fn` out of rustc to clippy)
 - #77235 (pretty-print-reparse hack: Rename some variables for clarity)
 - #77243 (Test more attributes in test issue-75930-derive-cfg.rs)

Failed merges:

r? `@ghost`

3 years agoliveness: Access live nodes directly through self.lnks[ln]
Tomasz Miąsko [Sun, 27 Sep 2020 00:00:00 +0000 (00:00 +0000)]
liveness: Access live nodes directly through self.lnks[ln]

3 years agoRollup merge of #77243 - Aaron1011:more-derive-test, r=petrochenkov
Jonas Schievink [Sat, 26 Sep 2020 23:53:33 +0000 (01:53 +0200)]
Rollup merge of #77243 - Aaron1011:more-derive-test, r=petrochenkov

Test more attributes in test issue-75930-derive-cfg.rs

Split out from #76130

This tests our handling of combining derives, derive helper
attributes, attribute macros, and `cfg`/`cfg_attr`

3 years agoRollup merge of #77235 - petrochenkov:reparse, r=Aaron1011
Jonas Schievink [Sat, 26 Sep 2020 23:53:29 +0000 (01:53 +0200)]
Rollup merge of #77235 - petrochenkov:reparse, r=Aaron1011

pretty-print-reparse hack: Rename some variables for clarity

This will also make it easier to make the comparisons asymmetric.

Also one impossible case is removed.

r? @Aaron1011

3 years agoRollup merge of #77231 - oli-obk:clippy_const_fn, r=Manishearth
Jonas Schievink [Sat, 26 Sep 2020 23:53:27 +0000 (01:53 +0200)]
Rollup merge of #77231 - oli-obk:clippy_const_fn, r=Manishearth

Move helper function for `missing_const_for_fn` out of rustc to clippy

cc @rust-lang/clippy @ecstatic-morse #76618

r? @Manishearth

I also removed all support for suggesting a function could be `const fn` when that would require feature gates to actually work.

This means we'll now have to maintain this ourselves in clippy, but that's how most lints work anyway, so...

3 years agoRollup merge of #77209 - jyn514:fix-docs, r=petrochenkov
Jonas Schievink [Sat, 26 Sep 2020 23:53:25 +0000 (01:53 +0200)]
Rollup merge of #77209 - jyn514:fix-docs, r=petrochenkov

Fix documentation highlighting in ty::BorrowKind

Previously it looked a little odd: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.BorrowKind.html#variant.UniqueImmBorrow

Noticed this while reviewing https://github.com/rust-lang/rustc-dev-guide/pull/894.

3 years agoRollup merge of #77208 - mati865:late-link-args-order, r=petrochenkov
Jonas Schievink [Sat, 26 Sep 2020 23:53:23 +0000 (01:53 +0200)]
Rollup merge of #77208 - mati865:late-link-args-order, r=petrochenkov

Late link args order

MSYS2 changed how winpthreads is built and as the result it now depends on more mingw-w64 libraries.

This PR affects only MinGW targets since nobody else is using `late_link_args_{dynamic,static}`. Now the order is similar to how it used to be before https://github.com/rust-lang/rust/pull/67502.

3 years agoRollup merge of #77184 - pickfire:patch-4, r=kennytm
Jonas Schievink [Sat, 26 Sep 2020 23:53:22 +0000 (01:53 +0200)]
Rollup merge of #77184 - pickfire:patch-4, r=kennytm

Rust vec bench import specific rand::RngCore

Using `RngCore` import for side effects is clearer than `*` which may bring it unnecessary more stuff than needed, it is also more explicit doing so.

@pickfire change `LEN = 16384` (and pos) and `once` instead of `[0].iter()` after this.

@rustbot modify labels: +C-cleanup +A-testsuite

3 years agoRollup merge of #77167 - fusion-engineering-forks:fix-fixme-min-max-sign-test, r...
Jonas Schievink [Sat, 26 Sep 2020 23:53:20 +0000 (01:53 +0200)]
Rollup merge of #77167 - fusion-engineering-forks:fix-fixme-min-max-sign-test, r=nagisa

Fix FIXME in core::num test: Check sign of zero in min/max tests.

r? nagisa

@rustbot modify labels: +C-cleanup

3 years agoRollup merge of #77129 - ehuss:update-cargo, r=ehuss
Jonas Schievink [Sat, 26 Sep 2020 23:53:18 +0000 (01:53 +0200)]
Rollup merge of #77129 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in 8777a6b1e8834899f51b7e09cc9b8d85b2417110..05c611ae3c4255b7a2bcf4fcfa65b20286a07839
2020-09-15 19:11:03 +0000 to 2020-09-23 23:10:38 +0000
- --workspace flag for locate-project to find the workspace root (rust-lang/cargo#8712)
- Remove some badges documentation. (rust-lang/cargo#8727)
- Add plain message format for locate-project (rust-lang/cargo#8707)
- Add a term option to configure the progress bar (rust-lang/cargo#8165)
- Replace d_as_f64 with as_secs_f64 (rust-lang/cargo#8721)
- Add cross check to filters_target test. (rust-lang/cargo#8713)
- Add test for whitespace behavior in env flags. (rust-lang/cargo#8706)

3 years agoRollup merge of #77107 - bugadani:perf, r=oli-obk
Jonas Schievink [Sat, 26 Sep 2020 23:53:16 +0000 (01:53 +0200)]
Rollup merge of #77107 - bugadani:perf, r=oli-obk

Enable const propagation into operands at mir_opt_level=2

Feature was added in #74507 but gated with `mir_opt_level>=3` because of compile time regressions. Let's see whether the LLVM 11 update solves that.

As the [perf results](https://github.com/rust-lang/rust/pull/77107#issuecomment-697668154) show, enabling this optimization results in a lot less regression as before.

cc @oli-obk

r? @ghost

3 years agoRollup merge of #76917 - GuillaumeGomez:map-missing-code-examples, r=Dylan-DPC
Jonas Schievink [Sat, 26 Sep 2020 23:53:13 +0000 (01:53 +0200)]
Rollup merge of #76917 - GuillaumeGomez:map-missing-code-examples, r=Dylan-DPC

Add missing code examples on HashMap types

r? @Dylan-DPC

3 years agoUpdate dataflow impls to reflect new interface
Dylan MacKenzie [Sat, 26 Sep 2020 20:13:37 +0000 (13:13 -0700)]
Update dataflow impls to reflect new interface

3 years agoUpdate engine to use new interface
Dylan MacKenzie [Sat, 26 Sep 2020 20:12:51 +0000 (13:12 -0700)]
Update engine to use new interface

3 years agoReplace `discriminant_switch_effect` with more general version
Dylan MacKenzie [Sat, 26 Sep 2020 19:34:37 +0000 (12:34 -0700)]
Replace `discriminant_switch_effect` with more general version

...that allows arbitrary effects on each edge of a `SwitchInt`
terminator.

3 years agoTest more attributes in test issue-75930-derive-cfg.rs
Aaron Hill [Sat, 26 Sep 2020 21:29:37 +0000 (17:29 -0400)]
Test more attributes in test issue-75930-derive-cfg.rs

Split out from #76130

This tests our handling of combining derives, derive helper
attributes, attribute macros, and `cfg`/`cfg_attr`

3 years agoAuto merge of #76897 - Aaron1011:feature/min-proc-macro-metadata, r=petrochenkov
bors [Sat, 26 Sep 2020 20:57:31 +0000 (20:57 +0000)]
Auto merge of #76897 - Aaron1011:feature/min-proc-macro-metadata, r=petrochenkov

Encode less metadata for proc-macro crates

Currently, we serialize the same crate metadata for proc-macro crates as
we do for normal crates. This is quite wasteful - almost none of this
metadata is ever used, and much of it can't even be deserialized (if it
contains a foreign `CrateNum`).

This PR changes metadata encoding to skip encoding the majority of crate
metadata for proc-macro crates. Most of the `Lazy<[T]>` fields are left
completetly empty, while the non-lazy fields are left as-is.

Additionally, proc-macros now have a def span that does not include
their body. This was done for normal functions in #75465, but was missed
for proc-macros.

As a result of this PR, we should only ever encode local `CrateNum`s
when encoding proc-macro crates. I've added a specialized serialization
impl for `CrateNum` to assert this.

3 years agoFix UI test fallout
varkor [Sat, 26 Sep 2020 19:14:16 +0000 (20:14 +0100)]
Fix UI test fallout

3 years agoAuto merge of #77224 - RalfJung:rollup-hdvb96c, r=RalfJung
bors [Sat, 26 Sep 2020 17:50:26 +0000 (17:50 +0000)]
Auto merge of #77224 - RalfJung:rollup-hdvb96c, r=RalfJung

Rollup of 12 pull requests

Successful merges:

 - #75454 (Explicitly document the size guarantees that Option makes.)
 - #76631 (Add `x.py setup`)
 - #77076 (Add missing code examples on slice iter types)
 - #77093 (merge `need_type_info_err(_const)`)
 - #77122 (Add `#![feature(const_fn_floating_point_arithmetic)]`)
 - #77127 (Update mdBook)
 - #77161 (Remove TrustedLen requirement from BuilderMethods::switch)
 - #77166 (update Miri)
 - #77181 (Add doc alias for pointer primitive)
 - #77204 (Remove stray word from `ClosureKind::extends` docs)
 - #77207 (Rename `whence` to `span`)
 - #77211 (Remove unused #[allow(...)] statements from compiler/)

Failed merges:

 - #77170 (Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]`)

r? `@ghost`

3 years agopretty-print-reparse hack: Remove an impossible case
Vadim Petrochenkov [Sat, 26 Sep 2020 17:27:14 +0000 (20:27 +0300)]
pretty-print-reparse hack: Remove an impossible case

Delimiters cannot appear as isolated tokens in a token stream

3 years agopretty-print-reparse hack: Rename some variables for clarity
Vadim Petrochenkov [Sat, 26 Sep 2020 15:46:19 +0000 (18:46 +0300)]
pretty-print-reparse hack: Rename some variables for clarity

3 years agoCall `type_of` for opaque types later in compilation
Matthew Jasper [Sat, 26 Sep 2020 16:56:03 +0000 (17:56 +0100)]
Call `type_of` for opaque types later in compilation

This ensures that various wf checks have already been done before we
typeck item bodies.