Commit graph

232353 commits

Author SHA1 Message Date
Michael Goulet
cadecc207d Make ICE backtrace actually match the panic handler
(cherry picked from commit b59480784d)
2023-09-21 16:18:16 -07:00
Michael Goulet
5d064f2b1b Don't modify libstd to dump rustc ICEs
(cherry picked from commit 8ad2379407)
2023-09-21 16:18:16 -07:00
Georgii Rylov
dba7025135 MCP661: Move wasm32-wasi-preview1-threads to Tier2
(cherry picked from commit ac76882bf3)
2023-09-21 16:17:50 -07:00
Georgii Rylov
339665e750 address comments
(cherry picked from commit 9b00e5f06f)
2023-09-21 16:11:42 -07:00
Georgii Rylov
7a2e8ddfb8 Fix a pthread_t handle leak #114610
(cherry picked from commit 42a708083a)
2023-09-21 16:11:42 -07:00
bors
9b95397915 Auto merge of #115901 - Mark-Simulacrum:beta-backport, r=Mark-Simulacrum
[beta] backport

This PR backports:

- #115785: Only suggest turbofish in patterns if we may recover
- #115527: Don't require `Drop` for `[PhantomData<T>; N]` where `N` and `T` are generic, if `T` requires `Drop`
- #115389: fix(resolve): update def if binding is warning ambiguity
- #115215: Remove assert that checks type equality

r? `@Mark-Simulacrum`
2023-09-17 03:35:18 +00:00
ouz-a
028f3407af Remove assert that checks type equality 2023-09-16 17:55:08 -04:00
bohan
82f6044d45 fix(resolve): update def if binding is warning ambiguity 2023-09-16 17:55:01 -04:00
Oli Scherer
9a545c58b4 Don't require Drop for [PhantomData<T>; N] where N and T are generic, if T requires Drop 2023-09-16 17:54:55 -04:00
León Orell Valerian Liehr
f11aa34f39 Only suggest turbofish in patterns if we may recover 2023-09-16 17:54:48 -04:00
bors
ea9959354a Auto merge of #115722 - Mark-Simulacrum:beta-backport, r=Mark-Simulacrum
[beta] backport

This PR backports:
- #115559: implied bounds: do not ICE on unconstrained region vars
- #115446: fix version for abi_thiscall to 1.73.0, which was forgotten to change when stabilized and (later) moved to beta
- #115276: rustdoc: correctly deal with self ty params when eliding default object lifetimes

r? `@Mark-Simulacrum`
2023-09-09 23:34:51 +00:00
León Orell Valerian Liehr
309468c30d rustdoc: correctly deal with self ty params when eliding default object lifetimes 2023-09-09 19:04:20 -04:00
klensy
c08cfb814b fix version for abi_thiscall to 1.73.0, which was forgotten to change when stabilized 2023-09-09 19:04:07 -04:00
lcnr
c14b2b69b9 unconstrained region vars: do not ICE ICE baby 2023-09-09 19:03:56 -04:00
bors
9f37cd4f79 Auto merge of #115442 - cuviper:beta-next, r=cuviper
[beta] backports

- Contents of reachable statics is reachable #115114
- Revert "Suggest using `Arc` on `!Send`/`!Sync` types" #115311
- Stop emitting non-power-of-two vectors in (non-portable-SIMD) codegen #115236
- Do not forget to pass DWARF fragment information to LLVM. #115139
- rustdoc: use unicode-aware checks for redundant explicit link fastpath #115070

r? cuviper
2023-09-01 17:46:33 +00:00
Michael Howell
20ddd452b8 rustdoc: use unicode-aware checks for redundant explicit link fastpath
Fixes #115064

(cherry picked from commit 3df9b4d65d)
2023-09-01 08:52:07 -07:00
Camille GILLOT
5e8dc078e4 Restrict test to x86_64.
(cherry picked from commit 5529e2f893)
2023-09-01 08:51:52 -07:00
Camille GILLOT
5d2b78ba08 Do not produce fragment for ZST.
(cherry picked from commit 930b2e72ee)
2023-09-01 08:51:52 -07:00
Camille GILLOT
b6e160eaa0 Add test with non-ZST.
(cherry picked from commit f49494ecce)
2023-09-01 08:51:52 -07:00
Camille GILLOT
85e1b4ec10 Do not forget to pass DWARF fragment information to LLVM.
(cherry picked from commit b3bbc22cb7)
2023-09-01 08:51:52 -07:00
Scott McMurray
29c9ed9bb2 Stop emitting non-power-of-two vectors in basic LLVM codegen
(cherry picked from commit 84e305dd93)
2023-09-01 08:51:29 -07:00
David Tolnay
0679b95ee6 Revert "Suggest using Arc on !Send/!Sync types"
This reverts commit 9de1a472b6.

(cherry picked from commit 823bacb6e3)
2023-08-30 14:34:04 -07:00
Tomasz Miąsko
4469dbe13a Contents of reachable statics is reachable
(cherry picked from commit 0383131f7f)
2023-08-30 14:33:15 -07:00
bors
bc28abf92e Auto merge of #115282 - weihanglo:update-beta-cargo, r=weihanglo
[beta-1.73] Update cargo

1 commits in 80eca0e58fb2ff52c1e94fc191b55b37ed73e0e4..9c4383fb55986096b414d98125421ab87b5fd642
2023-08-19 00:52:06 +0000 to 2023-08-26 16:07:09 +0000
- [beta-1.73.0] add missing `windows-sys` features back (rust-lang/cargo#12564)

r? ghost
2023-08-27 21:23:11 +00:00
Weihang Lo
b3a82e9ee8
[beta-1.73] Update cargo 2023-08-27 18:18:28 +01:00
bors
ba87e4d0cc Auto merge of #115195 - cuviper:beta-next, r=cuviper
[beta] backport and stage0 bump

- Bump to released stable compiler
- Add projection obligations when comparing impl too #115039

r? cuviper
2023-08-25 05:15:11 +00:00
Jack Huey
dc84bdedc6 Add projection obligations when comparing impl too
(cherry picked from commit 31032ecb15)
2023-08-24 18:42:29 -07:00
Josh Stone
b73a4b4b84 Bump to released stable compiler 2023-08-24 18:42:14 -07:00
bors
680cdf8168 Auto merge of #115056 - Mark-Simulacrum:beta-backport, r=Mark-Simulacrum
[beta] promote 1.73.0 to beta

* Bump version placeholder
* Bump CI channel to beta

r? `@Mark-Simulacrum`
2023-08-21 17:42:11 +00:00
Mark Rousskov
daa6ebe8b7 Bump channel to beta 2023-08-21 09:13:01 -04:00
Mark Rousskov
486dedd595 Replace version placeholders with 1.73.0 2023-08-21 09:12:15 -04:00
bors
b053db25cc Auto merge of #114563 - Mark-Simulacrum:relnotes, r=Mark-Simulacrum
Add release notes for 1.72.0

r? `@cuviper` `@rust-lang/release`
2023-08-20 18:09:59 +00:00
bors
def52ba2b8 Auto merge of #115024 - RalfJung:anyhow, r=lqd
update anyhow

This is the anyhow version of https://github.com/rust-lang/rust/pull/114944, fixing Miri builds with an existing x.py cache by including https://github.com/dtolnay/anyhow/pull/320.

r? `@lqd`
2023-08-20 16:21:23 +00:00
Ralf Jung
83283a437e update anyhow 2023-08-20 15:55:33 +02:00
bors
0510a1526d Auto merge of #114791 - Zalathar:bcb-counter, r=cjgillot
coverage: Give the instrumentor its own counter type, separate from MIR

Within the MIR representation of coverage data, `CoverageKind` is an important part of `StatementKind::Coverage`, but the `InstrumentCoverage` pass also uses it heavily as an internal data structure. This means that any change to `CoverageKind` also needs to update all of the internal parts of `InstrumentCoverage` that manipulate it directly, making the MIR representation difficult to modify.

---

This change fixes that by giving the instrumentor its own `BcbCounter` type for internal use, which is then converted to a `CoverageKind` when injecting coverage information into MIR.

The main change is mostly mechanical, because the initial `BcbCounter` is drop-in compatible with `CoverageKind`, minus the unnecessary `CoverageKind::Unreachable` variant.

I've then removed the `function_source_hash` field from `BcbCounter::Counter`, as a small example of how the two types can now usefully differ from each other. Every counter in a MIR-level function should have the same source hash, so we can supply the hash during the conversion to `CoverageKind::Counter` instead.

---

*Background:* BCB stands for “basic coverage block”, which is a node in the simplified control-flow graph used by coverage instrumentation. The instrumentor pass uses the function's actual MIR control-flow graph to build a simplified BCB graph, then assigns coverage counters and counter expressions to various nodes/edges in that simplified graph, and then finally injects corresponding coverage information into the underlying MIR.
2023-08-20 13:37:47 +00:00
bors
c0b6ffaaea Auto merge of #114990 - Zoxc:else-if-overflow, r=cjgillot
Fix a stack overflow with long else if chains

This fixes stack overflows when running the `issue-74564-if-expr-stack-overflow.rs` test with the parallel compiler.
2023-08-20 11:48:37 +00:00
bors
ff55fa3026 Auto merge of #113124 - nbdd0121:eh_frame, r=cjgillot
Add MIR validation for unwind out from nounwind functions + fixes to make validation pass

`@Nilstrieb`  This is the MIR validation you asked in https://github.com/rust-lang/rust/pull/112403#discussion_r1222739722.

Two passes need to be fixed to get the validation to pass:
* `RemoveNoopLandingPads` currently unconditionally introduce a resume block (even there is none to begin with!), changed to not do that
* Generator state transform introduces a `assert` which may unwind, and its drop elaboration also introduces many new `UnwindAction`s, so in this case run the AbortUnwindingCalls after the transformation.

I believe this PR should also fix Rust-for-Linux/linux#1016, cc `@ojeda`

r? `@Nilstrieb`
2023-08-20 09:58:52 +00:00
bors
b6ab01a713 Auto merge of #115018 - matthiaskrgr:rollup-pxj0qdb, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #114834 (Avoid side-effects from `try_coerce` when suggesting borrowing LHS of cast)
 - #114968 (Fix UB in `std::sys::os::getenv()`)
 - #114976 (Ignore unexpected incr-comp session dirs)
 - #114999 (Migrate GUI colors test to original CSS color format)
 - #115000 (custom_mir: change Call() terminator syntax to something more readable)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-20 08:11:08 +00:00
Matthias Krüger
2bca4b5913
Rollup merge of #115000 - RalfJung:custom-mir-call, r=compiler-errors,JakobDegen
custom_mir: change Call() terminator syntax to something more readable

I find our current syntax very hard to read -- I cannot even remember the order of arguments, and having the "next block" *before* the actual function call is very counter-intuitive IMO. So I suggest we use `Call(ret_val = function(v), next_block)` instead.

r? `@JakobDegen`
2023-08-20 08:34:05 +02:00
Matthias Krüger
4542711a69
Rollup merge of #114999 - GuillaumeGomez:migrate-gui-test-color-34, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

This test needed more cleanup: first I removed duplication by using a function, then I merge similar rules which had the same values.

r? `@notriddle`
2023-08-20 08:34:04 +02:00
Matthias Krüger
e25dfe1ef6
Rollup merge of #114976 - Enselic:incr-comp-dir-error, r=compiler-errors
Ignore unexpected incr-comp session dirs

Clearly the code path can be hit without the presence of a compiler bug.
All it takes is mischief. See #71698.

Ignore problematic directories instead of ICE:ing. `continue`ing is
 already done for problematic dirs in the code block above us.

Closes #71698.

With this fix, the output is this instead of ICE:

```
$ cargo +stage1 new gz-ice && cd gz-ice
$ cargo +stage1 build
$ find target -type f -exec gzip {} \;
$ cargo +stage1 run

     Created binary (application) `gz-ice` package
   Compiling gz-ice v0.1.0 (/tmp/gz-ice)
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
gzip: target/debug/gz-ice has 1 other link  -- unchanged
gzip: target/debug/deps/gz_ice-de919414dd9926b9 has 1 other link  -- unchanged
   Compiling gz-ice v0.1.0 (/tmp/gz-ice)
warning: failed to garbage collect invalid incremental compilation session directory `/tmp/gz-ice/target/debug/incremental/gz_ice-23qx9z9j9vghe/s-gnwd8daity-kp10sj.lock.gz`: Not a directory (os error 20)

warning: `gz-ice` (bin "gz-ice") generated 1 warning
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/gz-ice`
Hello, world!
```
2023-08-20 08:34:04 +02:00
Matthias Krüger
7b66abe5a2
Rollup merge of #114968 - ShE3py:unix-getsetenv-ub, r=thomcc
Fix UB in `std::sys::os::getenv()`

Fixes #114949.

Reduced the loops to 1k iterations (100k was taking way too long), Miri no longer shows any UB.

`@rustbot` label +A-process +C-bug +I-unsound +O-unix
2023-08-20 08:34:03 +02:00
Matthias Krüger
33771dfaf0
Rollup merge of #114834 - compiler-errors:try_coerce-side-effects, r=lcnr
Avoid side-effects from `try_coerce` when suggesting borrowing LHS of cast

The name `try_coerce` is a bit misleading -- it has side-effects, so when it's used in diagnostics code, it sometimes causes spurious obligations to be registered which cause other errors to occur that really make no sense in context.

Addendum: let's just rename `try_coerce` to `coerce` -- the `try_` part doesn't really add much, imo.
2023-08-20 08:34:03 +02:00
bors
39e0749329 Auto merge of #114914 - compiler-errors:deduce-tait-in-future-output, r=lcnr
Normalize return type of `deduce_future_output_from_obligations`

Fixes #114909
Also confirmed to fix #114727 manually

Now that we have weak/lazy type aliases, we need to normalize those in future signatures to ensure that `replace_opaque_types_with_inference_vars` actually sees TAITs behind them. This isn't needed in the new solver, but added a test to make sure it doesn't regress there either.

r? types cc `@oli-obk` (who's gone, worst case can delay this PR until he's back)
2023-08-20 06:24:44 +00:00
bors
484cb4e78d Auto merge of #114332 - nbdd0121:riscv, r=compiler-errors
Fix ABI flags in RISC-V/LoongArch ELF file generated by rustc

Fix #114153

It turns out the current way to set these flags are completely wrong. In LLVM the target ABI is used instead of target features to determine these flags.

Not sure how to write a test though. Or maybe a test isn't necessary because this affects only those touching target json?

r? `@Nilstrieb`
2023-08-20 04:38:08 +00:00
bors
82c5732b9a Auto merge of #113966 - lu-zero:relocation-model-in-cfg, r=bjorn3
Add the relocation_model to the cfg

This way is possible to write inline assembly code aware of it.
2023-08-20 02:48:33 +00:00
Zalathar
72f4c78dc6 coverage: Don't store function_source_hash in BcbCounter::Counter
This shows one small benefit of separating `BcbCounter` from `CoverageKind`.
The function source hash will be the same for all counters within a function,
so instead of passing it through `CoverageCounters` and storing it in every
counter, we can just supply it during the final conversion to `CoverageKind`.
2023-08-20 12:02:40 +10:00
Zalathar
fbab055e77 coverage: Give the instrumentor its own counter type, separate from MIR
This splits off `BcbCounter` from MIR's `CoverageKind`, allowing the two types
to evolve in different directions as necessary.
2023-08-20 12:02:40 +10:00
Zalathar
629437eec7 coverage: Move a debug print into make_code_region 2023-08-20 12:02:40 +10:00
Zalathar
cad50f40e5 coverage: Remove a useless let () = 2023-08-20 12:02:40 +10:00