Commit graph

153781 commits

Author SHA1 Message Date
lcnr
bc0156bace shrink ty::PredicateKind again 2021-08-26 11:00:30 +02:00
lcnr
283e0e670b is_polymorphic doesn't matter for tests 2021-08-26 11:00:30 +02:00
lcnr
5ba8f4d258 update mir diffs 2021-08-26 11:00:30 +02:00
lcnr
6755b2da44 ignore const substs in implicit_infer 2021-08-26 11:00:30 +02:00
lcnr
caa975c89e use ty::Unevaluated instead of def substs pair 2021-08-26 11:00:30 +02:00
lcnr
031243898e check for cycles in default_anon_const_substs 2021-08-26 11:00:30 +02:00
lcnr
2140016d6c don't just compare ty::Const 2021-08-26 11:00:30 +02:00
lcnr
ab9108b70f update TypeFlags to deal with missing ct substs 2021-08-26 11:00:30 +02:00
lcnr
cc47998e28 add tcx to fn walk 2021-08-26 11:00:30 +02:00
lcnr
bfaf13af4e make unevaluated const substs optional 2021-08-26 11:00:30 +02:00
lcnr
f4b606fd17 require a tcx for TypeVisitor 2021-08-26 10:54:01 +02:00
bors
3b3ce374d2 Auto merge of #88222 - jyn514:shared-cache, r=GuillaumeGomez
rustdoc: Move Cache from Context to SharedContext

r? `@camelid`
2021-08-26 08:04:29 +00:00
bors
76e755cf4a Auto merge of #88066 - LeSeulArtichaut:patterns-cleanups, r=nagisa
Use if-let guards in the codebase and various other pattern cleanups

Dogfooding if-let guards as experimentation for the feature.

Tracking issue #51114. Conflicts with #87937.
2021-08-26 05:23:35 +00:00
Noah Lev
4478ecc352 Don't panic if close_tag() is called without tags to close
This can happen when a tag is opened after the length limit is reached;
the tag will not end up being added to `unclosed_tags` because the queue
will never be flushed. So, now, if the `unclosed_tags` stack is empty,
`close_tag()` does nothing.

This change fixes a panic in the `limit_0` unit test.
2021-08-25 20:09:17 -07:00
Noah Lev
d932e62dd9 Assert that tag_name is alphabetic 2021-08-25 20:03:27 -07:00
Noah Lev
f8ca5764c3 Add tests for HtmlWithLimit 2021-08-25 20:03:25 -07:00
bors
c4be230b4a Auto merge of #88069 - Mark-Simulacrum:llvm-pgo, r=pietroalbini
PGO for LLVM builds on x86_64-unknown-linux-gnu in CI

This shows up to 6% less instruction counts with larger - up to 18% - wins on cycles
on multiple benchmarks, and up to 19% wins on the -j1 wall times for rustc self-compilation.

We can afford to spend the extra cycles building LLVM essentially once more for
the x86_64-unknown-linux-gnu CI build today. The builder finishes in around 50
minutes on average, and this adds just 10 more minutes. Given the sizeable
improvements in compiler performance, this is definitely worth it.
2021-08-26 01:14:16 +00:00
Santiago Pastorino
4fcae2c891
Add const and static TAIT tests 2021-08-25 20:32:31 -03:00
Santiago Pastorino
bb583f72e3
Add field types tait tests 2021-08-25 20:10:08 -03:00
Santiago Pastorino
5df5659a6b
Revert "Add type of a let tait test impl trait straight in let"
This reverts commit dbadab54df.
This is not part of TAITs, so, if tested should probably be done
elsewhere.
2021-08-25 19:14:50 -03:00
Thom Chiovoloni
5b25de58d6 Reference tracking issue 2021-08-25 14:58:17 -07:00
Erik Desjardins
adf3b013c8 use a peekable iterator to check the first chunk 2021-08-25 17:49:29 -04:00
Erik Desjardins
c07a2eb5b4 yet more comment improvements 2021-08-25 17:49:29 -04:00
Erik Desjardins
75fecd5d40 improve comments 2021-08-25 17:49:28 -04:00
Erik Desjardins
e950f11019 put code in a more logical order 2021-08-25 17:49:28 -04:00
Erik Desjardins
5bef23d0fa add comments 2021-08-25 17:49:28 -04:00
Erik Desjardins
3c2b706da6 implement InitMaskCompressed using InitChunkIter, cleanup 2021-08-25 17:49:28 -04:00
Erik Desjardins
1eaccab24e optimize initialization checks 2021-08-25 17:49:28 -04:00
Erik Desjardins
c9599c4cac improve comment 2021-08-25 17:49:28 -04:00
Erik Desjardins
5e81d643d9 don't generate partially-undef consts 2021-08-25 17:49:28 -04:00
Erik Desjardins
4d635fdf63 use undef for uninitialized bytes in constants 2021-08-25 17:49:28 -04:00
Noah Lev
8a6501d288 Adjust spans
* Highlight the whole pattern if it has no fields
* Highlight the whole definition if it has no fields
* Only highlight the pattern name if the pattern is multi-line
* Determine whether a pattern is multi-line based on distance from name
  to last field, rather than first field
2021-08-25 14:40:06 -07:00
Mark Rousskov
1ea8d93c0c Bump download-ci-llvm stamp
This will ensure the optimized LLVM is used for local builds after rebasing
immediately, rather than needing to wait for a future LLVM bump.
2021-08-25 16:27:17 -04:00
Mark Rousskov
21d8d5f881 Bump sccache used in CI to v0.2.15
This skips bumping Windows sccache because we run into compilation failures when
doing so (-m32 not supported by clang-cl?). Not clear on cause, but seems
easiest to just hold back.

This should avoid PGO-related failures encountered on Linux, and more broadly
seems like a good idea on other platforms as well (though it is likely not
necessary right this moment).
2021-08-25 16:26:45 -04:00
bors
0afc20860e Auto merge of #85499 - jackh726:assoc-type-norm-rebase, r=nikomatsakis
Normalize projections under binders

Fixes #70243
Fixes #70120
Fixes #62529
Fixes #87219

Issues to followup on after (probably fixed, but no test added here):
#76956
#56556
#79207
#85636

r? `@nikomatsakis`
2021-08-25 20:08:00 +00:00
jackh726
994a6bb667 Bless NLL compare mode 2021-08-25 16:06:52 -04:00
Wesley Wiser
0a42dfc2fa Fix debugger stepping behavior around match expressions
Previously, we would set up the source lines for `match` expressions so
that the code generated to perform the test of the scrutinee was matched
to the line of the arm that required the test and then jump from the arm
block to the "next" block was matched to all of the lines in the `match`
expression.

While that makes sense, it has the side effect of causing strange
stepping behavior in debuggers.

I've changed the source information so that all of the generated tests
are sourced to `match {scrutinee}` and the jumps are sourced to the last
line of the block they are inside. This resolves the weird stepping
behavior in all debuggers and resolves some instances of "ambiguous
symbol" errors in WinDbg preventing the user from setting breakpoints at
`match` expressions.
2021-08-25 15:17:22 -04:00
Thom Chiovoloni
33c71ac87d Add c_size_t and c_ssize_t to std::os::raw. 2021-08-25 11:25:26 -07:00
Léo Lanteri Thauvin
2b0c8fff8a Various pattern cleanups 2021-08-25 20:24:39 +02:00
Léo Lanteri Thauvin
fde1b76b4b Use if-let guards in the codebase 2021-08-25 20:24:35 +02:00
bors
7b0e554ee2 Auto merge of #88329 - LeSeulArtichaut:rollup-blg8hc0, r=LeSeulArtichaut
Rollup of 16 pull requests

Successful merges:

 - #87944 (add Cell::as_array_of_cells, similar to Cell::as_slice_of_cells)
 - #88156 (Adjust / fix documentation of `Arc::make_mut`)
 - #88157 (bootstrap.py: recognize riscv64 when auto-detect)
 - #88196 (Refactor `named_asm_labels` to a HIR lint)
 - #88218 (Remove `Session.trait_methods_not_found`)
 - #88223 (Remove the `TryV2` alias)
 - #88226 (Fix typo “a Rc” → “an Rc” (and a few more))
 - #88267 (2229: Update signature for truncate function)
 - #88273 (Fix references to `ControlFlow` in docs)
 - #88277 (Update books)
 - #88291 (Add SAFETY comments to core::slice::sort::partition_in_blocks)
 - #88293 (Fix grammar in alloc test)
 - #88298 (Errorkind reorder)
 - #88299 (Stabilise BufWriter::into_parts)
 - #88314 (Add type of a let tait test)
 - #88325 (Add mutable-noalias to the release notes for 1.54)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-08-25 16:22:57 +00:00
Niko Matsakis
88bcd4457b
trailing whitespace 2021-08-25 12:09:48 -04:00
Niko Matsakis
d7d122faec
update docs for type_implements_trait 2021-08-25 11:39:35 -04:00
Léo Lanteri Thauvin
d9ed23a913
Rollup merge of #88325 - jyn514:noalias, r=XAMPPRocky
Add mutable-noalias to the release notes for 1.54

It was enabled in #82834 and disabled in 1.53 by #86036, but it was never disabled on (then) nightly, so it still landed in 1.54.

This was mentioned on https://github.com/rust-lang/rust/pull/86696 but never made it into the release notes.

r? `@XAMPPRocky` cc `@nikic`
2021-08-25 15:49:03 +02:00
Léo Lanteri Thauvin
16fd95c482
Rollup merge of #88314 - spastorino:type-of-a-let-tait-test, r=oli-obk
Add type of a let tait test

r? `@oli-obk`

Related to #86727
2021-08-25 15:49:02 +02:00
Léo Lanteri Thauvin
3eee91b403
Rollup merge of #88299 - ijackson:bufwriter, r=Mark-Simulacrum
Stabilise BufWriter::into_parts

The FCP for this has already completed, in #80690.

This was just blocked on #85901 (which changed the name), which is now merged.  The original stabilisation MR was #84770 but that has a lot of noise in it, and I also accidentally deleted the branch while trying to tidy up.  So here is a new MR.  Sorry for the noise.

Closes #80690
2021-08-25 15:49:01 +02:00
Léo Lanteri Thauvin
82ecb0f412
Rollup merge of #88298 - ijackson:errorkind-reorder, r=dtolnay
Errorkind reorder

I was doing a bit more work in this area and the untidiness of these two orderings bothered me.

The commit messages have the detailed rationale.  For your convenience, I c&p them here:

```
    io::ErrorKind: rationalise ordering in main enum

    It is useful to keep some coherent structure to this ordering.  In
    particular, Other and Uncategorized should be next to each other, at
    the end.

    Also it seems to make sense to treat UnexpectedEof and OutOfMemory
    specially, since they are not like the other errors (despite
    OutOfMemory also being generatable by some OS errors).

    So:
     * Move Other to the end, just before Uncategorized
     * Move Unsupported to between Interrupted and UnexpectedEof
     * Add some comments documenting where to add things
```

```
    io::Error: alphabeticise the match in as_str()

    There was no rationale for the previous ordering.
```

r? kennytm   since that's who rust-highfive picked before, in #88294 which I accidentally closed.
2021-08-25 15:49:00 +02:00
Léo Lanteri Thauvin
0aabf4bb4b
Rollup merge of #88293 - est31:fix_grammar, r=Mark-Simulacrum
Fix grammar in alloc test
2021-08-25 15:48:59 +02:00
Léo Lanteri Thauvin
dc2c9746f8
Rollup merge of #88291 - mdsn:partition-in-blocks-safety, r=Mark-Simulacrum
Add SAFETY comments to core::slice::sort::partition_in_blocks

A few more SAFETY comments for #66219. There are still a few more in this module.

`@rustbot` label T-libs T-compiler C-cleanup
2021-08-25 15:48:58 +02:00
Léo Lanteri Thauvin
e6d922b018
Rollup merge of #88277 - ehuss:update-books, r=ehuss
Update books

## reference

1 commits in 4884fe45c14f8b22121760fb117181bb4da8dfe0..da6ea9b03f74cae0a292f40315723d7a3a973637
2021-07-28 21:31:28 -0700 to 2021-08-19 21:28:10 -0700
- Allow users to change status labels (rust-lang/reference#1083)

## book

7 commits in 7e49659102f0977d9142190e1ba23345c0f00eb1..687e21bde2ea10c261f79fa14797c5137425098d
2021-08-03 21:41:35 -0400 to 2021-08-18 20:48:38 -0400
- Small tweaks to Ferris size and position
- Retain previous height: auto just in case
- Shrink and move ferris when possible
- Snapshot chapter 6 for nostarch
- Demonstrate variable as catch-all for match. Fixes rust-lang/book#1868.
- Improve the if let example to have a binding pattern. Fixes rust-lang/book#1401.
- Fixes typo (rust-lang/book#2816)

## rust-by-example

1 commits in 0dc9cd4e89f00cb5230f120e1a083916386e422b..04f489c889235fe3b6dfe678ae5410d07deda958
2021-07-23 09:14:27 -0300 to 2021-08-17 08:01:20 -0300
- Grammar mistake (rust-lang/rust-by-example#1456)

## rustc-dev-guide

5 commits in c4644b427cbdaafc7a87be0ccdf5d8aaa07ac35f..cf0e151b7925a40f13fbc6573c6f97d5f94c7c17
2021-08-10 20:41:44 +0900 to 2021-08-22 11:47:02 -0300
- Fix typo “a Rc” → “an Rc” (rust-lang/rustc-dev-guide#1191)
- Expand THIR section with more details (rust-lang/rustc-dev-guide#1183)
- Remove docs for old -Z profile-queries flag
- update mdbook version to latest
- allow to quickly edit a page directly on github
2021-08-25 15:48:57 +02:00