]> git.lizzy.rs Git - rust.git/log
rust.git
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 #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 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 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

3 years agoAlways mention `Box::pin` when dealing with `!Unpin`
Esteban Küber [Tue, 30 Mar 2021 20:51:08 +0000 (13:51 -0700)]
Always  mention `Box::pin` when dealing with `!Unpin`

3 years agoPoint at `impl` and type defs introducing requirements on E0277
Esteban Küber [Tue, 30 Mar 2021 20:37:30 +0000 (13:37 -0700)]
Point at `impl` and type defs introducing requirements on E0277

3 years agoSuggest Pin/Box/Arc for more cases
Esteban Küber [Tue, 30 Mar 2021 17:01:22 +0000 (10:01 -0700)]
Suggest Pin/Box/Arc for more cases

3 years agoAuto merge of #83955 - ehuss:update-stage0, r=Mark-Simulacrum
bors [Wed, 7 Apr 2021 02:26:25 +0000 (02:26 +0000)]
Auto merge of #83955 - ehuss:update-stage0, r=Mark-Simulacrum

Bump bootstrap compiler

Pulls in #83946

Closes #83914

3 years agoUse a more appropriate span for `;` suggestion
Esteban Küber [Wed, 7 Apr 2021 02:23:22 +0000 (19:23 -0700)]
Use a more appropriate span for `;` suggestion

Fix #83892.

3 years agoDisable using non-ascii identifiers in extern blocks.
Charles Lew [Tue, 6 Apr 2021 15:49:59 +0000 (23:49 +0800)]
Disable using non-ascii identifiers in extern blocks.

3 years agoBump bootstrap compiler
Eric Huss [Wed, 7 Apr 2021 01:24:09 +0000 (18:24 -0700)]
Bump bootstrap compiler

3 years agoDo not ICE when closure is involved in TAIT
Esteban Küber [Wed, 7 Apr 2021 01:17:50 +0000 (18:17 -0700)]
Do not ICE when closure is involved in TAIT

Fix #83613.

3 years agoRemove trailing `:` from E0119 message
Esteban Küber [Wed, 7 Apr 2021 01:16:11 +0000 (18:16 -0700)]
Remove trailing `:` from E0119 message

3 years agoAccount for `ExprKind::Block` when suggesting .into() and deref
Esteban Küber [Wed, 7 Apr 2021 00:23:48 +0000 (17:23 -0700)]
Account for `ExprKind::Block` when suggesting .into() and deref

Fix #83943.

3 years agoAuto merge of #83828 - camelid:rustdoc-vec-perf, r=jyn514
bors [Tue, 6 Apr 2021 23:57:06 +0000 (23:57 +0000)]
Auto merge of #83828 - camelid:rustdoc-vec-perf, r=jyn514

rustdoc: Use `ThinVec` in a few places

Almost every crate has no primitives and no keywords defined in it, so
using `ThinVec` should make some types smaller.

3 years agoFix handling of `--output-format json` flag
Joshua Nelson [Wed, 24 Feb 2021 21:16:49 +0000 (16:16 -0500)]
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.
  Note that this still allows `--output-format html`, which has been
  stable since 1.0.

- Remove unnecessary double-checking of the feature gate when parsing
  the output format
- Add custom run-make test since compiletest passes -Zunstable-options
    by default

3 years agoAdd regression test
Giacomo Stevanato [Tue, 6 Apr 2021 19:39:58 +0000 (21:39 +0200)]
Add regression test

3 years agoAdd reborrow suggestion when mutable reference is moved in a for loop
Giacomo Stevanato [Tue, 6 Apr 2021 19:39:44 +0000 (21:39 +0200)]
Add reborrow suggestion when mutable reference is moved in a for loop

3 years agoStore links in Cache instead of on items directly
Joshua Nelson [Sun, 4 Apr 2021 02:15:24 +0000 (22:15 -0400)]
Store 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.

3 years agoSymbol optimizations
Cameron Steffen [Wed, 24 Mar 2021 14:31:43 +0000 (09:31 -0500)]
Symbol optimizations

3 years agoAuto merge of #83934 - Dylan-DPC:rollup-nw5dadn, r=Dylan-DPC
bors [Tue, 6 Apr 2021 17:55:55 +0000 (17:55 +0000)]
Auto merge of #83934 - Dylan-DPC:rollup-nw5dadn, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #82963 (Move `SharedContext` to `context.rs`)
 - #83829 (rustc_target: Rely on defaults more in target specs)
 - #83895 (Add listing of lints (eg via `-W help`) to rustdoc)
 - #83902 (Update LLVM to support more wasm simd ops)
 - #83903 (Fix typo in TokenStream documentation)
 - #83910 (Update cargo)
 - #83920 (Fix HashMap/HashSet LLDB pretty-printer after hashbrown 0.11.0)

Failed merges:

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

3 years agoAuto merge of #7044 - camsteffen:match-path, r=Manishearth
bors [Tue, 6 Apr 2021 17:41:34 +0000 (17:41 +0000)]
Auto merge of #7044 - camsteffen:match-path, r=Manishearth

Soft deprecate match_path and match_qpath

changelog: none

From zulip [disucssion](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/match_.5Bq.5Dpath.20is.20bad.3F).

3 years agorustdoc: Use `ThinVec` in a few places
Camelid [Sat, 3 Apr 2021 01:32:06 +0000 (18:32 -0700)]
rustdoc: Use `ThinVec` in a few places

Almost every crate has no primitives and no keywords defined in it, so
using `ThinVec` should make some types smaller.

3 years agoAuto merge of #7043 - camsteffen:dead-utils, r=flip1995
bors [Tue, 6 Apr 2021 16:49:42 +0000 (16:49 +0000)]
Auto merge of #7043 - camsteffen:dead-utils, r=flip1995

Remove some dead utils

changelog: none

3 years agoSoft deprecate match_path and match_qpath
Cameron Steffen [Tue, 6 Apr 2021 13:56:14 +0000 (08:56 -0500)]
Soft deprecate match_path and match_qpath

3 years agoRemove paths::PATH_BUF
Cameron Steffen [Thu, 1 Apr 2021 15:24:44 +0000 (10:24 -0500)]
Remove paths::PATH_BUF

3 years agoRemove get_node_span
Cameron Steffen [Thu, 1 Apr 2021 14:51:31 +0000 (09:51 -0500)]
Remove get_node_span

3 years agoMerge branch 'master' into stab_peek_mut
lukaslueg [Tue, 6 Apr 2021 16:23:21 +0000 (18:23 +0200)]
Merge branch 'master' into stab_peek_mut

3 years agoUpdate library/core/src/iter/adapters/peekable.rs
lukaslueg [Tue, 6 Apr 2021 16:16:02 +0000 (18:16 +0200)]
Update library/core/src/iter/adapters/peekable.rs

Co-authored-by: Alexander Ronald Altman <alexanderaltman@me.com>
3 years agoRollup merge of #83920 - ortem:fix-hashmap-lldb-pretty-printer-1.52, r=pnkfelix
Dylan DPC [Tue, 6 Apr 2021 15:42:35 +0000 (17:42 +0200)]
Rollup merge of #83920 - ortem:fix-hashmap-lldb-pretty-printer-1.52, r=pnkfelix

Fix HashMap/HashSet LLDB pretty-printer after hashbrown 0.11.0

The pretty-printer was broken in https://github.com/rust-lang/rust/pull/77566 after updating hashbrown to 0.11.0.
Note that the corresponding GDB pretty-printer was updated properly.

Fixes #83891

3 years agoRollup merge of #83910 - ehuss:update-cargo, r=ehuss
Dylan DPC [Tue, 6 Apr 2021 15:42:34 +0000 (17:42 +0200)]
Rollup merge of #83910 - ehuss:update-cargo, r=ehuss

Update cargo

3 commits in 3c44c3c4b7900b8b13c85ead25ccaa8abb7d8989..65d57e6f384c2317f76626eac116f683e2b63665
2021-03-31 21:21:15 +0000 to 2021-04-04 15:07:52 +0000
- Fix typo in contrib docs. (rust-lang/cargo#9328)
- fix clippy warnings (rust-lang/cargo#9323)
- Add -Zallow-features to match rustc's -Z (rust-lang/cargo#9283)

3 years agoRollup merge of #83903 - rust-lang:GuillaumeGomez-patch-1, r=lcnr
Dylan DPC [Tue, 6 Apr 2021 15:42:33 +0000 (17:42 +0200)]
Rollup merge of #83903 - rust-lang:GuillaumeGomez-patch-1, r=lcnr

Fix typo in TokenStream documentation

3 years agoRollup merge of #83902 - alexcrichton:update-llvm, r=nikic
Dylan DPC [Tue, 6 Apr 2021 15:42:32 +0000 (17:42 +0200)]
Rollup merge of #83902 - alexcrichton:update-llvm, r=nikic

Update LLVM to support more wasm simd ops

Adds a commit with support for i64 simd comparisons for the wasm target

3 years agoRollup merge of #83895 - eggyal:issue-83883, r=jyn514
Dylan DPC [Tue, 6 Apr 2021 15:42:31 +0000 (17:42 +0200)]
Rollup merge of #83895 - eggyal:issue-83883, r=jyn514

Add listing of lints (eg via `-W help`) to rustdoc

Fixes #83883

r? `@jyn514`

3 years agoRollup merge of #83829 - petrochenkov:minclean, r=nagisa
Dylan DPC [Tue, 6 Apr 2021 15:42:29 +0000 (17:42 +0200)]
Rollup merge of #83829 - petrochenkov:minclean, r=nagisa

rustc_target: Rely on defaults more in target specs

3 years agoRollup merge of #82963 - camelid:move-sharedcontext, r=GuillaumeGomez
Dylan DPC [Tue, 6 Apr 2021 15:42:28 +0000 (17:42 +0200)]
Rollup merge of #82963 - camelid:move-sharedcontext, r=GuillaumeGomez

Move `SharedContext` to `context.rs`

It is tightly connected to `Context` and is primarily used as a field in
`Context`. Thus, it should be next to `Context`.

3 years agoAuto merge of #83875 - jyn514:diag_info, r=bugadani
bors [Tue, 6 Apr 2021 15:37:29 +0000 (15:37 +0000)]
Auto merge of #83875 - jyn514:diag_info, r=bugadani

rustdoc: Use DiagnosticInfo in more parts of intra-doc links

This makes the code a lot less verbose.

This is separated into lots of tiny commits because it was easier for me that way, but the overall diff isn't that big if you want to read it at once.

r? `@bugadani`

3 years agoAuto merge of #6931 - Jarcho:needless_borrow, r=phansch,flip1995
bors [Tue, 6 Apr 2021 15:30:48 +0000 (15:30 +0000)]
Auto merge of #6931 - Jarcho:needless_borrow, r=phansch,flip1995

Fix all occurences `needless_borrow` internally

The bug that got 'needless_borrow' moved into the nursery was fixed two years ago in d4370f8b.

This did trigger over a thousand times internally, so that's all the other changes. I vetted most of them, but there's a lot The only interesting change is to the lint list. `declare_tool_lint` already makes a reference, so there's no need to take a reference to the lints.

changelog: None

3 years agoforbid `impl Trait` in generic param defaults
SNCPlay42 [Tue, 6 Apr 2021 15:21:08 +0000 (16:21 +0100)]
forbid `impl Trait` in generic param defaults

3 years agouse a `SmallVec` in `impl_or_trait_item`
lcnr [Tue, 6 Apr 2021 15:06:44 +0000 (17:06 +0200)]
use a `SmallVec` in `impl_or_trait_item`

3 years agoFix all occurences of `needless_borrow` internally
Jason Newcomb [Fri, 2 Apr 2021 21:35:32 +0000 (17:35 -0400)]
Fix all occurences of `needless_borrow` internally