Commit Graph

241933 Commits

Author SHA1 Message Date
bors
f736079c3c Auto merge of #119278 - bjorn3:sync_cg_clif-2023-12-24, r=bjorn3
Subtree sync for rustc_codegen_cranelift

This implements simd_masked_store and fixes two borked subtree syncs that forgot to sync back some changes to the rust repo.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-12-24 16:38:28 +00:00
bors
1a086e49f1 Auto merge of #118796 - Nadrieril:fix-exponential-id-match-2, r=cjgillot
Exhaustiveness: Improve complexity on some wide matches

https://github.com/rust-lang/rust/issues/118437 revealed an exponential case in exhaustiveness checking. While [exponential cases are unavoidable](https://compilercrim.es/rust-np/), this one only showed up after my https://github.com/rust-lang/rust/pull/117611 rewrite of the algorithm. I remember anticipating a case like this and dismissing it as unrealistic, but here we are :').

The tricky match is as follows:
```rust
match command {
    BaseCommand { field01: true, .. } => {}
    BaseCommand { field02: true, .. } => {}
    BaseCommand { field03: true, .. } => {}
    BaseCommand { field04: true, .. } => {}
    BaseCommand { field05: true, .. } => {}
    BaseCommand { field06: true, .. } => {}
    BaseCommand { field07: true, .. } => {}
    BaseCommand { field08: true, .. } => {}
    BaseCommand { field09: true, .. } => {}
    BaseCommand { field10: true, .. } => {}
    // ...20 more of the same

    _ => {}
}
```

To fix this, this PR formalizes a concept of "relevancy" (naming is hard) that was already used to decide what patterns to report. Now we track it for every row, which in wide matches like the above can drastically cut on the number of cases we explore. After this fix, the above match is checked with linear-many cases instead of exponentially-many.

Fixes https://github.com/rust-lang/rust/issues/118437

r? `@cjgillot`
2023-12-24 14:40:36 +00:00
bjorn3
bc1f3f5222 Fix borked subtree syncs 2023-12-24 14:38:37 +00:00
bjorn3
4b854efc9c Merge commit '26c02eb2904da9a53d2220d4f3069b19a3c81d3d' into sync_cg_clif-2023-12-24 2023-12-24 14:35:19 +00:00
bjorn3
26c02eb290 Rustup to rustc 1.77.0-nightly (2d7be7393 2023-12-23) 2023-12-24 14:26:46 +00:00
bjorn3
23e26ca386 Sync from rust 2d7be73931 2023-12-24 14:20:28 +00:00
bors
ebb821f625 Auto merge of #119265 - Mark-Simulacrum:remove-cache, r=cjgillot
Remove metadata decoding DefPathHash cache

My expectation is that this cache is largely useless. Decoding a DefPathHash from metadata is essentially a pair of memory loads - there's no heavyweight processing involved. Caching it behind a HashMap just adds extra cost and incurs hashing overheads for the indices.

Based on https://github.com/rust-lang/rust/pull/119238.
2023-12-24 12:41:58 +00:00
bors
08cc634f1a Auto merge of #117176 - bvanjoi:fix-116796, r=jackh726
mark ty::Const::Error when meet unsupport ty for const generic params

Close #116796
2023-12-24 10:28:25 +00:00
bors
cf6427373b Auto merge of #119238 - Mark-Simulacrum:def-hash-efficiency, r=cjgillot
Skip duplicate stable crate ID encoding into metadata

Instead, we store just the local crate hash as a bare u64. On decoding,
we recombine it with the crate's stable crate ID stored separately in
metadata. The end result is that we save ~8 bytes/DefIndex in metadata
size.

One key detail here is that we no longer distinguish in encoded metadata
between present and non-present DefPathHashes. It used to be highly
likely we could distinguish as we used DefPathHash::default(), an
all-zero representation. However in theory even that is fallible as
nothing strictly prevents the StableCrateId from being zero. In review it
was pointed out that we should never have a missing hash for a DefIndex anyway,
so this shouldn't matter.
2023-12-24 07:56:37 +00:00
bors
3166bbef92 Auto merge of #119268 - matthiaskrgr:rollup-7ggmcdn, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #119165 (improve container runner script)
 - #119205 (fix minor mistake in comments describing VecDeque resizing)
 - #119257 (interpret/memory: explain why we check is_thread_local_static)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-24 00:58:42 +00:00
Matthias Krüger
511eb0ae9b
Rollup merge of #119257 - RalfJung:tls-comments, r=petrochenkov
interpret/memory: explain why we check is_thread_local_static
2023-12-24 01:08:09 +01:00
Matthias Krüger
89c3236789
Rollup merge of #119205 - mumbleskates:vecdeque-comment-fix, r=Mark-Simulacrum
fix minor mistake in comments describing VecDeque resizing

Avoiding confusion where one of the items in the deque seems to disappear in two of the three cases
2023-12-24 01:08:09 +01:00
Matthias Krüger
09131a2e31
Rollup merge of #119165 - onur-ozkan:update-container-entrypoint, r=Kobzol
improve container runner script

First commit fixes #118930

Second commit is mostly for development purposes. In read-only mode submodules cannot be initialized due to access limitations (see the log below), which means that tools cannot be built.

```sh
Updating submodule src/tools/cargo
error: could not lock config file .git/config: Read-only file system
error: could not lock config file .git/config: Read-only file system
fatal: Failed to register url for submodule path 'src/tools/cargo'
error: could not lock config file .git/config: Read-only file system
error: could not lock config file .git/config: Read-only file system
fatal: Failed to register url for submodule path 'src/tools/cargo'
Build completed unsuccessfully in 0:00:00

```
2023-12-24 01:08:08 +01:00
bors
cdd6374f16 Auto merge of #119218 - Nadrieril:nested-opaque-reveal, r=compiler-errors
Exhaustiveness: Reveal empty opaques in depth

Follow-up to https://github.com/rust-lang/rust/pull/116821. As noted [there](https://github.com/rust-lang/rust/pull/116821#discussion_r1376673420), the current implementation doesn't detect emptiness of opaques when the opaque is nested inside a type. This doesn't matter for stable behavior (which ignores nested empty types anyway) but does matter for the [`exhaustive_patterns`](https://github.com/rust-lang/rust/issues/51085)/[`min_exhaustive_patterns`](https://github.com/rust-lang/rust/pull/118803) features.

This PR fixes this behavior by adding `InhabitedPredicate::apply_reveal_opaque` that considers opaque types when determining inhabitedness.

r? `@compiler-errors`
2023-12-23 23:00:08 +00:00
onur-ozkan
b498489c13 allow devs to turn-off read-only mode
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-24 00:58:46 +03:00
Nadrieril
efb04e6572 Rework the explanation of relevancy 2023-12-23 22:43:06 +01:00
bors
2d7be73931 Auto merge of #119263 - matthiaskrgr:rollup-zxok9fb, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #112936 (Add illumos aarch64 target for rust.)
 - #119153 (stabilize `file_create_new`)
 - #119246 ([rustdoc] Add `is_object_safe` information for traits in JSON output)
 - #119254 (Remove an unused diagnostic struct)
 - #119255 (add a test for ICE #112822)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-23 20:39:47 +00:00
Mark Rousskov
f098f346ec Remove metadata decoding DefPathHash cache
This cache is largely useless. Decoding a DefPathHash from metadata is
essentially a pair of memory loads - there's no heavyweight processing
involved. Caching it behind a HashMap just adds extra cost and incurs
hashing overheads.
2023-12-23 14:22:36 -05:00
Mark Rousskov
6630d69085 Specialize DefPathHash table to skip crate IDs
Instead, we store just the local crate hash as a bare u64. On decoding,
we recombine it with the crate's stable crate ID stored separately in
metadata. The end result is that we save ~8 bytes/DefIndex in metadata
size.

One key detail here is that we no longer distinguish in encoded metadata
between present and non-present DefPathHashes. It used to be highly
likely we could distinguish as we used DefPathHash::default(), an
all-zero representation. However in theory even that is fallible as
nothing strictly prevents the StableCrateId from being zero.
2023-12-23 14:10:28 -05:00
Matthias Krüger
aa2e5fadd8
Rollup merge of #119255 - fee1-dead-contrib:fix-ice, r=compiler-errors
add a test for ICE #112822

closes #112822.
2023-12-23 20:02:29 +01:00
Matthias Krüger
63290a90d3
Rollup merge of #119254 - fee1-dead-contrib:randomfix, r=compiler-errors
Remove an unused diagnostic struct

this is used at `rustc_middle::error`, is duplicated here somehow
2023-12-23 20:02:29 +01:00
Matthias Krüger
81161a6013
Rollup merge of #119246 - GuillaumeGomez:trait-is_object_safe-json, r=aDotInTheVoid
[rustdoc] Add `is_object_safe` information for traits in JSON output

As asked by `@obi1kenobi` [here](https://github.com/rust-lang/rust/pull/113241#issuecomment-1868213677).

cc `@aDotInTheVoid`
r? `@notriddle`
2023-12-23 20:02:28 +01:00
Matthias Krüger
b136919ca6
Rollup merge of #119153 - rursprung:stabilize-file_create_new, r=dtolnay
stabilize `file_create_new`

closes #105135
2023-12-23 20:02:28 +01:00
Matthias Krüger
54592473c1
Rollup merge of #112936 - Toasterson:illumos-aarch64-target, r=jackh726
Add illumos aarch64 target for rust.

This adds the newly being developed illumos aarch64 target to the rust compiler.

`@rmustacc` `@citrus-it` `@richlowe` As promissed before my hiatus :)
2023-12-23 20:02:27 +01:00
bors
520e30be83 Auto merge of #119225 - Mark-Simulacrum:remove-option, r=compiler-errors
Avoid redundant Option for cross_crate_inlinable
2023-12-23 18:37:40 +00:00
Guillaume Gomez
431ac40a93 Add regression test for is_object_safe field on traits 2023-12-23 19:00:17 +01:00
bohan
0f814e3899 add test for #116796 2023-12-24 01:58:13 +08:00
Ralf Jung
c83bcbbad9 interpret/memory: explain why we check is_thread_local_static 2023-12-23 16:48:29 +01:00
bors
5eccfc388e Auto merge of #119256 - matthiaskrgr:rollup-q0q5c1d, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #119231 (Clairify `ast::PatKind::Struct` presese of `..` by using an enum instead of a bool)
 - #119232 (Fix doc typos)
 - #119245 (Improve documentation for using warning blocks in documentation)
 - #119248 (remove dead inferred outlives testing code)
 - #119249 (Add spastorino to users_on_vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-23 15:33:34 +00:00
Matthias Krüger
2e09941bd7
Rollup merge of #119249 - spastorino:add-spastorino-to-vacation, r=Nilstrieb
Add spastorino to users_on_vacation
2023-12-23 16:23:56 +01:00
Matthias Krüger
66f46655c3
Rollup merge of #119248 - lukas-code:purge-unused-outlives-test, r=cjgillot
remove dead inferred outlives testing code

The `test_inferred_outlives` function was never run, because the code that's actually used for the tests was part of the `inferred_outlives_of` query, which ran before `test_inferred_outlives` during type collecting. This PR separates the test code from the query and moves it inside the dedicated function.
2023-12-23 16:23:56 +01:00
Matthias Krüger
a46ce0060a
Rollup merge of #119245 - GuillaumeGomez:improve-docs, r=fmease
Improve documentation for using warning blocks in documentation

From [this comment](https://github.com/rust-lang/rust/issues/79710#issuecomment-1868225357), I think markdown can be surprising sometimes so better explain a bit better how to use it correctly.

r? `@notriddle`
2023-12-23 16:23:55 +01:00
Matthias Krüger
ea55fd8c7f
Rollup merge of #119232 - Takashiidobe:fix-doc-typos, r=JohnTitor
Fix doc typos

This PR fixes some typos I found while trawling through the rust source.
2023-12-23 16:23:55 +01:00
Matthias Krüger
bdc4480914
Rollup merge of #119231 - aDotInTheVoid:PatKind-struct-bool-docs, r=compiler-errors
Clairify `ast::PatKind::Struct` presese of `..` by using an enum instead of a bool

The bool is mainly used for when a `..` is present, but it is also set on recovery to avoid errors. The doc comment not describes both of these cases.

See cee794ee98/compiler/rustc_parse/src/parser/pat.rs (L890-L897) for the only place this is constructed.

r? ``@compiler-errors``
2023-12-23 16:23:54 +01:00
Deadbeef
3006814404 add a test for ICE #112822 2023-12-23 15:09:55 +00:00
Deadbeef
69f26bf7d7 Remove an unused diagnostic struct
this is used at `rustc_middle::error`, is duplicated here somehow
2023-12-23 15:02:03 +00:00
Nadrieril
34307ab7c5 Reveal empty opaques in depth 2023-12-23 14:59:12 +01:00
Lukas Markeffsky
49103dc553 move rustc_outlives test code from query to dedicated function 2023-12-23 13:59:10 +01:00
Santiago Pastorino
8a7513d5af
Add spastorino to users_on_vacation 2023-12-23 09:57:06 -03:00
bors
edcbcc768a Auto merge of #119072 - fee1-dead-contrib:effects-fixes, r=compiler-errors
Clean up `check_consts` and misc fixes

1. Remove most of the logic around erroring with trait methods. I have kept the part resolving it to a concrete impl, as that is used for const stability checks.
2. Turning on `effects` causes ICE with generic args, due to `~const Tr` when `Tr` is not `#[const_trait]` tripping up expectation in code that handles generic args, more specifically here:
8681e077b8/compiler/rustc_hir_analysis/src/astconv/generics.rs (L377)

We set `arg_count.correct` to `Err` to correctly signal that an error has already been reported.

3. UI test blesses.

Edit(fmease): Fixes #117244 (UI test is in #119099 for now).

r? compiler-errors
2023-12-23 12:26:22 +00:00
Nadrieril
71e83347bb Improve performance on wide matches 2023-12-23 13:11:38 +01:00
Guillaume Gomez
c29f763153 Add is_object_safe information for traits in JSON output 2023-12-23 11:43:31 +01:00
Guillaume Gomez
0fd3be948a Strenghten tests/rustdoc/trait-object-safe.rs to prevent unforeseen regression 2023-12-23 11:28:33 +01:00
Guillaume Gomez
ca2f8da5f1 Improve documentation for using warning blocks in documentation 2023-12-23 11:15:00 +01:00
bors
c03d978a4b Auto merge of #119237 - compiler-errors:rollup-umyyu7d, r=compiler-errors
Rollup of 6 pull requests

Successful merges:

 - #119012 (Extract `layout_of_{struct,enum}` fn)
 - #119077 (Separate MIR lints from validation)
 - #119171 (Cleanup error handlers: round 4)
 - #119198 (Split coroutine desugaring kind from source)
 - #119222 (Add `IntoAsyncIterator`)
 - #119230 (Exhaustiveness: clean up after librarification)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-23 04:09:45 +00:00
Alona Enraght-Moony
1349d86c72 bool->enum for ast::PatKind::Struct presence of ..
See cee794ee98/compiler/rustc_parse/src/parser/pat.rs (L890-L897) for the only place this is constructed.
2023-12-23 02:50:31 +00:00
Michael Goulet
8c50e3eaee
Rollup merge of #119230 - Nadrieril:librarify-even-further, r=compiler-errors
Exhaustiveness: clean up after librarification

This cleans up some things that weren't done nicely by https://github.com/rust-lang/rust/pull/118842.

r? `@compiler-errors`
2023-12-22 21:41:05 -05:00
Michael Goulet
eef023c806
Rollup merge of #119222 - eholk:into-async-iterator, r=compiler-errors,dtolnay
Add `IntoAsyncIterator`

This introduces the `IntoAsyncIterator` trait and uses it in the desugaring of the unstable `for await` loop syntax. This is mostly added for symmetry with `Iterator` and `IntoIterator`.

r? `@compiler-errors`

cc `@rust-lang/libs-api,` `@rust-lang/wg-async`
2023-12-22 21:41:04 -05:00
Michael Goulet
ae0a6e8537
Rollup merge of #119198 - compiler-errors:desugaring, r=eholk
Split coroutine desugaring kind from source

What a coroutine is desugared from (gen/async gen/async) should be separate from where it comes (fn/block/closure).
2023-12-22 21:41:04 -05:00
Michael Goulet
bfda19d5bd Rollup merge of #119171 - nnethercote:cleanup-errors-4, r=compiler-errors
Cleanup error handlers: round 4

More `rustc_errors` cleanups. A sequel to #118933.

r? `@compiler-errors`
2023-12-22 21:41:03 -05:00