Commit graph

141249 commits

Author SHA1 Message Date
bors
5662d9343f Auto merge of #80965 - camelid:rename-doc-spotlight, r=jyn514
Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]`

Fixes #80936.

"spotlight" is not a very specific or self-explaining name.
Additionally, the dialog that it triggers is called "Notable traits".
So, "notable trait" is a better name.

* Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]`
* Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]`
* Update documentation
* Improve documentation

r? `@Manishearth`
2021-04-02 07:04:58 +00:00
bors
4fa76a4a77 Auto merge of #80828 - SNCPlay42:opaque-projections, r=estebank
Fix expected/found order on impl trait projection mismatch error

fixes #68561

This PR adds a new `ObligationCauseCode` used when checking the concrete type of an impl trait satisfies its bounds, and checks for that cause code in the existing test to see if a projection's normalized type should be the "expected" or "found" type.

The second commit adds a `peel_derives` to that test, which appears to be necessary in some cases (see projection-mismatch-in-impl-where-clause.rs, which would still give expected/found in the wrong order otherwise). This caused some other changes in diagnostics not involving impl trait, but they look correct to me.
2021-04-02 03:39:32 +00:00
bors
d1065e6cef Auto merge of #83663 - AngelicosPhosphoros:simplify_binary_and_to_get_better_asm, r=nagisa
Simplify logical operations CFG

This is basically same commit as e38e954a0d which was reverted later in 676953fde9
In both cases, this changes weren't benchmarked.
e38e954a0d leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/62993)
676953fde9 leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/83623)
2021-04-02 00:48:31 +00:00
bors
d474075a8f Auto merge of #82780 - cjgillot:dep-stream, r=michaelwoerister
Stream the dep-graph to a file instead of storing it in-memory.

This is a reimplementation of #60035.

Instead of storing the dep-graph in-memory, the nodes are encoded as they come
into the a temporary file as they come. At the end of a successful the compilation,
this file is renamed to be the persistent dep-graph, to be decoded during the next
compilation session.

This two-files scheme avoids overwriting the dep-graph on unsuccessful or crashing compilations.

The structure of the file is modified to be the sequence of `(DepNode, Fingerprint, EdgesVec)`.
The deserialization is responsible for going to the more compressed representation.
The `node_count` and `edge_count` are stored in the last 16 bytes of the file,
in order to accurately reserve capacity for the vectors.

At the end of the compilation, the encoder is flushed and dropped.
The graph is not usable after this point: any creation of a node will ICE.

I had to retrofit the debugging options, which is not really pretty.
2021-04-01 16:29:33 +00:00
AngelicosPhosphoros
4464cc2256 Simplify logical operations CFG
This is basically same commit as e38e954a0d which was reverted later in 676953fde9
In both cases, this changes weren't benchmarked.
e38e954a0d leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/62993)
676953fde9 leads to missed optimization described in [this issue](https://github.com/rust-lang/rust/issues/83623)

Also it changes some src/test/run-make-fulldeps/coverage-spanview/expected_mir_dump* files automatically.
2021-04-01 18:34:11 +03:00
bors
803ddb8359 Auto merge of #83726 - the8472:large-trustedlen-fail-fast, r=kennytm
panic early when `TrustedLen` indicates a `length > usize::MAX`

Changes `TrustedLen` specializations to immediately panic when `size_hint().1 == None`.

As far as I can tell this is ~not a change~ a minimal change in observable behavior for anything except ZSTs because the fallback path would go through `extend_desugared()` which tries to `reserve(lower_bound)` which already is `usize::MAX` and that would also lead to a panic. Before it might have popped somewhere between zero and a few elements from the iterator before panicking while it now panics immediately.

Overall this should reduce codegen by eliminating the fallback paths.

While looking into the `with_capacity()` behavior I also noticed that its documentation didn't have a *Panics* section, so I added that.
2021-04-01 07:55:00 +00:00
bors
49e1ec0995 Auto merge of #83736 - JohnTitor:fix-unsafe_block_in_unsafe_fn-stabilized-version, r=jyn514
Fix the `unsafe_block_in_unsafe_fn`s stabilized version

Fixes #83735
2021-04-01 05:34:54 +00:00
bors
cbd6ec7604 Auto merge of #83732 - ehuss:update-cargo, r=ehuss
Update cargo

5 commits in 1e8703890f285befb5e32627ad4e0a0454dde1fb..3c44c3c4b7900b8b13c85ead25ccaa8abb7d8989
2021-03-26 16:59:39 +0000 to 2021-03-31 21:21:15 +0000
- Fix semver docs for 1.51. (rust-lang/cargo#9316)
- Add `cargo config` subcommand. (rust-lang/cargo#9302)
- Give one more example for the --featuers CLI (rust-lang/cargo#9313)
- Bump to 0.54.0, update changelog (rust-lang/cargo#9308)
- Make the URL to the tracking issue for `--out-dir` into a link (rust-lang/cargo#9309)
2021-04-01 03:13:39 +00:00
Yuki Okushi
fe9c4fbb9e Fix the unsafe_block_in_unsafe_fns stabilized version 2021-04-01 10:56:51 +09:00
Eric Huss
cb969e86a5 Update cargo 2021-03-31 17:45:03 -07:00
bors
4896450e7e Auto merge of #83731 - Dylan-DPC:rollup-v2z3gkt, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #83015 (Add regression tests for #79825 and #81555)
 - #83699 (Add a regression test for issue-68830)
 - #83700 (Fix documentation of conversion from String to OsString)
 - #83711 (Clarify `--print target-list` is a rustc's option)
 - #83712 (Update LLVM with another wasm simd fix)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-01 00:42:50 +00:00
Dylan DPC
578cfa3535
Rollup merge of #83712 - alexcrichton:more-wasm-simd-llvm-updates, r=nikic
Update LLVM with another wasm simd fix

Just a small bug fix for opcode numberings, not too major.
2021-04-01 02:41:48 +02:00
Dylan DPC
1ef52ac5f5
Rollup merge of #83711 - JohnTitor:more-friendly-unknown-target-error, r=davidtwco
Clarify `--print target-list` is a rustc's option

Fixes #68238
2021-04-01 02:41:47 +02:00
Dylan DPC
ea277f1909
Rollup merge of #83700 - steffahn:string_to_pathbuf_conversion_documentation, r=JohnTitor
Fix documentation of conversion from String to OsString

From [this question on URLO](https://users.rust-lang.org/t/does-converting-a-string-into-a-pathbuf-allocate-new-buffer/57678), I noticed that the documentation of `From<String> for OsString` incorrectly claims to be copying data.

````@rustbot```` modify labels: T-doc, T-libs
2021-04-01 02:41:46 +02:00
Dylan DPC
e40601e952
Rollup merge of #83699 - JohnTitor:issue-68830, r=Dylan-DPC
Add a regression test for issue-68830

Closes #68830
2021-04-01 02:41:45 +02:00
Dylan DPC
9e30e57eeb
Rollup merge of #83015 - hyd-dev:test-79825-81555, r=Aaron1011
Add regression tests for #79825 and #81555

Closes #79825.
Closes #81555.

`@rustbot` label A-proc-macros T-compiler
2021-04-01 02:41:44 +02:00
The8472
ad3a791e2a panic early when TrustedLen indicates a length > usize::MAX 2021-03-31 23:09:28 +02:00
bors
4fdac23f31 Auto merge of #76814 - jackh726:binder-refactor, r=nikomatsakis
Refactor `Binder` to track bound vars

c.c. `@rust-lang/wg-traits`

This is super early (and might just get closed at some point), but want to get at least an initial idea of the perf impact.

r? `@ghost`
2021-03-31 18:06:06 +00:00
Alex Crichton
9acf558db4 Update LLVM with another wasm simd fix
Just a small bug fix for opcode numberings, not too major.
2021-03-31 10:24:41 -07:00
JohnTitor
82c6709d6f Clarify --print target-list is a rustc's option 2021-04-01 01:59:50 +09:00
Camille GILLOT
f3dde45d2a Enable debugging the dep-graph without debug-assertions.
It may also be useful in these cases,
and some CI configurations test without debug assertions.
2021-03-31 17:12:06 +02:00
Jack Huey
7108918db6 Cleanups and comments 2021-03-31 10:16:37 -04:00
Jack Huey
0c98dc66fd Fix tests and AstConv -> dyn AstConv 2021-03-31 10:16:37 -04:00
Jack Huey
4ff65ec782 Fmt and test revert 2021-03-31 10:16:37 -04:00
Jack Huey
8ad7e5685e Fix new problem from rebase and a little cleanup 2021-03-31 10:16:37 -04:00
Jack Huey
6d5efa9f04 Add var to BoundRegion. Add query to get bound vars for applicable items. 2021-03-31 10:16:37 -04:00
Jack Huey
666859a6f8 Make late and late_anon regions track the bound var position 2021-03-31 10:15:56 -04:00
Jack Huey
84f82d348c Revert explicit lifetimes 2021-03-31 10:15:56 -04:00
Jack Huey
30187c81f6 Track bound vars 2021-03-31 10:15:27 -04:00
Jack Huey
62a49c3bb8 Add tcx lifetime to Binder 2021-03-31 10:13:57 -04:00
Jack Huey
74851f4cf3 count bound vars 2021-03-31 10:11:47 -04:00
Frank Steffahn
7509aa108c Apply suggestions from code review
More links, one more occurrence of “a OsString”

Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
2021-03-31 16:09:25 +02:00
Jack Huey
97a22a4f9c Add u32 for bound variables to Binder 2021-03-31 10:05:32 -04:00
Jack Huey
4955d755d3 Some rebinds and dummys 2021-03-31 10:05:32 -04:00
Frank Steffahn
f5e7dbb20a Add a few missing links, fix a typo 2021-03-31 16:02:59 +02:00
Frank Steffahn
e7821e5475 Fix documentation of conversion from String to OsString 2021-03-31 16:02:52 +02:00
JohnTitor
ce6658818d Add a regression test for issue-68830 2021-03-31 18:48:28 +09:00
bors
a5029ac0ab Auto merge of #83684 - cjgillot:csp, r=petrochenkov
Remove hir::CrateItem.

The crate span is exactly the crate module's inner span. There is no need to store it twice.
2021-03-31 08:34:40 +00:00
bors
2a32abbcde Auto merge of #83681 - jyn514:blanket-impls-tweaks, r=Aaron1011
rustdoc: Only look at blanket impls in `get_blanket_impls`

The idea here is that all the work in 16156fb278/compiler/rustc_middle/src/ty/trait_def.rs (L172-L186) doesn't matter for `get_blanket_impls` - Rustdoc will already pick up on those blocks when it documents the item.
2021-03-31 05:47:22 +00:00
bors
6ff482bde5 Auto merge of #83666 - Amanieu:instrprof-order, r=tmandry
Run LLVM coverage instrumentation passes before optimization passes

This matches the behavior of Clang and allows us to remove several
hacks which were needed to ensure functions weren't optimized away
before reaching the instrumentation pass.

Fixes #83429

cc `@richkadel`

r? `@tmandry`
2021-03-31 03:20:33 +00:00
bors
65b44b0320 Auto merge of #83692 - Dylan-DPC:rollup-2a2m3jy, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #80720 (Make documentation of which items the prelude exports more readable.)
 - #83654 (Do not emit a suggestion that causes the E0632 error)
 - #83671 (Add a regression test for issue-75801)
 - #83678 (Fix Self keyword doc URL conflict on case insensitive file systems (until definitely fixed on rustdoc))
 - #83680 (Update for loop desugaring docs)
 - #83683 (bootstrap: don't complain about linkcheck if it is excluded)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-03-30 23:47:51 +00:00
Dylan DPC
7a587f0d06
Rollup merge of #83683 - tblah:riscv64linux_links, r=Mark-Simulacrum
bootstrap: don't complain about linkcheck if it is excluded

We don't need to complain to the user about linkcheck having different
hosts and targets when it is already excluded.

Resolves #83661
2021-03-31 01:14:50 +02:00
Dylan DPC
2aa1bf8984
Rollup merge of #83680 - ibraheemdev:patch-2, r=Dylan-DPC
Update for loop desugaring docs

It looks like the documentation for `for` loops was not updated to match the new de-sugaring process.
2021-03-31 01:14:49 +02:00
Dylan DPC
d51fc973e4
Rollup merge of #83678 - GuillaumeGomez:hack-Self-keyword-conflict, r=jyn514
Fix Self keyword doc URL conflict on case insensitive file systems (until definitely fixed on rustdoc)

This is just a hack to allow rustup to work on macOS and windows again to distribute std documentation (hopefully once https://github.com/rust-lang/rfcs/pull/3097 or an equivalent is merged).

Fixes https://github.com/rust-lang/rust/issues/80504. Prevents https://github.com/rust-lang/rust/issues/83154 and https://github.com/rust-lang/rustup/issues/2694 in future releases.

cc ``@kinnison``
r? ``@jyn514``
2021-03-31 01:14:48 +02:00
Dylan DPC
f1ad4bd97c
Rollup merge of #83671 - JohnTitor:issue-75801-test, r=Dylan-DPC
Add a regression test for issue-75801

Closes #75801
r? ``@Aaron1011``
2021-03-31 01:14:47 +02:00
Dylan DPC
7d888d100f
Rollup merge of #83654 - JohnTitor:issue-83606, r=estebank
Do not emit a suggestion that causes the E0632 error

Fixes #83606
2021-03-31 01:14:46 +02:00
Dylan DPC
7391124154
Rollup merge of #80720 - steffahn:prettify_prelude_imports, r=camelid,jyn514
Make documentation of which items the prelude exports more readable.

I recently figured out that rustdoc allows link inside of inline code blocks as long as they’re delimited with `<code> </code>` instead of `` ` ` ``. I think this applies nicely in the listing of prelude exports [in the docs](https://doc.rust-lang.org/std/prelude/index.html). There, currently unformatted `::` and `{ , }` is used in order to mimick import syntax while attatching links to individual identifiers.

## Rendered Comparison
### Currently (light)
![Screenshot_20210105_155801](https://user-images.githubusercontent.com/3986214/103661510-1a87be80-4f6f-11eb-8360-1dfb23f732e8.png)

### After this PR (light)
![Screenshot_20210105_155811](https://user-images.githubusercontent.com/3986214/103661533-1f4c7280-4f6f-11eb-89d4-874793937824.png)

### Currently (dark)
![Screenshot_20210105_155824](https://user-images.githubusercontent.com/3986214/103661571-2a9f9e00-4f6f-11eb-95f9-e291b5570b41.png)

### After this PR (dark)
![Screenshot_20210105_155836](https://user-images.githubusercontent.com/3986214/103661592-2ffce880-4f6f-11eb-977a-82afcb07d331.png)

### Currently (ayu)
![Screenshot_20210105_155917](https://user-images.githubusercontent.com/3986214/103661619-39865080-4f6f-11eb-9ca1-9045a107cddd.png)

### After this PR (ayu)
![Screenshot_20210105_155923](https://user-images.githubusercontent.com/3986214/103661652-3db26e00-4f6f-11eb-82b7-378e38f0c41f.png)

_Edit:_ I just noticed, the “current” screenshots are from stable, so there are a few more differences in the pictures than the ones from just this PR.
2021-03-31 01:14:40 +02:00
Camille GILLOT
fbfef40e32 Fix fulldeps tests. 2021-03-30 23:51:15 +02:00
bors
74874a690b Auto merge of #83652 - xu-cheng:ipv4-octal, r=sfackler
Disallow octal format in Ipv4 string

In its original specification, leading zero in Ipv4 string is interpreted
as octal literals. So a IP address 0127.0.0.1 actually means 87.0.0.1.

This confusion can lead to many security vulnerabilities. Therefore, in
[IETF RFC 6943], it suggests to disallow octal/hexadecimal format in Ipv4
string all together.

Existing implementation already disallows hexadecimal numbers. This commit
makes Parser reject octal numbers.

Fixes #83648.

[IETF RFC 6943]: https://tools.ietf.org/html/rfc6943#section-3.1.1
2021-03-30 19:34:23 +00:00
Camille GILLOT
9d8f833e05 Remove hir::CrateItem. 2021-03-30 20:31:06 +02:00