Commit Graph

241927 Commits

Author SHA1 Message Date
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
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
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
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
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
Michael Goulet
e0d7a72c46
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
Michael Goulet
7dd095598b
Rollup merge of #119077 - tmiasko:lint, r=cjgillot
Separate MIR lints from validation

Add a MIR lint pass, enabled with -Zlint-mir, which identifies undefined or
likely erroneous behaviour.

The initial implementation mostly migrates existing checks of this nature from
MIR validator, where they did not belong (those checks have false positives and
there is nothing inherently invalid about MIR with undefined behaviour).

Fixes #104736
Fixes #104843
Fixes #116079
Fixes #116736
Fixes #118990
2023-12-22 21:41:03 -05:00
Michael Goulet
aaff415322
Rollup merge of #119012 - workingjubilee:extract-enum-layout-fn, r=b-naber
Extract `layout_of_{struct,enum}` fn

While writing #118974 I noticed it was annoying to navigate a huge, several hundred line function, which handles many subcases, and make confident declarations about what part of the flow of execution the compiler would be in. To help with that, this breaks out `layout_of_struct_or_enum`'s fundamental logic into a pair of functions, one for each case. It changes essentially none of that logic, merely moves it around.

Because "the layout of an ADT" feels like a somewhat nebulous subject, I chose to deliberately avoid any expansions to LayoutCalculator's public API, though such does feel like a possible logical next step. There are, indeed, many logical next steps. I'm not taking any of them here, yet, because this comparatively tiny refactor is a prerequisite for all of them.
2023-12-22 21:41:02 -05:00
Nicholas Nethercote
b94a2a1991 Rename EarlyDiagCtxt methods to match DiagCtxt.
- `early_error_no_abort` -> `early_err`
- `early_error` -> `early_fatal`
- `early_struct_error` -> `early_struct_fatal`
2023-12-23 13:23:28 +11:00
Nicholas Nethercote
2cd14bc939 Remove DiagnosticBuilder::forget_guarantee.
It's unused. And this means `DiagnosticBuilderInner` no longer needs to
be separate from `DiagnosticBuilder`.
2023-12-23 13:23:28 +11:00
Nicholas Nethercote
00e8485057 Remove all uses of DiagnosticBuilder::forget_guarantee().
There are only three. It's simpler to make the type
`DiagnosticBuilder<'_, ()>` from the start, no matter the level, than to
change the guarantee later.
2023-12-23 13:23:28 +11:00