]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #83806 - JohnTitor:issue-51446, r=estebank
bors [Sun, 11 Apr 2021 05:23:11 +0000 (05:23 +0000)]
Auto merge of #83806 - JohnTitor:issue-51446, r=estebank

Add a regression test for issue-51446

Closes #51446
r? `@estebank`

3 years agoAuto merge of #84071 - nagisa:nixos-patching-fix, r=Mark-Simulacrum
bors [Sun, 11 Apr 2021 02:59:30 +0000 (02:59 +0000)]
Auto merge of #84071 - nagisa:nixos-patching-fix, r=Mark-Simulacrum

Fix NixOS patching

Moving the `.nix-deps` has resulted in rpath links being broken and
therefore bootstrap on NixOS broken entirely.

This PR still produces a `.nix-deps` but only for the purposes of
producing a gc root. We rpath a symlink-resolved result instead.

For purposes of simplicity we also use joinSymlink to produce a single
merged output directory so that we don't need to update multiple
locations every time we add a library or something.

Fixes a regression from https://github.com/rust-lang/rust/pull/82739.

3 years agoAuto merge of #84053 - RalfJung:liballoc-miri, r=Manishearth
bors [Sun, 11 Apr 2021 00:27:23 +0000 (00:27 +0000)]
Auto merge of #84053 - RalfJung:liballoc-miri, r=Manishearth

fix incorrect Box::from_raw_in doctest

Now that Miri can run doctests, I ran it on liballoc, and found exactly one problem: this test creates a `Box<u8>` to deallocate a 4-byte allocation!

Introduced by https://github.com/rust-lang/rust/pull/80310 so r? `@Manishearth` `@kennytm`

3 years agoAuto merge of #84023 - Aaron1011:derive-invoc-order, r=petrochenkov
bors [Sat, 10 Apr 2021 22:04:37 +0000 (22:04 +0000)]
Auto merge of #84023 - Aaron1011:derive-invoc-order, r=petrochenkov

Expand derive invocations in left-to-right order

While derives were being collected in left-to-order order, the
corresponding `Invocation`s were being pushed in the wrong order.

3 years agoExpand derive invocations in left-to-right order
Aaron Hill [Fri, 9 Apr 2021 01:35:24 +0000 (21:35 -0400)]
Expand derive invocations in left-to-right order

While derives were being collected in left-to-order order, the
corresponding `Invocation`s were being pushed in the wrong order.

3 years agoFix NixOS patching
Simonas Kazlauskas [Sat, 10 Apr 2021 20:05:28 +0000 (23:05 +0300)]
Fix NixOS patching

Moving the `.nix-deps` has resulted in rpath links being broken and
therefore bootstrap on NixOS broken entirely.

This PR still produces a `.nix-deps` but only for the purposes of
producing a gc root. We rpath a symlink-resolved result instead.

For purposes of simplicity we also use joinSymlink to produce a single
merged output directory so that we don't need to update multiple
locations every time we add a library or something.

3 years agoAuto merge of #84016 - Aaron1011:new-preexp-tests, r=petrochenkov
bors [Sat, 10 Apr 2021 19:20:16 +0000 (19:20 +0000)]
Auto merge of #84016 - Aaron1011:new-preexp-tests, r=petrochenkov

Add some proc-macro attribute token handling tests

Split out from https://github.com/rust-lang/rust/pull/82608

r? `@petrochenkov`

3 years agoAdd some proc-macro attribute token handling tests
Aaron Hill [Thu, 8 Apr 2021 21:01:15 +0000 (17:01 -0400)]
Add some proc-macro attribute token handling tests

3 years agoAuto merge of #84052 - RalfJung:libcore-miri, r=Mark-Simulacrum
bors [Sat, 10 Apr 2021 16:23:35 +0000 (16:23 +0000)]
Auto merge of #84052 - RalfJung:libcore-miri, r=Mark-Simulacrum

fix Miri errors in libcore doctests

Now that Miri can run doctests, it found some issues in the libcore doctests:
* The `AtomicPtr` tests accessed dangling memory! `AtomicPtr::new(&mut 10);` makes the `10` a temporary that is deallocated after the end of this expression.
* The tests for `set_ptr_value` used `&array[0] as *const _` to get a pointer to the array; this needs to be `array.as_ptr()` instead (Cc https://github.com/rust-lang/unsafe-code-guidelines/issues/134).
* I reduced a buffer size in a `MaybeUninit` test to make it less slow in Miri, and added a spin loop hint to fix a diverging loop in Miri.

3 years agoAuto merge of #84055 - kornelski:z-edition, r=petrochenkov
bors [Sat, 10 Apr 2021 14:00:22 +0000 (14:00 +0000)]
Auto merge of #84055 - kornelski:z-edition, r=petrochenkov

Don't tell users to use a nightly flag on the stable channel

When a crate requires a newer edition, currently rustc tells users to use `-Z unstable-options`. This is not ideal, because:

* This flag doesn't work on the stable channel, so solution to one error only causes another error, which is frustrating.

* Directs users towards the nightly channel, which is not necessarily the correct solution. Once the next edition is released, this message will be mostly seen by users of out-of-date stable Rust versions who merely need to update their Rust to the latest stable.

3 years agoDon't tell users to use a nightly flag on the stable channel
Kornel [Sat, 10 Apr 2021 10:46:36 +0000 (11:46 +0100)]
Don't tell users to use a nightly flag on the stable channel

Hint upgrading to a newer Rust version instead

3 years agoAuto merge of #84051 - Amanieu:update_llvm, r=nikic
bors [Sat, 10 Apr 2021 11:17:00 +0000 (11:17 +0000)]
Auto merge of #84051 - Amanieu:update_llvm, r=nikic

Update LLVM submodule

Fixes #84028

3 years agofix incorrect from_raw_in doctest
Ralf Jung [Sat, 10 Apr 2021 10:24:08 +0000 (12:24 +0200)]
fix incorrect from_raw_in doctest

3 years agofix Miri errors in libcore doctests
Ralf Jung [Sat, 10 Apr 2021 09:58:48 +0000 (11:58 +0200)]
fix Miri errors in libcore doctests

3 years agoUpdate LLVM submodule
Amanieu d'Antras [Sat, 10 Apr 2021 09:51:54 +0000 (10:51 +0100)]
Update LLVM submodule

3 years agoAuto merge of #84050 - RalfJung:miri, r=RalfJung
bors [Sat, 10 Apr 2021 09:05:36 +0000 (09:05 +0000)]
Auto merge of #84050 - RalfJung:miri, r=RalfJung

update Miri

Let's ship https://github.com/rust-lang/miri/pull/1761.
Cc `@rust-lang/miri` r? `@ghost`

3 years agoupdate Miri
Ralf Jung [Sat, 10 Apr 2021 09:03:34 +0000 (11:03 +0200)]
update Miri

3 years agoAuto merge of #84024 - estebank:unclosed-brace-use, r=jackh726
bors [Sat, 10 Apr 2021 03:02:46 +0000 (03:02 +0000)]
Auto merge of #84024 - estebank:unclosed-brace-use, r=jackh726

Avoid `;` -> `,` recovery and unclosed `}` recovery from being too verbose

Those two recovery attempts have a very bad interaction that causes too
unnecessary output. Add a simple gate to avoid interpreting a `;` as a
`,` when there are unclosed braces.

Fix #83498.

3 years agoAuto merge of #84015 - tdelabro:issue-76704-fix, r=Amanieu
bors [Sat, 10 Apr 2021 00:35:38 +0000 (00:35 +0000)]
Auto merge of #84015 - tdelabro:issue-76704-fix, r=Amanieu

doc asm feature - Added new 'Label' section with example and explanations

Fixes #76704

3 years agoAuto merge of #84004 - mattico:print-target-features-improvements, r=petrochenkov
bors [Fri, 9 Apr 2021 21:14:50 +0000 (21:14 +0000)]
Auto merge of #84004 - mattico:print-target-features-improvements, r=petrochenkov

Categorize and explain target features support

There are 3 different uses of the `-C target-feature` args passed to rustc:
1. All of the features are passed to LLVM, which uses them to configure code-generation. This is sort-of stabilized since 1.0 though LLVM does change/add/remove target features regularly.
2. Target features which are in [the compiler's allowlist](https://github.com/rust-lang/rust/blob/69e1d22ddbc67b25141a735a22a8895a678b32ca/compiler/rustc_codegen_ssa/src/target_features.rs#L12-L34) can be used in `cfg!(target_feature)` etc. These may have different names than in LLVM and are renamed before passing them to LLVM.
3. Target features which are in the allowlist and which are stabilized or feature-gate-enabled can be used in `#[target_feature]`.

It can be confusing that `rustc --print target-features` just prints out the LLVM features without separating out the rustc features or even mentioning that the dichotomy exists.

This improves the situation by separating out the rustc and LLVM target features and adding a brief explanation about the difference.

Abbreviated Example Output:
```
$ rustc --print target-features
Features supported by rustc for this target:
    adx                         - Support ADX instructions.
    aes                         - Enable AES instructions.
...
    xsaves                      - Support xsaves instructions.
    crt-static                  - Enables libraries with C Run-time Libraries(CRT) to be statically linked.

Code-generation features supported by LLVM for this target:
    16bit-mode                  - 16-bit mode (i8086).
    32bit-mode                  - 32-bit mode (80386).
...
    x87                         - Enable X87 float instructions.
    xop                         - Enable XOP instructions.

Use +feature to enable a feature, or -feature to disable it.
For example, rustc -C target-cpu=mycpu -C target-feature=+feature1,-feature2

Code-generation features cannot be used in cfg or #[target_feature],
and may be renamed or removed in a future version of LLVM or rustc.

```

Motivated by #83975.
CC https://github.com/rust-lang/rust/issues/49653

3 years agoAuto merge of #84034 - jyn514:regex-in-loop, r=Mark-Simulacrum
bors [Fri, 9 Apr 2021 18:47:52 +0000 (18:47 +0000)]
Auto merge of #84034 - jyn514:regex-in-loop, r=Mark-Simulacrum

Fix perf regression in rustdoc::bare_urls

This regressed in #81764. After that PR, rustdoc compiled the regex for every single item in the crate: https://perf.rust-lang.org/compare.html?start=125505306744a0a5bb01d62337260a95d9ff8d57&end=2e495d2e845cf27740e3665f718acfd3aa17253e&stat=instructions%3Au

This would have been caught by `clippy::declare_interior_mutable_const` (cc https://github.com/rust-lang/rust/issues/77983).

3 years agoAvoid `;` -> `,` recovery and unclosed `}` recovery from being too verbose
Esteban Küber [Fri, 9 Apr 2021 02:12:00 +0000 (19:12 -0700)]
Avoid `;` -> `,` recovery and unclosed `}` recovery from being too verbose

Those two recovery attempts have a very bad interaction that causes too
unnecessary output. Add a simple gate to avoid interpreting a `;` as a
`,` when there are unclosed braces.

3 years agoAuto merge of #81942 - the8472:reduce-ui-test-threads, r=Mark-Simulacrum
bors [Fri, 9 Apr 2021 16:22:23 +0000 (16:22 +0000)]
Auto merge of #81942 - the8472:reduce-ui-test-threads, r=Mark-Simulacrum

reduce threads spawned by ui-tests

The test harness already spawns enough tests to keep all cores busy.
Individual tests should keep their own threading to a minimum to avoid context switch overhead.

When running ui tests with lld enabled this shaves about 10% off that testsuite on my machine.

Resolves #81946

3 years agoCategorize and explain target features support
Matt Ickstadt [Thu, 8 Apr 2021 05:00:47 +0000 (00:00 -0500)]
Categorize and explain target features support

3 years agoFix perf regression in non-autolinks
Joshua Nelson [Fri, 9 Apr 2021 13:58:40 +0000 (09:58 -0400)]
Fix perf regression in non-autolinks

Before, this was compiling the regex on every single item in the crate.

This would have been caught by `clippy::declare_interior_mutable_const`.

3 years agoAuto merge of #84030 - jyn514:no-blanket-impls, r=GuillaumeGomez
bors [Fri, 9 Apr 2021 13:52:56 +0000 (13:52 +0000)]
Auto merge of #84030 - jyn514:no-blanket-impls, r=GuillaumeGomez

rustdoc: Don't generate blanket impls when running --show-coverage

`get_blanket_impls` is the slowest part of rustdoc, and the coverage pass
completely ignores blanket impls. This stops running it at all, and also
removes some unnecessary checks in `calculate_doc_coverage` that ignored
the impl anyway.

We don't currently measure --show-coverage in perf.rlo, but I tested
this locally on cargo and it brought the time down from 2.9 to 1.6
seconds.

This also adds back a commented-out test; Rustdoc has been able to deal with `impl trait` for almost a year now.

r? `@GuillaumeGomez`

3 years agoset allow_fail back on each example
Timothée Delabrouille [Fri, 9 Apr 2021 13:41:26 +0000 (15:41 +0200)]
set allow_fail back on each example

3 years agoAdd back missing trait test
Joshua Nelson [Fri, 9 Apr 2021 13:10:11 +0000 (09:10 -0400)]
Add back missing trait test

Rustdoc has been able to deal with `impl trait` for almost a year now.

3 years agorustdoc: Don't generate blanket impls when running --show-coverage
Joshua Nelson [Fri, 9 Apr 2021 13:00:12 +0000 (09:00 -0400)]
rustdoc: Don't generate blanket impls when running --show-coverage

get_blanket_impls is the slowest part of rustdoc, and the coverage pass
completely ignores blanket impls. This stops running it at all, and also
removes some unnecessary checks in `calculate_doc_coverage` that ignored
the impl anyway.

We don't currently measure --show-coverage in perf.rlo, but I tested
this locally on cargo and it brought the time down from 2.9 to 1.6
seconds.

3 years agofix misspelling of register xmm23 which made xmm13 being clobbered twice
Timothée Delabrouille [Fri, 9 Apr 2021 12:08:49 +0000 (14:08 +0200)]
fix misspelling of register xmm23 which made xmm13 being clobbered twice

3 years agoconjugation
Timothée Delabrouille [Fri, 9 Apr 2021 10:39:35 +0000 (12:39 +0200)]
conjugation

3 years agoremove allow_fail and uncomment the [feature(asm)] on every example
Timothée Delabrouille [Fri, 9 Apr 2021 10:34:30 +0000 (12:34 +0200)]
remove allow_fail and uncomment the [feature(asm)] on every example

3 years agoMerge branch 'issue-76704-fix' of https://github.com/tdelabro/rust into issue-76704-fix
Timothée Delabrouille [Fri, 9 Apr 2021 10:18:18 +0000 (12:18 +0200)]
Merge branch 'issue-76704-fix' of https://github.com/tdelabro/rust into issue-76704-fix
merging

3 years agoprecisions on the authorized labels + typo
Timothée Delabrouille [Fri, 9 Apr 2021 10:18:12 +0000 (12:18 +0200)]
precisions on the authorized labels + typo

3 years agoAuto merge of #84010 - rodrimati1992:patch-3, r=Mark-Simulacrum
bors [Fri, 9 Apr 2021 07:00:31 +0000 (07:00 +0000)]
Auto merge of #84010 - rodrimati1992:patch-3, r=Mark-Simulacrum

Mention missing 1.38.0 change in RELEASES.md

Mention that doc comments on `pub use` statements are prepended to the documentation of the reexported item

Fixes #84007

3 years agoAuto merge of #83956 - estebank:issue-83892, r=varkor
bors [Fri, 9 Apr 2021 04:19:25 +0000 (04:19 +0000)]
Auto merge of #83956 - estebank:issue-83892, r=varkor

Use a more appropriate span for `;` suggestion

Fix #83892.

3 years agoreduce threads spawned by ui-tests
The8472 [Fri, 26 Mar 2021 18:01:55 +0000 (19:01 +0100)]
reduce threads spawned by ui-tests

the test harness already spawns enough tests for all cores, individual
tests should keep their own threading to a minimum to avoid context switch
overhead

some tests fail with 1 CGU, so explicit compile flags have been added
to keep their old behavior

3 years agoAdd unclosed brace in use tree test
Esteban Küber [Fri, 9 Apr 2021 01:35:04 +0000 (18:35 -0700)]
Add unclosed brace in use tree test

3 years agoAuto merge of #83870 - jackh726:binder-refactor-fix, r=nikomatsakis
bors [Fri, 9 Apr 2021 01:50:01 +0000 (01:50 +0000)]
Auto merge of #83870 - jackh726:binder-refactor-fix, r=nikomatsakis

Don't concatenate binders across types

Partially addresses #83737

There's actually two issues that I uncovered in #83737. The first is that we are concatenating bound vars across types, i.e. in
```
F: Fn(&()) -> &mut (dyn Future<Output = ()> + Unpin)
```
the bound vars on `Future` get set as `for<anon>` since those are the binders on `Fn(&()`. This is obviously wrong, since we should only concatenate directly nested trait refs. This is solved here by introducing a new `TraitRefBoundary` scope, that we put around the "syntactical" trait refs and basically don't allow concatenation across.

Now, this alone *shouldn't* be a super terrible problem. At least not until you consider the other issue, which is a much more elusive and harder to design a "perfect" fix. A repro can be seen in:
```
use core::future::Future;

async fn handle<F>(slf: &F)
where
    F: Fn(&()) -> &mut (dyn for<'a> Future<Output = ()> + Unpin),
{
    (slf)(&()).await;
}
```
Notice the `for<'a>` around `Future`. Here, `'a` is unused, so the `for<'a>` Binder gets changed to a `for<>` Binder in the generator witness, but the "local decl" still has it. This has heavy intersections with region anonymization and erasing. Luckily, it's not *super* common to find this unique set of circumstances. It only became apparently because of the first issue mentioned here. However, this *is* still a problem, so I'm leaving #83737 open.

r? `@nikomatsakis`

3 years agoAuto merge of #83941 - wesleywiser:win_dbginfo_closures, r=nagisa
bors [Thu, 8 Apr 2021 23:09:06 +0000 (23:09 +0000)]
Auto merge of #83941 - wesleywiser:win_dbginfo_closures, r=nagisa

Improve debuginfo for closures and async functions on Windows MSVC

The issue was that the resulting debuginfo was too complex for LLVM to
translate into CodeView records correctly. As a result, it simply
ignored the debuginfo which meant Windows debuggers could not display
any closed over variables when stepping inside a closure or async fn.

This fixes that by creating additional allocas on the stack so that
the resulting debuginfo is simple (just `*my_variable.dbg.spill`) and
LLVM can generate the correct CV records.

I also updated some of our existing tests to run in CDB to cover this case.

Before (closure):

![image](https://user-images.githubusercontent.com/831192/113756857-e6dc4200-96df-11eb-8d6d-b7ed7a84aad5.png)

After (closure):

![image](https://user-images.githubusercontent.com/831192/113757067-2e62ce00-96e0-11eb-89f7-7dc8ab89b1b8.png)

Before (async):

![image](https://user-images.githubusercontent.com/831192/114077916-4e2bfa80-9876-11eb-9f15-e302d1faa652.png)

After (async):

![image](https://user-images.githubusercontent.com/831192/114077677-0d33e600-9876-11eb-8ce3-cac20a9ea94a.png)

Fixes #83709

3 years agoadd 'allow_fail' to example
Timothée [Thu, 8 Apr 2021 22:09:14 +0000 (00:09 +0200)]
add 'allow_fail' to example

3 years agoNew 'Label' section with example and explainations
Timothée Delabrouille [Thu, 8 Apr 2021 21:06:21 +0000 (23:06 +0200)]
New 'Label' section with example and explainations

3 years agoAuto merge of #84008 - Dylan-DPC:rollup-invxvg8, r=Dylan-DPC
bors [Thu, 8 Apr 2021 19:38:54 +0000 (19:38 +0000)]
Auto merge of #84008 - Dylan-DPC:rollup-invxvg8, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #80733 (Improve links in inline code in `core::pin`.)
 - #81764 (Stabilize `rustdoc::bare_urls` lint)
 - #81938 (Stabilize `peekable_peek_mut`)
 - #83980 (Fix outdated crate names in compiler docs)
 - #83992 (Merge idents when generating source content)
 - #84001 (Update Clippy)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoMention missing 1.38.0 change in RELEASES.md
rodrimati1992 [Thu, 8 Apr 2021 19:29:05 +0000 (16:29 -0300)]
Mention missing 1.38.0 change in RELEASES.md

Mention that doc comments on `pub use` statements are prepended to the documentation of the reexported item

3 years agoRollup merge of #84001 - flip1995:clippyup, r=Manishearth
Dylan DPC [Thu, 8 Apr 2021 18:30:01 +0000 (20:30 +0200)]
Rollup merge of #84001 - flip1995:clippyup, r=Manishearth

Update Clippy

Biweekly Clippy update

r? ``@Manishearth``

3 years agoRollup merge of #83992 - GuillaumeGomez:merge-idents, r=notriddle
Dylan DPC [Thu, 8 Apr 2021 18:29:59 +0000 (20:29 +0200)]
Rollup merge of #83992 - GuillaumeGomez:merge-idents, r=notriddle

Merge idents when generating source content

The idea here is to not have a span for each part of a path. Currently, for `a::b::c` we generate `<span>a</span>::<span>b</span>::<span>c</span>`, with this change, we will generate `<span>a::b::c</span>`.

A nice "side-effect" is that it reduces the size of the output HTML too. :)

cc `@notriddle`

3 years agoRollup merge of #83980 - pierwill:fix-compiler-librustc-names, r=davidtwco
Dylan DPC [Thu, 8 Apr 2021 18:29:58 +0000 (20:29 +0200)]
Rollup merge of #83980 - pierwill:fix-compiler-librustc-names, r=davidtwco

Fix outdated crate names in compiler docs

Changes `librustc_X` to `rustc_X`, only in documentation comments.
Plain code comments are left unchanged.

3 years agoRollup merge of #81938 - lukaslueg:stab_peek_mut, r=Amanieu
Dylan DPC [Thu, 8 Apr 2021 18:29:57 +0000 (20:29 +0200)]
Rollup merge of #81938 - lukaslueg:stab_peek_mut, r=Amanieu

Stabilize `peekable_peek_mut`

Resolves #78302. Also adds some documentation on `std::iter::Iterator::peekable()` regarding the new method.

The feature was added in #77491 in Nov' 20, which is recently, but the feature seems reasonably small. Never did a stabilization-pr, excuse my ignorance if there is a protocol I'm not aware of.

3 years agoRollup merge of #81764 - jyn514:lint-links, r=GuillaumeGomez
Dylan DPC [Thu, 8 Apr 2021 18:29:56 +0000 (20:29 +0200)]
Rollup merge of #81764 - jyn514:lint-links, r=GuillaumeGomez

Stabilize `rustdoc::bare_urls` lint

Closes https://github.com/rust-lang/rust/issues/77501. Closes https://github.com/rust-lang/rust/issues/83598.

3 years agoRollup merge of #80733 - steffahn:prettify_pin_links, r=jyn514
Dylan DPC [Thu, 8 Apr 2021 18:29:54 +0000 (20:29 +0200)]
Rollup merge of #80733 - steffahn:prettify_pin_links, r=jyn514

Improve links in inline code in `core::pin`.

## Context

So I recently opened #80720. That PR uses HTML-based `<code>foo</code>` syntax in place of `` `foo` `` for some inline code. It looks like usage of `<code>` tags in doc comments is without precedent in the standard library, but the HTML-based syntax has an important advantage:

You can write something like
```
<code>[Box]<[Option]\<T>></code>
```
which becomes: <code>[Box]<[Option]\<T>></code>, whereas with ordinary backtick syntax, you cannot create links for a substring of an inline code block.

## Problem
I recalled (from my own experience) that a way to partially work around this limitation is to do something like
```
[`Box`]`<`[`Option`]`<T>>`
```
which looks like this: [`Box`]`<`[`Option`]`<T>>` _(admitted, it looks even worse on GitHub than in `rustdoc`’s CSS)_.

[Box]: https://doc.rust-lang.org/std/boxed/struct.Box.html "Box"
[`Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html "Box"
[Option]: https://doc.rust-lang.org/std/option/enum.Option.html "Option"
[`Option`]: https://doc.rust-lang.org/std/option/enum.Option.html "Option"
[Pin]: https://doc.rust-lang.org/std/pin/struct.Pin.html "Pin"
[&mut]: https://doc.rust-lang.org/std/primitive.reference.html "mutable reference"

So I searched the standard library and found that e.g. the [std::pin](https://doc.rust-lang.org/std/pin/index.html) module documentation uses this hack/workaround quite a bit, with types like <code>[Pin]<[Box]\<T>></code> or <code>[Pin]<[&mut] T>></code>. Although the way they look like in this sentence is what I would like them to look like, not what they currently look.

### Status Quo

Here’s a screenshot of what it currently looks like:
![Screenshot_20210105_202751](https://user-images.githubusercontent.com/3986214/103692608-4a978780-4f98-11eb-9451-e13622b2e3c0.png)

With a few HTML-style code blocks, we can fix all the spacing issues in the above screenshot that are due usage of this hack/workaround of putting multiple code blocks right next to each other being used.

### after d3915c555ee016b11ce288e107e46dbab9f78c4f:
![Screenshot_20210105_202932](https://user-images.githubusercontent.com/3986214/103692688-6f8bfa80-4f98-11eb-9be5-9b370eaef644.png)

There’s still a problem of inconsistency. Especially in a sentence such as
> A [`Pin<P>`][Pin] where `P: Deref` should be considered as a "`P`-style pointer" to _[...]_

looks weird with the variable `P` having different colors (and `Deref` has a different color from before where it was a link, too). Or compare the difference of <code>[Pin]<[Box]\<T>></code> vs [`Box<T>`][Box] where one time the variable is part of the link and the other time it isn’t.

_Note: Color differences show even **more strongly** when the ayu theme is used, while they are a bit less prominent in the light theme than they are in the dark theme, which is the one used for these screenshots._

This is why I’ve added the next commit
### after ceaeb249a3813a78bd81fa3890e27e8843a58262
![Screenshot_20210105_203113](https://user-images.githubusercontent.com/3986214/103693496-ab738f80-4f99-11eb-942d-29dace459734.png)
pulling all the type parameters out of their links, and also the last commit with clearly visible changes
### after 87ac118ba3d0c8268e043fadbd63b51e06904795
![Screenshot_20210105_203252](https://user-images.githubusercontent.com/3986214/103693625-e5dd2c80-4f99-11eb-91b7-470c37934e7e.png)
where more links are added, removing e.g. the inconsistency with `Deref`’s color in e.g. `P: Deref` that I already mentioned above.

## Discussion

I am aware that this PR may very well be overkill. If for now only the first commit (plus the fix for the `Drop` link in e65385fbfa72995b27ec64aa54f330cf503dfc03, the link titles 684edf7a70d2e90466ae74e7a321670259bf3fd9 as far as they apply, and a few of the line-break changes) are wanted, I can reduce this PR to just those changes. I personally find the rendered result with all these changes very nice though. On the other hand, all these `<code>` tags are not very nice in the source code, I’ll admit.

Perhaps alternative solutions could be preferred, such as `rustdoc` support for merging subsequent inline code blocks so that all the cases that currently use workarounds rendered as [`Box`]`<`[`Option`]`<T>>` automatically become <code>[Box]<[Option]\<T>></code> without any need for further changes. Even in this case, having a properly formatted, better looking example in the standard library docs could help motivate such a change to `rustdoc` by prodiving an example of the expected results and also the already existing alternative (i.e. using `<code>`). On the other hand, `` [`Box`]`<`[`Option`]`<T>>` `` isn’t particularly nice-looking source code either. I’m not even sure if I wouldn’t actually find the version `<code>[Box]<[Option]\<T>></code>` cleaner to read.

`@rustbot` modify labels: T-doc, T-rustdoc

3 years agoFix closed over variables not available in debuginfo for Windows MSVC
Wesley Wiser [Tue, 6 Apr 2021 17:34:17 +0000 (13:34 -0400)]
Fix closed over variables not available in debuginfo for Windows MSVC

The issue was that the resulting debuginfo was too complex for LLVM to
translate into CodeView records correctly. As a result, it simply
ignored the debuginfo which meant Windows debuggers could not display
any closed over variables when stepping inside a closure.

This fixes that by spilling additional variables to the stack so that
the resulting debuginfo is simple (just `*my_variable.dbg.spill`) and
LLVM can generate the correct CV records.

3 years agoAuto merge of #83763 - alexcrichton:wasm-multivalue-abi, r=nagisa
bors [Thu, 8 Apr 2021 17:11:42 +0000 (17:11 +0000)]
Auto merge of #83763 - alexcrichton:wasm-multivalue-abi, r=nagisa

rustc: Add a new `wasm` ABI

This commit implements the idea of a new ABI for the WebAssembly target,
one called `"wasm"`. This ABI is entirely of my own invention
and has no current precedent, but I think that the addition of this ABI
might help solve a number of issues with the WebAssembly targets.

When `wasm32-unknown-unknown` was first added to Rust I naively
"implemented an abi" for the target. I then went to write `wasm-bindgen`
which accidentally relied on details of this ABI. Turns out the ABI
definition didn't match C, which is causing issues for C/Rust interop.
Currently the compiler has a "wasm32 bindgen compat" ABI which is the
original implementation I added, and it's purely there for, well,
`wasm-bindgen`.

Another issue with the WebAssembly target is that it's not clear to me
when and if the default C ABI will change to account for WebAssembly's
multi-value feature (a feature that allows functions to return multiple
values). Even if this does happen, though, it seems like the C ABI will
be guided based on the performance of WebAssembly code and will likely
not match even what the current wasm-bindgen-compat ABI is today. This
leaves a hole in Rust's expressivity in binding WebAssembly where given
a particular import type, Rust may not be able to import that signature
with an updated C ABI for multi-value.

To fix these issues I had the idea of a new ABI for WebAssembly, one
called `wasm`. The definition of this ABI is "what you write
maps straight to wasm". The goal here is that whatever you write down in
the parameter list or in the return values goes straight into the
function's signature in the WebAssembly file. This special ABI is for
intentionally matching the ABI of an imported function from the
environment or exporting a function with the right signature.

With the addition of a new ABI, this enables rustc to:

* Eventually remove the "wasm-bindgen compat hack". Once this multivalue
  ABI is stable wasm-bindgen can switch to using it everywhere.
  Afterwards the wasm32-unknown-unknown target can have its default ABI
  updated to match C.

* Expose the ability to precisely match an ABI signature for a
  WebAssembly function, regardless of what the C ABI that clang chooses
  turns out to be.

* Continue to evolve the definition of the default C ABI to match what
  clang does on all targets, since the purpose of that ABI will be
  explicitly matching C rather than generating particular function
  imports/exports.

Naturally this is implemented as an unstable feature initially, but it
would be nice for this to get stabilized (if it works) in the near-ish
future to remove the wasm32-unknown-unknown incompatibility with the C
ABI. Doing this, however, requires the feature to be on stable because
wasm-bindgen works with stable Rust.

3 years agoFix outdated crate names in compiler docs
pierwill [Wed, 7 Apr 2021 19:47:01 +0000 (14:47 -0500)]
Fix outdated crate names in compiler docs

Changes `librustc_X` to `rustc_X`, only in documentation comments.
Plain code comments are left unchanged.

Also fix incorrect file paths.

3 years agoMerge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyup
flip1995 [Thu, 8 Apr 2021 15:50:13 +0000 (17:50 +0200)]
Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyup

3 years agoAuto merge of #7051 - flip1995:rustup, r=flip1995
bors [Thu, 8 Apr 2021 15:46:38 +0000 (15:46 +0000)]
Auto merge of #7051 - flip1995:rustup, r=flip1995

Rustup

changelog: none

r? `@ghost`

3 years agoBump nightly version -> 2021-04-08
flip1995 [Thu, 8 Apr 2021 15:37:06 +0000 (17:37 +0200)]
Bump nightly version -> 2021-04-08

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 8 Apr 2021 15:18:19 +0000 (17:18 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agorustc: Add a new `wasm` ABI
Alex Crichton [Thu, 1 Apr 2021 23:08:29 +0000 (16:08 -0700)]
rustc: Add a new `wasm` ABI

This commit implements the idea of a new ABI for the WebAssembly target,
one called `"wasm"`. This ABI is entirely of my own invention
and has no current precedent, but I think that the addition of this ABI
might help solve a number of issues with the WebAssembly targets.

When `wasm32-unknown-unknown` was first added to Rust I naively
"implemented an abi" for the target. I then went to write `wasm-bindgen`
which accidentally relied on details of this ABI. Turns out the ABI
definition didn't match C, which is causing issues for C/Rust interop.
Currently the compiler has a "wasm32 bindgen compat" ABI which is the
original implementation I added, and it's purely there for, well,
`wasm-bindgen`.

Another issue with the WebAssembly target is that it's not clear to me
when and if the default C ABI will change to account for WebAssembly's
multi-value feature (a feature that allows functions to return multiple
values). Even if this does happen, though, it seems like the C ABI will
be guided based on the performance of WebAssembly code and will likely
not match even what the current wasm-bindgen-compat ABI is today. This
leaves a hole in Rust's expressivity in binding WebAssembly where given
a particular import type, Rust may not be able to import that signature
with an updated C ABI for multi-value.

To fix these issues I had the idea of a new ABI for WebAssembly, one
called `wasm`. The definition of this ABI is "what you write
maps straight to wasm". The goal here is that whatever you write down in
the parameter list or in the return values goes straight into the
function's signature in the WebAssembly file. This special ABI is for
intentionally matching the ABI of an imported function from the
environment or exporting a function with the right signature.

With the addition of a new ABI, this enables rustc to:

* Eventually remove the "wasm-bindgen compat hack". Once this
  ABI is stable wasm-bindgen can switch to using it everywhere.
  Afterwards the wasm32-unknown-unknown target can have its default ABI
  updated to match C.

* Expose the ability to precisely match an ABI signature for a
  WebAssembly function, regardless of what the C ABI that clang chooses
  turns out to be.

* Continue to evolve the definition of the default C ABI to match what
  clang does on all targets, since the purpose of that ABI will be
  explicitly matching C rather than generating particular function
  imports/exports.

Naturally this is implemented as an unstable feature initially, but it
would be nice for this to get stabilized (if it works) in the near-ish
future to remove the wasm32-unknown-unknown incompatibility with the C
ABI. Doing this, however, requires the feature to be on stable because
wasm-bindgen works with stable Rust.

3 years agoadd comments
Niko Matsakis [Thu, 8 Apr 2021 14:56:03 +0000 (10:56 -0400)]
add comments

3 years agoAuto merge of #83500 - camelid:split-debuginfo-docs-cleanup, r=steveklabnik
bors [Thu, 8 Apr 2021 14:38:31 +0000 (14:38 +0000)]
Auto merge of #83500 - camelid:split-debuginfo-docs-cleanup, r=steveklabnik

Fix some typos in docs for `-C split-debuginfo`

3 years agoAdd test for idents merge
Guillaume Gomez [Thu, 8 Apr 2021 09:49:28 +0000 (11:49 +0200)]
Add test for idents merge

3 years agoMerge idents if they are part of a path
Guillaume Gomez [Thu, 8 Apr 2021 09:49:17 +0000 (11:49 +0200)]
Merge idents if they are part of a path

3 years agoAuto merge of #83981 - nagisa:nagisa/revert-cfg-wasm, r=Mark-Simulacrum
bors [Thu, 8 Apr 2021 07:23:04 +0000 (07:23 +0000)]
Auto merge of #83981 - nagisa:nagisa/revert-cfg-wasm, r=Mark-Simulacrum

Remove the insta-stable `cfg(wasm)`

The addition of `cfg(wasm)` was an oversight on my end that turns out to have a number
of downsides:

* It was introduced as an insta-stable addition, forgoing the usual
  staging mechanism we use for potentially far-reaching changes;
* It is a breaking change for people who are using `--cfg wasm` either
  directly or via cargo for other purposes;
* It is not entirely clear if a bare `wasm` cfg is a right option or
  whether `wasm` family of targets are special enough to warrant
  special-casing these targets specifically.

As for the last point, there appears to be a fair amount of support for
reducing the boilerplate in specifying architectures from the same
family, while ignoring their pointer width. The suggested way forward
would be to propose such a change as a separate RFC as it is potentially
a quite contentious addition.

cc #83879 `@devsnek`

3 years agoAuto merge of #83866 - jyn514:disambiguator-error, r=camelid
bors [Thu, 8 Apr 2021 05:08:08 +0000 (05:08 +0000)]
Auto merge of #83866 - jyn514:disambiguator-error, r=camelid

rustdoc: Link to the docs on namespaces when an unknown disambiguator is found

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

`@lopopolo` does this look about like what you expected?

r? `@camelid`

3 years agoAuto merge of #82958 - camelid:res-docs, r=petrochenkov
bors [Thu, 8 Apr 2021 02:43:31 +0000 (02:43 +0000)]
Auto merge of #82958 - camelid:res-docs, r=petrochenkov

Document `Res` and its friends

I noticed [this Zulip conversation][z] and thought it would be a good idea to
document `Res` and the other types near it.

[z]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.2382516.20-.20Add.20inherent.20associated.20types/near/227914819

3 years agoFix some typos in docs for `-C split-debuginfo`
Camelid [Thu, 25 Mar 2021 22:44:37 +0000 (15:44 -0700)]
Fix some typos in docs for `-C split-debuginfo`

3 years agoDocument `Res` and its friends
Camelid [Wed, 10 Mar 2021 03:37:21 +0000 (19:37 -0800)]
Document `Res` and its friends

3 years agoAuto merge of #83986 - Dylan-DPC:rollup-51vygcj, r=Dylan-DPC
bors [Thu, 8 Apr 2021 00:15:36 +0000 (00:15 +0000)]
Auto merge of #83986 - Dylan-DPC:rollup-51vygcj, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #82497 (Fix handling of `--output-format json` flag)
 - #83689 (Add more info for common trait resolution and async/await errors)
 - #83952 (Account for `ExprKind::Block` when suggesting .into() and deref)
 - #83965 (Add Debug implementation for hir::intravisit::FnKind)
 - #83974 (Fix outdated crate names in `rustc_interface::callbacks`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #83974 - pierwill:fix-callbacks-names, r=jyn514
Dylan DPC [Wed, 7 Apr 2021 23:01:47 +0000 (01:01 +0200)]
Rollup merge of #83974 - pierwill:fix-callbacks-names, r=jyn514

Fix outdated crate names in `rustc_interface::callbacks`

3 years agoRollup merge of #83965 - rust-lang:debug-intravisit-fnkind, r=lqd
Dylan DPC [Wed, 7 Apr 2021 23:01:46 +0000 (01:01 +0200)]
Rollup merge of #83965 - rust-lang:debug-intravisit-fnkind, r=lqd

Add Debug implementation for hir::intravisit::FnKind

3 years agoRollup merge of #83952 - estebank:issue-83943, r=petrochenkov
Dylan DPC [Wed, 7 Apr 2021 23:01:45 +0000 (01:01 +0200)]
Rollup merge of #83952 - estebank:issue-83943, r=petrochenkov

Account for `ExprKind::Block` when suggesting .into() and deref

Fix #83943.

3 years agoRollup merge of #83689 - estebank:cool-bears-hot-tip, r=davidtwco
Dylan DPC [Wed, 7 Apr 2021 23:01:43 +0000 (01:01 +0200)]
Rollup merge of #83689 - estebank:cool-bears-hot-tip, r=davidtwco

Add more info for common trait resolution and async/await errors

* Suggest `Pin::new`/`Box::new`/`Arc::new`/`Box::pin` in more cases
* Point at `impl` and type defs introducing requirements on E0277

3 years agoRollup merge of #82497 - jyn514:json, r=CraftSpider
Dylan DPC [Wed, 7 Apr 2021 23:01:42 +0000 (01:01 +0200)]
Rollup merge of #82497 - jyn514:json, r=CraftSpider

Fix handling of `--output-format json` flag

- Don't treat it as deprecated on stable and beta channels. Before, it
  would give confusing and incorrect output:

  ```
  warning: the 'output-format' flag is considered deprecated
    |
    = warning: see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information

  error: json output format isn't supported for doc generation
  ```
  Both of those are wrong: output-format isn't deprecated, and json
  output is supported.

- Require -Z unstable-options for `--output-format json`

  Previously, it was allowed by default on nightly, which made it hard
  to realize the flag wouldn't be accepted on beta or stable.

To get the test working I had to remove `-Z unstable-options`, which x.py passed to compiletest unconditionally. It was first added in https://github.com/rust-lang/rust/commit/8c2ec689c159e7f021d5913efb991aff875be967 so `-Z miri` would be allowed. -Z miri is no longer passed unconditionally, so hopefully removing it won't break anything.

r? ```@aDotInTheVoid``` cc ```@HeroicKatora``` ```@CraftSpider```

Thanks to ```@memoryruins``` for pointing it out on Discord!

cc ```@Mark-Simulacrum``` for the change to compiletest.

3 years agoAuto merge of #82451 - jyn514:defaults, r=Mark-Simulacrum
bors [Wed, 7 Apr 2021 20:44:37 +0000 (20:44 +0000)]
Auto merge of #82451 - jyn514:defaults, r=Mark-Simulacrum

Cleanup option parsing and config.toml.example

- Add an assertion that `link-shared = true` when `thin-lto = true`.
  Previously, link-shared would be silently overwritten.

- Get rid of `Option<bool>` in bootstrap/config.rs. Set defaults
  immediately instead of delaying until later in bootstrap. This makes
  it easier to find what the default value is.

- Remove redundant `config.x = false` when the default was already false
- Set defaults for `bindir` in `default_opts()` instead of `parse()`
- Update `download-ci-llvm = if-supported` option to match bootstrap.py
- Remove redundant check for link_shared. Previously, it was checked twice.

- Update various options in config.toml.example to their defaults.
  Previously, some options showed an example value instead of the
  default value.

- Fix incorrect defaults in config.toml.example
  + `use-libcxx` defaults to false
  + Add missing `check-stage = 0`
  + Update several defaults to be conditional (e.g. `if incremental { 10 } else { 100 }`)

- Remove redundant defaults in prose
- Use the same comment for the default and target-dependent `musl-root`
- Fix typos
- Link to `cc_detect` for `cc` and `cxx`, since the logic is ... complicated.
- Update more defaults to better reflect how they actually get set
- Remove ignored `gpg-password-file` option

  This stopped being used in
  7704d35,
  but was never removed from config.toml.

- Remove unused flags from `config.toml`
    + Disallow `infodir` and `localstatedir` in `config.toml`
    + Allow the flags in `./configure`, but give a warning that they will be
      ignored.
    + Fix incorrect comment that `datadir` will be ignored.

    Example output:

    ```
    $ ./configure --set install.infodir=xxx
    configure: processing command line
    configure:
    configure: install.infodir      := xxx
    configure: build.configure-args := ['--set', 'install.infodir=xxx']
    warning: infodir will be ignored
    configure:
    configure: writing `config.toml` in current directory
    configure:
    configure: run `python /home/joshua/rustc3/x.py --help`
    configure:
    ```

- Update CHANGELOG

cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/bootstrap.20defaults

3 years agoRemove the insta-stable `cfg(wasm)`
Simonas Kazlauskas [Wed, 7 Apr 2021 19:49:33 +0000 (22:49 +0300)]
Remove the insta-stable `cfg(wasm)`

The addition of `cfg(wasm)` was an oversight on my end that has a number
of downsides:

* It was introduced as an insta-stable addition, forgoing the usual
  staging mechanism we use for potentially far-reaching changes;
* It is a breaking change for people who are using `--cfg wasm` either
  directly or via cargo for other purposes;
* It is not entirely clear if a bare `wasm` cfg is a right option or
  whether `wasm` family of targets are special enough to warrant
  special-casing these targets specifically.

As for the last point, there appears to be a fair amount of support for
reducing the boilerplate in specifying architectures from the same
family, while ignoring their pointer width. The suggested way forward
would be to propose such a change as a separate RFC as it is potentially
a quite contentious addition.

3 years agoCleanup option parsing and config.toml.example
Joshua Nelson [Tue, 23 Feb 2021 18:01:39 +0000 (13:01 -0500)]
Cleanup option parsing and config.toml.example

- Add an assertion that `link-shared = true` when `thin-lto = true`.
  Previously, link-shared would be silently overwritten.

- Get rid of `Option<bool>` in bootstrap/config.rs. Set defaults
  immediately instead of delaying until later in bootstrap. This makes
  it easier to find what the default value is.

- Remove redundant `config.x = false` when the default was already false
- Set defaults for `bindir` in `default_opts()` instead of `parse()`
- Update `download-ci-llvm = if-supported` option to match bootstrap.py
- Remove redundant check for link_shared. Previously, it was checked twice.

- Update various options in config.toml.example to their defaults.
  Previously, some options showed an example value instead of the
  default value.

- Fix incorrect defaults in config.toml.example
  + `use-libcxx` defaults to false
  + Add missing `check-stage = 0`
  + Update several defaults to be conditional (e.g. `if incremental { 10 } else { 100 }`)

- Remove redundant defaults in prose
- Use the same comment for the default and target-dependent `musl-root`
- Fix typos
- Link to `cc_detect` for `cc` and `cxx`, since the logic is ... complicated.
- Update more defaults to better reflect how they actually get set
- Remove ignored `gpg-password-file` option

  This stopped being used in
  https://github.com/rust-lang/rust/commit/7704d35accfe1b587ce41ea09ca3bf6a47aca117,
  but was never removed from config.toml.

- Remove unused flags from `config.toml`
    + Disallow `infodir` and `localstatedir` in `config.toml`
    + Allow the flags in `./configure`, but give a warning that they will be
      ignored.
    + Fix incorrect comment that `datadir` will be ignored.

    Example output:

    ```
    $ ./configure --set install.infodir=xxx
    configure: processing command line
    configure:
    configure: install.infodir      := xxx
    configure: build.configure-args := ['--set', 'install.infodir=xxx']
    warning: infodir will be ignored
    configure:
    configure: writing `config.toml` in current directory
    configure:
    configure: run `python /home/joshua/rustc3/x.py --help`
    configure:
    ```

- Update CHANGELOG
- Add "as an example" where appropriate
- Link to an issue instead of to ephemeral chats

3 years agoAuto merge of #81047 - glittershark:stabilize-cmp-min-max-by, r=kodraus
bors [Wed, 7 Apr 2021 18:02:21 +0000 (18:02 +0000)]
Auto merge of #81047 - glittershark:stabilize-cmp-min-max-by, r=kodraus

Stabilize cmp_min_max_by

I would like to propose cmp::{min_by, min_by_key, max_by, max_by_key}
for stabilization.

These are relatively simple and seemingly uncontroversial functions and
have been unchanged in unstable for a while now.

Closes: #64460
3 years agoFix outdated crate names in `rustc_interface::callbacks`
pierwill [Wed, 7 Apr 2021 16:45:27 +0000 (11:45 -0500)]
Fix outdated crate names in `rustc_interface::callbacks`

3 years agoUpdate library/core/src/iter/traits/iterator.rs
lukaslueg [Wed, 7 Apr 2021 16:02:46 +0000 (18:02 +0200)]
Update library/core/src/iter/traits/iterator.rs

Co-authored-by: Yuki Okushi <jtitor@2k36.org>
3 years agoUpdate library/core/src/iter/traits/iterator.rs
lukaslueg [Wed, 7 Apr 2021 16:02:39 +0000 (18:02 +0200)]
Update library/core/src/iter/traits/iterator.rs

Co-authored-by: Yuki Okushi <jtitor@2k36.org>
3 years agoAuto merge of #83964 - Dylan-DPC:rollup-9kinaiv, r=Dylan-DPC
bors [Wed, 7 Apr 2021 15:33:46 +0000 (15:33 +0000)]
Auto merge of #83964 - Dylan-DPC:rollup-9kinaiv, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #83476 (Add strong_count mutation methods to Rc)
 - #83634 (Do not emit the advanced diagnostics on macros)
 - #83816 (Trigger `unused_doc_comments` on macros at once)
 - #83916 (Use AnonConst for asm! constants)
 - #83935 (forbid `impl Trait` in generic param defaults)
 - #83936 (Disable using non-ascii identifiers in extern blocks.)
 - #83945 (Add suggestion to reborrow mutable references when they're moved in a for loop)
 - #83954 (Do not ICE when closure is involved in Trait Alias Impl Trait)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agorebase and update tests
Esteban Küber [Wed, 7 Apr 2021 15:31:38 +0000 (08:31 -0700)]
rebase and update tests

3 years agoStabilize cmp_min_max_by
Griffin Smith [Fri, 15 Jan 2021 17:20:54 +0000 (12:20 -0500)]
Stabilize cmp_min_max_by

I would like to propose cmp::{min_by, min_by_key, max_by, max_by_key}
for stabilization.

These are relatively simple and seemingly uncontroversial functions and
have been unchanged in unstable for a while now.

3 years agoReuse logic for determining the channel in the rest of rustdoc
Joshua Nelson [Tue, 6 Apr 2021 18:51:36 +0000 (14:51 -0400)]
Reuse logic for determining the channel in the rest of rustdoc

This doesn't update main.js because it's included as a fixed string.

3 years agorustdoc: Link to the docs on namespaces when an unknown disambiguator is found
Joshua Nelson [Mon, 5 Apr 2021 00:02:32 +0000 (20:02 -0400)]
rustdoc: Link to the docs on namespaces when an unknown disambiguator is found

3 years agoAuto merge of #83932 - lcnr:probe-perf, r=estebank
bors [Wed, 7 Apr 2021 12:52:33 +0000 (12:52 +0000)]
Auto merge of #83932 - lcnr:probe-perf, r=estebank

use a `SmallVec` in `impl_or_trait_item`

#83293 showed that this is fairly hot, slightly improves max-rss and cpu cycles, does not noticeably improve instruction counts

3 years agoAdd Debug implementation for hir::intravisit::FnKind
Guillaume Gomez [Wed, 7 Apr 2021 11:30:37 +0000 (13:30 +0200)]
Add Debug implementation for hir::intravisit::FnKind

3 years agoRollup merge of #83954 - estebank:issue-83613, r=varkor
Dylan DPC [Wed, 7 Apr 2021 11:07:18 +0000 (13:07 +0200)]
Rollup merge of #83954 - estebank:issue-83613, r=varkor

Do not ICE when closure is involved in Trait Alias Impl Trait

Fix #83613.

3 years agoRollup merge of #83945 - SkiFire13:fix-83924, r=estebank
Dylan DPC [Wed, 7 Apr 2021 11:07:17 +0000 (13:07 +0200)]
Rollup merge of #83945 - SkiFire13:fix-83924, r=estebank

Add suggestion to reborrow mutable references when they're moved in a for loop

Address #83924

3 years agoRollup merge of #83936 - crlf0710:disallow_extern_block_non_ascii, r=Manishearth
Dylan DPC [Wed, 7 Apr 2021 11:07:16 +0000 (13:07 +0200)]
Rollup merge of #83936 - crlf0710:disallow_extern_block_non_ascii, r=Manishearth

Disable using non-ascii identifiers in extern blocks.

Fixes #83923.

3 years agoRollup merge of #83935 - SNCPlay42:param-default-impl-trait, r=varkor
Dylan DPC [Wed, 7 Apr 2021 11:07:15 +0000 (13:07 +0200)]
Rollup merge of #83935 - SNCPlay42:param-default-impl-trait, r=varkor

forbid `impl Trait` in generic param defaults

Fixes #83929

Forbid using `impl Trait` in the default types of generic parameters, e.g. `struct Foo<T = impl Trait>`. I assume this was never supposed to be allowed - it seems no UI test used it.

Note that using `impl Trait` in this position did not hit a feature gate error; however, this *shouldn't* be a breaking change as any attempt to use it should have hit the ICE in #83929 and/or failed to provide a defining use of the `impl Trait`.

3 years agoRollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkov
Dylan DPC [Wed, 7 Apr 2021 11:07:14 +0000 (13:07 +0200)]
Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkov

Use AnonConst for asm! constants

This replaces the old system which used explicit promotion. See #83169 for more background.

The syntax for `const` operands is still the same as before: `const <expr>`.

Fixes #83169

Because the implementation is heavily based on inline consts, we suffer from the same issues:
- We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`.
- We are hitting the same ICEs as inline consts, for example #78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.

3 years agoRollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkov
Dylan DPC [Wed, 7 Apr 2021 11:07:14 +0000 (13:07 +0200)]
Rollup merge of #83916 - Amanieu:asm_anonconst, r=petrochenkov

Use AnonConst for asm! constants

This replaces the old system which used explicit promotion. See #83169 for more background.

The syntax for `const` operands is still the same as before: `const <expr>`.

Fixes #83169

Because the implementation is heavily based on inline consts, we suffer from the same issues:
- We lose the ability to use expressions derived from generics. See the deleted tests in `src/test/ui/asm/const.rs`.
- We are hitting the same ICEs as inline consts, for example #78174. It is unlikely that we will be able to stabilize this before inline consts are stabilized.

3 years agoRollup merge of #83816 - JohnTitor:unused-doc-comments-on-macros, r=varkor
Dylan DPC [Wed, 7 Apr 2021 11:07:12 +0000 (13:07 +0200)]
Rollup merge of #83816 - JohnTitor:unused-doc-comments-on-macros, r=varkor

Trigger `unused_doc_comments` on macros at once

Fixes #83768

3 years agoRollup merge of #83634 - JohnTitor:proc-macro-ice, r=varkor
Dylan DPC [Wed, 7 Apr 2021 11:07:11 +0000 (13:07 +0200)]
Rollup merge of #83634 - JohnTitor:proc-macro-ice, r=varkor

Do not emit the advanced diagnostics on macros

Fixes #83510

3 years agoRollup merge of #83476 - mystor:rc_mutate_strong_count, r=m-ou-se
Dylan DPC [Wed, 7 Apr 2021 11:07:06 +0000 (13:07 +0200)]
Rollup merge of #83476 - mystor:rc_mutate_strong_count, r=m-ou-se

Add strong_count mutation methods to Rc

The corresponding methods were stabilized on `Arc` in #79285 (tracking: #71983). This patch implements and stabilizes identical methods on the `Rc` types as well.

3 years agoAuto merge of #83833 - jyn514:no-resolver, r=GuillaumeGomez
bors [Wed, 7 Apr 2021 04:45:12 +0000 (04:45 +0000)]
Auto merge of #83833 - jyn514:no-resolver, r=GuillaumeGomez

rustdoc: Store intra-doc links in Cache instead of on items directly

Items are first built after rustdoc creates the TyCtxt. To allow
resolving the links before the TyCtxt is built, the links can't be
stored on `clean::Item` directly.

Helps with https://github.com/rust-lang/rust/issues/83761. Opening this early because I think it might decrease memory usage.

3 years agoAuto merge of #7046 - camsteffen:symbol-optimize, r=giraffate
bors [Wed, 7 Apr 2021 04:36:31 +0000 (04:36 +0000)]
Auto merge of #7046 - camsteffen:symbol-optimize, r=giraffate

Some symbol optimizations

changelog: none

3 years agoAdd spans to E0277 for impl/trait type/fn obligation disparity
Esteban Küber [Wed, 31 Mar 2021 23:53:26 +0000 (16:53 -0700)]
Add spans to E0277 for impl/trait type/fn obligation disparity

3 years agoreview comments
Esteban Küber [Wed, 31 Mar 2021 19:10:24 +0000 (12:10 -0700)]
review comments