Commit Graph

242026 Commits

Author SHA1 Message Date
lch361
b15e13760a Removed redundant bounds checking at Split's next and next_mut methods 2023-12-25 01:34:07 +03:00
bors
bf8716f1cd Auto merge of #119139 - michaelwoerister:cleanup-stable-source-file-id, r=cjgillot
Unify SourceFile::name_hash and StableSourceFileId

This PR adapts the existing `StableSourceFileId` type so that it can be used instead of the `name_hash` field of `SourceFile`. This simplifies a few things that were kind of duplicated before.

The PR should also fix issues https://github.com/rust-lang/rust/issues/112700 and https://github.com/rust-lang/rust/issues/115835, but I was not able to reproduce these issues in a regression test. As far as I can tell, the root cause of these issues is that the id of the originating crate is not hashed in the `HashStable` impl of `Span` and thus cache entries that should have been considered invalidated were loaded. After this PR, the `stable_id` field of `SourceFile` includes information about the originating crate, so that ICE should not occur anymore.
2023-12-24 21:58:39 +00:00
jyn
cb6d033316 don't elide shared parts of types in diagnostics when --verbose is passed
this also changes some parts of lifetime printing, which previously were not gated behind `-Z verbose`
2023-12-24 16:47:18 -05:00
bors
e87ccb8676 Auto merge of #119276 - faern:stabilize-ip_in_core, r=dtolnay
Stabilize ip_in_core feature

Finally the last stage of https://github.com/rust-lang/rfcs/pull/2832. Since the FCP was [just completed with disposition *merge*](https://github.com/rust-lang/rust/issues/108443#issuecomment-1867864920), I create the stabilization PR for the `ip_in_core` feature. Allowing usage of `core::net` on stable Rust.

The error type `core::net::AddrParseError` itself becomes stable with this PR. However, `core::error::Error` is still unstable, so the `Error` impl for this type is not available on stable rust. Simply because `error_in_core` is not stable yet, but that should be fine!
2023-12-24 20:00:53 +00:00
Guillaume Gomez
98b71bf345 Add GUI regression test for position of warning block 2023-12-24 19:24:04 +01:00
Guillaume Gomez
279b11c4b5 Fix display of warning block if it is first element of the top doc block 2023-12-24 19:23:42 +01:00
Guillaume Gomez
2378227d73 Update browser-ui-test version to 0.16.11 2023-12-24 19:23:27 +01:00
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
Linus Färnstrand
98899b7131 Stabilize ip_in_core feature 2023-12-24 12:23:50 +01: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
Ralf Jung
41020d1337 fix ICE when using raw ptr in a pattern 2023-12-24 11:10:38 +01: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
1754946b3e Auto merge of #3238 - rust-lang:rustup-2023-12-24, r=saethlin
Automatic Rustup
2023-12-24 05:19:43 +00:00
The Miri Conjob Bot
29f25ee3f3 Merge from rustc 2023-12-24 05:00:43 +00:00
The Miri Conjob Bot
f3db65df94 Preparing for merge from rustc 2023-12-24 04:54:07 +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
Nicholas Nethercote
8a9db25459 Remove more Session methods that duplicate DiagCtxt methods. 2023-12-24 08:17:47 +11:00
Nicholas Nethercote
8af3d8dcab Remove MirBorrowckCtxt methods that duplicate DiagCtxt methods. 2023-12-24 08:17:46 +11:00
Nicholas Nethercote
99472c7049 Remove Session methods that duplicate DiagCtxt methods.
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
2023-12-24 08:05:28 +11:00
Nicholas Nethercote
d51db05d7e Remove ParseSess methods that duplicate DiagCtxt methods.
Also add missing `#[track_caller]` attributes to `DiagCtxt` methods as
necessary to keep tests working.
2023-12-24 07:59:21 +11:00
Nicholas Nethercote
ec9af0d6cb Remove Parser methods that duplicate DiagCtxt methods. 2023-12-24 07:48:47 +11: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
Nicholas Nethercote
d86a48278f Remove ExtCtxt methods that duplicate DiagCtxt methods. 2023-12-24 07:24:52 +11: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
Camille GILLOT
af5f7b3b6b Do not fetch HIR in inferred_outlives_of. 2023-12-23 18:13:41 +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