Commit Graph

217010 Commits

Author SHA1 Message Date
bors
575d424c94 Auto merge of #107717 - nnethercote:opt-TyKind-eq, r=compiler-errors
Optimize `TyKind::eq`.

r? `@ghost`
2023-02-09 00:41:31 +00:00
bors
fd2d8beaf8 Auto merge of #10293 - Alexendoo:bool-assert-comparison-negation, r=dswij
Negate suggestions when needed in `bool_assert_comparison`

changelog: none assuming this gets into the same release as #10218

Fixes #10291

r? `@dswij`

Thanks to `@black-puppydog` for spotting it early
2023-02-08 23:03:32 +00:00
clubby789
730470c8dd Set rust-analyzer.check.invocationLocation to root 2023-02-08 22:53:50 +00:00
Michael Howell
8cb5be96c4 rustdoc: use [svgo] to shrink wheel.svg
[svgo]: https://github.com/svg/svgo

    $ du -bs src/librustdoc/html/static/images/wheel.svg wheel-old.svg
    2972    src/librustdoc/html/static/images/wheel.svg
    3764    wheel-old.svg

100*((2972-3764)/3764) = -21.04%
2023-02-08 14:17:19 -07:00
bors
ef934d9b63 Auto merge of #107811 - matthiaskrgr:rollup-rpjzshk, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #105641 (Implement cursors for BTreeMap)
 - #107271 (Treat Drop as a rmw operation)
 - #107710 (Update strip-ansi-escapes and vte)
 - #107758 (Change `arena_cache` to not alter the declared query result)
 - #107777 (Make `derive_const` derive properly const-if-const impls)
 - #107780 (Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*`)
 - #107793 (Add missing tracking issue for `RawOsError`)
 - #107807 (Fix small debug typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-08 20:11:35 +00:00
Alan Egerton
38ec810c37
Do not assemble supertraits for trait aliases 2023-02-08 19:55:50 +00:00
KaDiWa
62edacf738
bootstrap.py: fix build-failure message 2023-02-08 19:19:23 +01:00
lcnr
4c7c5e597f add (currently ICEing) test 2023-02-08 19:11:14 +01:00
lcnr
a5164605bc correctly update goals in the cache 2023-02-08 19:11:14 +01:00
Michael Goulet
0017822b70 Do not eagerly recover for bad impl-trait in macros 2023-02-08 17:56:08 +00:00
Matthias Krüger
3eea052dbb
Rollup merge of #107807 - GuillaumeGomez:fix-small-debug-typo, r=notriddle
Fix small debug typo

r? ``@notriddle``
2023-02-08 18:32:45 +01:00
Matthias Krüger
c7c66e1b12
Rollup merge of #107793 - joboet:raw_os_error_ty_tracking, r=Dylan-DPC
Add missing tracking issue for `RawOsError`

I forgot to add it in the original PR…

See #107792.

```@rustbot``` label +T-libs-api -T-libs
2023-02-08 18:32:44 +01:00
Matthias Krüger
ec65285fdd
Rollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnr
Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*`

Mentioning "binder" rather than "bound vars", imo, makes it clearer that we're doing something to the binder as a whole.

Also, "instantiate" is the verb that I'm always reaching for when I'm looking for these functions, and the name that we use in the new solver anyways.

r? types
2023-02-08 18:32:44 +01:00
Matthias Krüger
5b8403c463
Rollup merge of #107777 - compiler-errors:derive_const-actually-derive-const, r=fee1-dead
Make `derive_const` derive properly const-if-const impls

Fixes #107774
Fixes #107666

Also fixes rendering of const-if-const bounds in pretty printing.

r? ```@oli-obk``` or ```@fee1-dead```
2023-02-08 18:32:43 +01:00
Matthias Krüger
abc2203e36
Rollup merge of #107758 - Zoxc:arena-enref, r=cjgillot
Change `arena_cache` to not alter the declared query result

This makes the return types a bit clearer, limiting `arena_cache`'s effect to just the computation side. It also makes it easier to potentially remove `arena_cache`.

r? ```@cjgillot```
2023-02-08 18:32:43 +01:00
Matthias Krüger
f696e699a0
Rollup merge of #107710 - ehuss:update-strip-ansi-escapes, r=Mark-Simulacrum
Update strip-ansi-escapes and vte

This updates strip-ansi-escapes from 0.1.0 to 0.1.1 (and consequently vte).
Changes: https://github.com/luser/strip-ansi-escapes/compare/0.1.0...0.1.1
The only change really is updating vte which fixes some parsing issues (and drops the vendored source size by several megabytes).

Closes #107708
2023-02-08 18:32:42 +01:00
Matthias Krüger
05748c66a0
Rollup merge of #107271 - Zeegomo:drop-rmw, r=oli-obk
Treat Drop as a rmw operation

Previously, a Drop terminator was considered a move in MIR. This commit changes the behavior to only treat Drop as a mutable access to the dropped place.

In order for this change to be correct, we need to guarantee that

1.  A dropped value won't be used again
   2.  Places that appear in a drop won't be used again before a
     subsequent initialization.

We can ensure this to be correct at MIR construction because Drop will only be emitted when a variable goes out of scope, thus having:
*   (1) as there is no way of reaching the old value. drop-elaboration
     will also remove any uninitialized drop.
 * (2) as the place can't be named following the end of the scope.

However, the initialization status, previously tracked by moves, should also be tied to the execution of a Drop, hence the additional logic in the dataflow analyses.

From discussion in [this thread](https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/.60DROP.60.20to.20.60DROP_IF.60.20compiler-team.23558), originating from https://github.com/rust-lang/compiler-team/issues/558.
See also https://github.com/rust-lang/rust/pull/104488#discussion_r1085556010
2023-02-08 18:32:41 +01:00
Matthias Krüger
562581c2db
Rollup merge of #105641 - Amanieu:btree_cursor, r=m-ou-se
Implement cursors for BTreeMap

See the ACP for an overview of the API: https://github.com/rust-lang/libs-team/issues/141

The implementation is split into 2 commits:
- The first changes the internal insertion functions to return a handle to the newly inserted element. The lifetimes involved are a bit hairy since we need a mutable handle to both the `BTreeMap` itself (which holds the root) and the nodes allocated in memory. I have tested that this passes the standard library testsuite under miri.
- The second commit implements the cursor API itself. This is more straightforward to follow but still involves some unsafe code to deal with simultaneous mutable borrows of the tree root and the node that is currently being iterated.
2023-02-08 18:32:41 +01:00
bors
9433ba6394 Auto merge of #107644 - Zoxc:query-cache-tweak, r=cjgillot
Remove QueryStorage::store_nocache

This method was added in https://github.com/rust-lang/rust/pull/70674 but it doesn't seem to serve any purpose.
2023-02-08 16:59:18 +00:00
Guillaume Gomez
cc8758480c Fix small debug typo 2023-02-08 17:31:54 +01:00
joboet
6a5331146c
std: add tracking issue for RawOsError 2023-02-08 12:35:27 +01:00
bors
a00e24d76a Auto merge of #107529 - Zoxc:inline-tweak-profile, r=cjgillot
Optimize query_cache_hit to reduce code size of the query hot path.

A small tweak which improves performance on check builds by 0.33% and reduces `rustc_driver` size by 1%.
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7978s</td><td align="right">1.7980s</td><td align="right"> 0.01%</td><td align="right">1.7930s</td><td align="right"> -0.27%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2594s</td><td align="right">0.2591s</td><td align="right"> -0.12%</td><td align="right">0.2592s</td><td align="right"> -0.09%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.2522s</td><td align="right">6.2540s</td><td align="right"> 0.03%</td><td align="right">6.2358s</td><td align="right"> -0.26%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5889s</td><td align="right">1.5880s</td><td align="right"> -0.05%</td><td align="right">1.5799s</td><td align="right"> -0.57%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9941s</td><td align="right">0.9939s</td><td align="right"> -0.02%</td><td align="right">0.9893s</td><td align="right"> -0.49%</td></tr><tr><td>Total</td><td align="right">10.8925s</td><td align="right">10.8930s</td><td align="right"> 0.01%</td><td align="right">10.8572s</td><td align="right"> -0.32%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9997s</td><td align="right"> -0.03%</td><td align="right">0.9967s</td><td align="right"> -0.33%</td></tr></table>

r? `@cjgillot`
2023-02-08 10:35:46 +00:00
John Kåre Alsaker
a0b96fdb50 Change arena_cache to not alter the declared query result 2023-02-08 09:34:52 +01:00
Tharun Suresh
4259073e9a x.py fails all downloads that use a tempdir with snap curl #107722 2023-02-08 13:37:15 +05:30
bors
3bb6ee5dce Auto merge of #10295 - DesmondWillowbrook:diff-format-suspicious-to-owned, r=Jarcho
fix(suspicious_to_owned): use span_suggestions to suggest both intents

fixes #10294

changelog: [`suspicious_to_owned`]: suggestions now produce valid Rust code
2023-02-08 07:50:43 +00:00
bors
6eb9f2dd67 Auto merge of #107788 - matthiaskrgr:rollup-mw10sli, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #107656 (Bump rust-installer)
 - #107757 (Allow automatically creating vscode `settings.json` with `x setup`)
 - #107769 (Rename `PointerSized` to `PointerLike`)
 - #107770 (rustdoc: use a newline instead of `<br>` to format code headers)
 - #107771 (Tweak ICE message)
 - #107773 (Clearly signal purpose of the yaml template)
 - #107776 (Docs: Fix format of headings in String::reserve)
 - #107779 (Remove astconv usage in diagnostic)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-08 07:43:37 +00:00
Matthias Krüger
fe26182281
Rollup merge of #107779 - compiler-errors:issue-107775, r=jackh726
Remove astconv usage in diagnostic

Fixes #107775

Location of the test sucks, I know, but I needed to put it somewhere 😓
The issue here is that the root cause of the issue has nothing to do with what's being tested, so I couldn't really give it a better name. Oh well.
2023-02-08 07:13:29 +01:00
Matthias Krüger
5e467f5dfa
Rollup merge of #107776 - dbrgn:docs-string-reserve-headings, r=cuviper
Docs: Fix format of headings in String::reserve

It was inconsistent with other doc comments in the same module (and the rest of the rust std docs).
2023-02-08 07:13:28 +01:00
Matthias Krüger
a4a164cc45
Rollup merge of #107773 - Mark-Simulacrum:rename-auto-template, r=estebank
Clearly signal purpose of the yaml template

Following up on https://github.com/rust-lang/rust/pull/106898#issuecomment-1383238532
2023-02-08 07:13:28 +01:00
Matthias Krüger
31345cd70a
Rollup merge of #107771 - estebank:ice-msg, r=compiler-errors
Tweak ICE message

Modify main message to be more conversational and emit one fewer note.
2023-02-08 07:13:27 +01:00
Matthias Krüger
86cc4141f7
Rollup merge of #107770 - notriddle:notriddle/br2nl, r=GuillaumeGomez
rustdoc: use a newline instead of `<br>` to format code headers

Since these elements now use `white-space: pre-wrap` since #107615, it's fine to use newlines for formatting, which is smaller and a bit less complicated.
2023-02-08 07:13:27 +01:00
Matthias Krüger
fabefe3f31
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
Rename `PointerSized` to `PointerLike`

The old name was unnecessarily vague. This PR renames a nightly language feature that I added, so I don't think it needs any additional approval, though anyone can feel free to speak up if you dislike the rename.

It's still unsatisfying that we don't the user which of {size, alignment} is wrong, but this trait really is just a stepping stone for a more generalized mechanism to create `dyn*`, just meant for nightly testing, so I don't think it really deserves additional diagnostic machinery for now.

Fixes #107696, cc ``@RalfJung``
r? ``@eholk``
2023-02-08 07:13:26 +01:00
Matthias Krüger
b16a321b25
Rollup merge of #107757 - clubby789:setup-settings-json, r=jyn514
Allow automatically creating vscode `settings.json` with `x setup`

Closes #107703
2023-02-08 07:13:26 +01:00
Matthias Krüger
00efb0cb96
Rollup merge of #107656 - jonhoo:bump-rust-installer, r=Mark-Simulacrum
Bump rust-installer

Makes generation of `manifest.in` deterministic:
https://github.com/rust-lang/rust-installer/pull/120
2023-02-08 07:13:26 +01:00
bors
7ba4e95368 Auto merge of #107778 - weihanglo:update-cargo, r=weihanglo
Update cargo

12 commits in e84a7928d93a31f284b497c214a2ece69b4d7719..82c3bb79e3a19a5164e33819ef81bfc2c984bc56 2023-01-31 22:18:09 +0000 to 2023-02-04 22:52:16 +0000

- util toml targets: Do not infer directory as a file (rust-lang/cargo#11678)
- Add more guidance on how to implement unstable features (rust-lang/cargo#11675)
- Fix unstable chapter layout for codegen-backend (rust-lang/cargo#11676)
- refactor: mod.rs over "name".rs for consistency (rust-lang/cargo#11673)
- Verify source before recompile (rust-lang/cargo#11672)
- doc: more doc comments and intra-doc links (rust-lang/cargo#11669)
- Turn off debuginfo for build dependencies v2 (rust-lang/cargo#11252)
- config: Deny CARGO_HOME in [env] table (fixes rust-lang/cargo#11590) (rust-lang/cargo#11644)
- Fix the wrong comment (rust-lang/cargo#11651)
- Add partial support for SSH known hosts markers (rust-lang/cargo#11635)
- Replace `winapi` with `windows-sys` crate. (rust-lang/cargo#11656)
- Handle .cargo-ok being truncated (rust-lang/cargo#11665)

r? `@ghost`
2023-02-08 04:04:58 +00:00
kadmin
15d4728cda Add de-init to destination place 2023-02-08 02:04:07 +00:00
bors
b082e80e20 Auto merge of #107688 - lukas-code:projection-with-lifetime, r=jackh726
ReErased regions are local

fix https://github.com/rust-lang/rust/issues/107678
fix https://github.com/rust-lang/rust/issues/107684
fix https://github.com/rust-lang/rust/issues/107686
fix https://github.com/rust-lang/rust/issues/107691
fix https://github.com/rust-lang/rust/issues/107730
2023-02-08 00:34:18 +00:00
Michael Goulet
03a8a4ff3e Replacing bound vars is actually instantiating a binder 2023-02-07 23:13:54 +00:00
Michael Goulet
6fdfdea8b1 Remove astconv usage in diagnostic 2023-02-07 23:08:25 +00:00
Weihang Lo
6f38fd5509
Update cargo
12 commits in e84a7928d93a31f284b497c214a2ece69b4d7719..82c3bb79e3a19a5164e33819ef81bfc2c984bc56
2023-01-31 22:18:09 +0000 to 2023-02-04 22:52:16 +0000

- util toml targets: Do not infer directory as a file (rust-lang/cargo#11678)
- Add more guidance on how to implement unstable features (rust-lang/cargo#11675)
- Fix unstable chapter layout for codegen-backend (rust-lang/cargo#11676)
- refactor: mod.rs over "name".rs for consistency (rust-lang/cargo#11673)
- Verify source before recompile (rust-lang/cargo#11672)
- doc: more doc comments and intra-doc links (rust-lang/cargo#11669)
- Turn off debuginfo for build dependencies v2 (rust-lang/cargo#11252)
- config: Deny CARGO_HOME in [env] table (fixes rust-lang/cargo#11590) (rust-lang/cargo#11644)
- Fix the wrong comment (rust-lang/cargo#11651)
- Add partial support for SSH known hosts markers (rust-lang/cargo#11635)
- Replace `winapi` with `windows-sys` crate. (rust-lang/cargo#11656)
- Handle .cargo-ok being truncated (rust-lang/cargo#11665)
2023-02-07 22:26:44 +00:00
Michael Goulet
7a4505900d Add ~const bounds trait bounds when using derive_const 2023-02-07 21:00:12 +00:00
Michael Goulet
56bf28d4f4 Expand const-if-const trait bounds correctly 2023-02-07 21:00:12 +00:00
bors
3f059f6046 Auto merge of #107768 - matthiaskrgr:rollup-9u4cal4, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #107719 (Remove `arena_cache` modifier from `upstream_monomorphizations_for`)
 - #107740 (Avoid locking the global context across the `after_expansion` callback)
 - #107746 (Split fn_ctxt/adjust_fulfillment_errors from fn_ctxt/checks)
 - #107749 (allow quick-edit convenience)
 - #107750 (make more readable)
 - #107755 (remove binder from query constraints)
 - #107756 (miri: fix ICE when running out of address space)
 - #107764 (llvm-16: Use Triple.h from new header location.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-07 20:58:20 +00:00
Danilo Bargen
4f36673e15 Docs: Fix format of headings in String::reserve 2023-02-07 21:32:28 +01:00
Mark Rousskov
8e2f57094f Clearly signal purpose of the yaml template 2023-02-07 14:31:38 -05:00
Esteban Küber
a7597a1526 Tweak ICE message
Modify main message to be more conversational and emit one fewer note.
2023-02-07 19:17:24 +00:00
Michael Goulet
2b70cbb8a5 Rename PointerSized to PointerLike 2023-02-07 19:05:53 +00:00
Michael Howell
8307fd7901 rustdoc: use a newline instead of <br> to format code headers
Since these elements now use `white-space: pre-wrap` since
784665d4ce, it's fine to use newlines
for formatting, which is smaller and a bit less complicated.
2023-02-07 11:23:25 -07:00
bors
bd39bbb4bb Auto merge of #107767 - matthiaskrgr:rollup-9m1qfso, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #100599 (Add compiler error E0523 long description and test)
 - #107471 (rustdoc: do not include empty default-settings tag in HTML)
 - #107555 (Modify existing bounds if they exist)
 - #107662 (Turn projections into copies in CopyProp.)
 - #107695 (Add test for Future inflating arg size to 3x )
 - #107700 (Run the tools builder on all PRs)
 - #107706 (Mark 'atomic_mut_ptr' methods const)
 - #107709 (Fix problem noticed in PR106859 with char -> u8 suggestion)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-07 17:19:47 +00:00
clubby789
eb18293cec Allow automatically creating vscode settings.json from bootstrap 2023-02-07 17:12:10 +00:00