Commit Graph

233140 Commits

Author SHA1 Message Date
XXIV
9adc6a49aa
remove unnecessary heap allocation 2023-09-01 05:22:22 +03:00
John Kåre Alsaker
90f5f94699 Use OnceLock for SingleCache 2023-09-01 03:11:51 +02:00
Gurinder Singh
19574d216a Return ident for ExprField and PatField HIR nodes 2023-09-01 06:36:02 +05:30
bors
2f5df8a94b Auto merge of #115366 - compiler-errors:associated-type-bound-implicit-lifetimes, r=jackh726
Capture lifetimes for associated type bounds destined to be lowered to opaques

Some associated type bounds get lowered to opaques, but they're not represented in the AST as opaques.

That means that we never collect lifetimes for them (`record_lifetime_params_for_impl_trait`) which are used currently for RPITITs, which capture all of their in-scope lifetimes[^1]. This means that the nested RPITITs that arise from some type like `impl Foo<Type: Bar>` (~> `impl Foo<Type = impl Bar>`) don't capture any lifetimes, leading to ICEs.

This PR makes sure we collect the lifetimes for associated type bounds as well, and make sure that they are set up correctly for opaque type lowering later.

Fixes #115360

[^1]: #114489
2023-08-31 21:13:54 +00:00
Ding Xiang Fei
67553e8a11
update tests that are ignored by debug 2023-09-01 04:01:54 +08:00
bors
91942134c6 Auto merge of #115389 - bvanjoi:fix-115380, r=petrochenkov
fix(resolve): update def if binding is warning ambiguity

Fixes #115380
2023-08-31 16:57:11 +00:00
Ralf Jung
efc759238d miri ABI check: fix handling of 1-ZST; don't accept sign differences 2023-08-31 17:27:23 +02:00
Ralf Jung
cbe8a05903 update abi_compat.rs 2023-08-31 17:27:23 +02:00
bors
4b71f03039 Auto merge of #115384 - lqd:default-universe-info, r=matthewjasper
Work around ICE in diagnostics for local super-universes missing `UniverseInfo`s

In issue #114907, canonicalization of liveness dropck-outlives results (IIUC) encounters universes absent from the original query.  Some local universes [are created](f3a1bae88c/compiler/rustc_infer/src/infer/canonical/query_response.rs (L417-L425)) for the mapping, but importantly, they won't have associated causes.

These missing `UniverseInfo`s can be [needed](f3a1bae88c/compiler/rustc_borrowck/src/diagnostics/region_errors.rs (L376)) during diagnostics, [causing the `IndexMap: key not found` ICE](d55522aad8/compiler/rustc_borrowck/src/region_infer/mod.rs (L2252)) seen in the issue.

This PR works around this by returning the suboptimal catch-all cause, to avoid the ICE. It does results in suboptimal diagnostics right now, but it's better than an ICE.

r? `@matthewjasper.`

Let me know if there's a good easy-ish way to fix this, but I believe that for some of these erroneous cases and diagnostics, that inference/canonicalization/higher-ranked subtyping/etc may not behave exactly the same with the new trait solver? If that's the case then it'd probably be best to wait a bit more to do the correct fix.

Fixes #114907.

cc `@aliemjay`
2023-08-31 15:13:05 +00:00
Ralf Jung
270f777a30 bootstrap: use git merge-base for LLVM CI download logic 2023-08-31 15:45:15 +02:00
bors
b30b535124 Auto merge of #115408 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2023-08-31 13:01:59 +00:00
bohan
107152141b fix(resolve): update def if binding is warning ambiguity 2023-08-31 20:00:04 +08:00
Rémy Rakic
10ef8d9bf7 remove dummy UniverseInfo causes from type checker fully_perform_op
This was backfilling causes for new universes that may have been created
by an op, when there was no error info to use for improved
diagnostics. We don't need to do that anymore: `other()` is the default when
there is no registered universe cause.
2023-08-31 11:41:58 +00:00
bors
873a7a384f Auto merge of #3046 - RalfJung:rustup, r=RalfJung
Rustup

also more ABI compat tests
2023-08-31 11:22:30 +00:00
Ralf Jung
c2b0ca75aa more ABI compat tests 2023-08-31 13:21:55 +02:00
bors
784916ce24 Auto merge of #115290 - compiler-errors:ctor-unsafe, r=cjgillot
`rustc_layout_scalar_valid_range` makes ctors unsafe

We already validate this when we use the ctor in a call, e.g. `Variant(1)`, but not if we use the ctor as a fn ptr, e.g. `.map(Variant)`. The easiest way to fix the latter is (afaict) is by marking the ctor as unsafe itself.

Fixes #115284
2023-08-31 11:16:37 +00:00
Rémy Rakic
ae963b560f remove dummy UniverseInfo causes from type checker type_check
This was pre-filling causes for universes that could already exist in
the InferCtxt. We don't need to do that anymore: `other()` is the default when
there is no registered universe cause.
2023-08-31 11:16:35 +00:00
Rémy Rakic
407695132c remove dummy UniverseInfo causes from type checker instantiate_canonical_with_fresh_inference_vars
This was backfilling causes for the new universes that can be created by
the InferCtxt. We don't need to do that anymore: `other()` is the default when
there is no registered universe cause.
2023-08-31 11:10:54 +00:00
Ralf Jung
9db09c571f fmt 2023-08-31 11:34:43 +02:00
Ralf Jung
2de09d8ae4 Merge from rustc 2023-08-31 11:34:36 +02:00
Ralf Jung
4ea6a4bfe3 Preparing for merge from rustc 2023-08-31 11:32:11 +02:00
bors
2bd81316f2 Auto merge of #115346 - oli-obk:smir_const, r=spastorino
Some SMIR Const cleanups

Only e1def3bd41b021ce87a5d639b10cdf4a7df1d0b5 is new logic, everywhere else I just used the implementations that y'all had already written.

r? `@spastorino`

cc `@ouz-a`
2023-08-31 09:30:58 +00:00
bors
dca2d1ff00 Auto merge of #115374 - RalfJung:miri-fn-abi, r=oli-obk
miri function ABI check: accept repr(transparent) wrappers as compatible
2023-08-31 07:43:23 +00:00
bors
6f03674342 Auto merge of #3045 - RalfJung:tier1-ci, r=RalfJung
make sure we test all tier 1 targets

i686-pc-windows-gnu was missing (and i686-pc-windows-msvc was being tested twice, as host and foreign target).
2023-08-31 07:23:55 +00:00
Ralf Jung
d86be8d32e make sure we test all tier 1 targets: i686-pc-windows-gnu was missing 2023-08-31 09:21:12 +02:00
bors
2518c0ffeb Auto merge of #3044 - rust-lang:rustup-2023-08-31, r=RalfJung
Automatic sync from rustc
2023-08-31 06:20:39 +00:00
bors
8cbd2c847b Auto merge of #115398 - matthiaskrgr:rollup-88lj9gk, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #115373 (Fix bors missing a commit when merging #115355)
 - #115378 (`ignore-cross-compile` remaining tests that run binaries)
 - #115393 (Make `termcolor` types public in `rustc_errors`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-31 06:02:49 +00:00
Matthias Krüger
82675f6a39
Rollup merge of #115393 - LegNeato:patch-1, r=oli-obk
Make `termcolor` types public in `rustc_errors`

After https://github.com/rust-lang/rust/pull/114104, `rust-gpu` is unable to create a custom `Emitter` as the bounds have changed to include `WriteColor`.

I was able to work around this by adding `termcolor` as a direct dependency, but I believe this should be exposed as part of `rustc_errors` proper.

See https://github.com/rust-lang/rust/pull/102992 for why `rust-gpu` needs to create a custom emitter.
2023-08-31 07:52:44 +02:00
Matthias Krüger
a0d2cb0e0e
Rollup merge of #115378 - ferrocene:ignore-cross-compile, r=lqd
`ignore-cross-compile` remaining tests that run binaries

Follow up to https://github.com/rust-lang/rust/pull/114958
2023-08-31 07:52:43 +02:00
Matthias Krüger
0b62835043
Rollup merge of #115373 - lqd:come-on-bors, r=compiler-errors
Fix bors missing a commit when merging #115355

bors incorrectly merged an outdated version of PR #115355 (via rollup #115370):
- it [recorded r+](https://github.com/rust-lang/rust/pull/115355#issuecomment-1698372365) as approving commit 325b585259, and thus merged the original revision 7762ac7bb5
- but the branch at the time was at commit eefa07d69b, so bors missed the `compiler/rustc_trait_selection/src/solve/search_graph/mod.rs` cleanup in commit 0e1e964a34 😓

Thankfully the change that bors missed was small, and this new PR corrects the situation (as I'd rather avoid having confusing multiple merge commits of PR #115355 in the git history)

r? ``@compiler-errors``
2023-08-31 07:52:43 +02:00
The Miri Conjob Bot
f57b41519d fmt 2023-08-31 05:42:55 +00:00
The Miri Conjob Bot
31d9ac14f5 Merge from rustc 2023-08-31 05:40:49 +00:00
The Miri Conjob Bot
4b915b8a86 Preparing for merge from rustc 2023-08-31 05:34:07 +00:00
bors
008c21c977 Auto merge of #115323 - onur-ozkan:curl-download-checksum-fix, r=Mark-Simulacrum
avoid stdout redirection on `curl` executions

Avoid redirecting the curl output directly to the stdout. This alteration affects the integrity of the file during the retry process, as it also redirects the logs from the retries. Consequently, this leads to the bootstrap process failing because of an invalid checksum.

For more information, see the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/checksum.20errors)

Fixes #115275
2023-08-31 02:19:55 +00:00
bors
e51c5ea16f Auto merge of #115392 - compiler-errors:coherence-spans, r=aliemjay
Don't record spans for predicates in coherence

Should improve perf (https://github.com/rust-lang/rust/pull/115107#issuecomment-1695090589) for https://github.com/rust-lang/rust/pull/114023#issuecomment-1688514709

r? aliemjay
2023-08-31 00:34:04 +00:00
bors
b1b244da65 Auto merge of #115194 - tmiasko:inline-always-encode-mir, r=compiler-errors
Fix inlining with -Zalways-encode-mir

Only inline functions that are considered eligible for inlining
by the reachability pass.

This constraint was previously indirectly enforced by only exporting MIR
of eligible functions, but that approach doesn't work with
-Zalways-encode-mir enabled.
2023-08-30 22:51:12 +00:00
Michael Goulet
bf66723c0e Test and note unsafe ctor to fn ptr coercion
Also remove a note that I don't consider to be very useful in context.
2023-08-30 15:09:40 -07:00
Michael Goulet
0100a94231 rustc_layout_scalar_valid_range makes ctors unsafe 2023-08-30 15:01:58 -07:00
Christian Legnitto
da86cdf3a5
Make termcolor types public in rustc_errors
After https://github.com/rust-lang/rust/pull/114104, `rust-gpu` is unable to create a custom `Emitter` as the bounds have changed to include `WriteColor`.

I was able to work around this by adding `termcolor` as a direct dependency, but I believe this should be exposed as part of `rustc_errors` proper.

See https://github.com/rust-lang/rust/pull/102992 for why `rust-gpu` needs to create a custom emitter.
2023-08-30 16:06:49 -04:00
bors
59a8294849 Auto merge of #115144 - Zoxc:parallel-guard, r=compiler-errors
Add `ParallelGuard` type to handle unwinding in parallel sections

This adds a `ParallelGuard` type to handle unwinding in parallel sections instead of manually dealing with panics in each parallel operation. This also adds proper panic handling to the `join` operation.

cc `@SparrowLii`
2023-08-30 19:33:13 +00:00
Michael Goulet
4647aea7aa Don't record spans for predicates in coherence 2023-08-30 18:24:18 +00:00
bors
8c79e8d756 Auto merge of #115058 - Swatinem:inline-add-coverage, r=compiler-errors
Inline functions called from `add_coverage`

This removes quite a bit of indirection and duplicated code related to getting the `FunctionCoverage`.

CC `@Zalathar`
2023-08-30 17:43:38 +00:00
John Kåre Alsaker
c303c8abdd Use a parallel_guard function to handle the parallel guard 2023-08-30 18:17:38 +02:00
John Kåre Alsaker
d36393b839 Use Mutex to avoid issue with conditional locks 2023-08-30 18:17:38 +02:00
John Kåre Alsaker
242805442b Update failure status 2023-08-30 18:13:09 +02:00
John Kåre Alsaker
b56acac41d Add ParallelGuard type to handle unwinding in parallel sections 2023-08-30 18:13:06 +02:00
John Kåre Alsaker
51eb8427bf Make parallel! an expression 2023-08-30 18:12:18 +02:00
bors
ac02e40380 Auto merge of #114616 - oli-obk:gotta_capture_'em_all, r=compiler-errors
Capture all lifetimes for TAITs and impl trait in associated types

This reverts commit cb9467515b, reversing changes made to 57781b24c5. (This is only true for the tests, the change itself was done from scratch, as the compiler has diverged sufficiently for a revert to not make sense anymore).

This implements the lang team decision from this meeting: https://hackmd.io/sFaSIMJOQcuwCdnUvCxtuQ?view

r? `@cjgillot` on the impl
2023-08-30 15:57:26 +00:00
Ralf Jung
c37bd09d88 miri function ABI check: specifically look for repr(transparent) 2023-08-30 17:07:25 +02:00
Ralf Jung
c1a34729e1 organize failing ABI compat tests and add some more 2023-08-30 17:04:54 +02:00