Commit graph

247662 commits

Author SHA1 Message Date
Ralf Jung
4b955f14db Preparing for merge from rustc 2024-03-06 19:40:31 +01:00
bors
033c1e00b0 Auto merge of #3340 - RalfJung:no-disable-abi-check, r=oli-obk
remove the ability to disable ABI checking

This got deprecated in https://github.com/rust-lang/miri/pull/3071, about half a year ago.

`@rust-lang/miri` I think it's fine to remove this now.
2024-03-06 07:37:33 +00:00
bors
e88704e48c Auto merge of #3359 - rust-lang:dependabot/cargo/test_dependencies/mio-0.8.11, r=RalfJung
Bump mio from 0.8.10 to 0.8.11 in /test_dependencies

Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md">mio's changelog</a>.</em></p>
<blockquote>
<h1>0.8.11</h1>
<ul>
<li>Fix receiving IOCP events after deregistering a Windows named pipe
(<a href="https://redirect.github.com/tokio-rs/mio/pull/1760">tokio-rs/mio#1760</a>, backport pr:
<a href="https://redirect.github.com/tokio-rs/mio/pull/1761">tokio-rs/mio#1761</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="0328bdef90"><code>0328bde</code></a> Release v0.8.11</li>
<li><a href="7084498512"><code>7084498</code></a> Fix warnings</li>
<li><a href="90d4fe00df"><code>90d4fe0</code></a> named-pipes: fix receiving IOCP events after deregister</li>
<li><a href="c710a307f8"><code>c710a30</code></a> Add v0.8.x to the CI</li>
<li><a href="c29e21c244"><code>c29e21c</code></a> Release v0.8.10</li>
<li>See full diff in <a href="https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mio&package-manager=cargo&previous-version=0.8.10&new-version=0.8.11)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/rust-lang/miri/network/alerts).

</details>
2024-03-04 22:18:51 +00:00
dependabot[bot]
5294dd8afd
Bump mio from 0.8.10 to 0.8.11 in /test_dependencies
Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 21:30:41 +00:00
bors
65ec028455 Auto merge of #3358 - RalfJung:zzz, r=RalfJung
give macOS even more time to sleep
2024-03-04 18:45:12 +00:00
Ralf Jung
2b40181cb3 give macOS even more time to sleep 2024-03-04 19:11:09 +01:00
bors
790287a08f Auto merge of #3357 - RalfJung:imports, r=RalfJung
reorder rustc crate imports a bit
2024-03-04 17:57:38 +00:00
bors
4fdb2152d9 Auto merge of #3356 - RalfJung:typo, r=RalfJung
Conjob → Cronjob

Same as https://github.com/rust-lang/miri-test-libstd/pull/44
2024-03-04 16:08:52 +00:00
Ralf Jung
45d955edb0 reorder rustc crate imports a bit 2024-03-04 16:23:25 +01:00
Ralf Jung
a477cf45ff Conjob → Cronjob 2024-03-04 16:22:30 +01:00
bors
5b05be17cd Auto merge of #3355 - saethlin:cargo-miri-clean, r=RalfJung
Use cargo miri clean in build-all-targets.sh
2024-03-04 15:20:13 +00:00
Ben Kimock
75f6694ce8 Use cargo miri clean in build-all-targets.sh 2024-03-04 10:13:49 -05:00
bors
8851f3cd73 Auto merge of #3354 - RalfJung:MIRI_LIB_SRC-change, r=RalfJung
we properly rebuild the sysroot now when MIRI_LIB_SRC contents change

Thanks to https://github.com/RalfJung/rustc-build-sysroot/pull/16
2024-03-04 14:09:43 +00:00
Ralf Jung
974446eb92 we properly rebuild the cache now when MIRI_LIB_SRC contents change 2024-03-04 15:07:35 +01:00
bors
e87f82578d Auto merge of #3351 - RalfJung:diagnostic-dedup-considered-harmful, r=RalfJung
disable diagnostic deduplication

`@oli-obk` is there a better way to do this? Ideally we'd only set this when interpretation starts but the value in the compiler session seems to be immutable. I assume people will do `cargo check` before `cargo miri` so hopefully this won't lead to too much confusion.

Fixes https://github.com/rust-lang/miri/issues/3350
2024-03-04 09:21:33 +00:00
bors
ede97c6510 Auto merge of #3339 - RalfJung:remove-old-flags, r=saethlin
remove some flags that haven't had an effect in a while

`@rust-lang/miri` any objections to this?
2024-03-04 08:34:11 +00:00
Ralf Jung
f70feaf604 linux-futex test: add comment 2024-03-04 09:34:07 +01:00
Ralf Jung
d5f31bda4f implement manual deduplication for isolation-error=warn-nobacktrace 2024-03-04 09:34:07 +01:00
Ralf Jung
fbafd36333 disable diagnostic deduplication 2024-03-04 09:34:07 +01:00
bors
f47732b55e Auto merge of #3330 - RossSmyth:win-fmt, r=RalfJung
Fix .\miri fmt on Windows

This allows .\miri fmt to work on Windows. Closes #3317.

To reiterate, the problem with using `miri fmt` on Windows is that the CLI arguments to rustfmt are too long. Currently over 65,000 characters are used in the call to rustfmt, [which is incompatible with Windows](https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553) as it is limited to (2^15 - 1) for all arguments plus all env vars.

Two things are done do get around this limit:

1. Call out to cargo-fmt for the crates that exist.
2. Batch rustfmt calls by length

Another alternative would be to just use rustfmt for everything and don't use cargo-fmt for the crates.

I don't know how much you guys may care about `miri fmt` time to run. I don't know the diff as it did not work before on my computer.

[I have another branch that solves this, but in a less permanent way](RossSmyth/miri/tree/windows-fmt). That was my initial attempt, and I learned that even with cargo-fmt and relative paths, the rustfmt call still has 27k characters. This is closer to the limit than I expected, so it would not be a permanent solution. So I went back to absolute paths & batching.
2024-03-03 14:02:57 +00:00
Ralf Jung
83e2e2d89d
nits and typos 2024-03-03 15:00:47 +01:00
bors
f51f9236f9 Auto merge of #3348 - RalfJung:miri-thread-logging, r=RalfJung
log when we change the active thread, and fix logging for concurrency

Also avoid relying on the incorrect scope exit logging produced by tracing (Cc https://github.com/rust-lang/miri/issues/2266)
2024-03-03 12:38:10 +00:00
Ralf Jung
983c2c59c9 do not rely on tracing's scope exit logging, it is wrong 2024-03-03 13:29:14 +01:00
Ralf Jung
3041c78c9c log when we change the active thread 2024-03-03 13:11:52 +01:00
Ralf Jung
cfc10f0aab fix MIRI_LOG=info not setting the level for miri itself 2024-03-03 12:50:55 +01:00
bors
639fab7f9a Auto merge of #3345 - RalfJung:win-get-thread-name, r=RalfJung
Windows: support getting the thread name

Also organize the thread name tests a bit.
2024-03-03 10:32:43 +00:00
bors
cdf1071309 Auto merge of #3346 - RalfJung:alloc-accesses, r=RalfJung
Add -Zmiri-track-alloc-accesses to readme and fix its wording

I forgot that yesterday...
2024-03-03 09:45:04 +00:00
Ralf Jung
c72b48778d Windows: support getting the thread name 2024-03-03 10:43:44 +01:00
Ralf Jung
931e45389a fix wording of alloc access tracking message 2024-03-03 10:27:24 +01:00
Ralf Jung
7f485fc923 readme 2024-03-03 10:12:19 +01:00
Ralf Jung
8deb651603 move thread-panic tests to their own file; test getting the thread name 2024-03-03 09:00:38 +01:00
Ross Smyth
32643dc853 Fix .\miri fmt on Windows 2024-03-02 19:45:54 -05:00
bors
31957b6764 Auto merge of #3343 - RalfJung:tree-borrows-diag, r=RalfJung
Tree Borrows diagnostic improvements

print where the forbidden access happens; make tag tracking less verbose
2024-03-02 20:16:52 +00:00
Ralf Jung
21527d23d2 Tree Borrows: print where the forbidden access happens; make tag tracking less verbose 2024-03-02 21:14:58 +01:00
Ralf Jung
c1a5906d54 remove the ability to disable ABI checking 2024-03-02 20:08:14 +01:00
bors
be5da3a4aa Auto merge of #3338 - RalfJung:more-tracking-and-threads, r=RalfJung
print thread name in miri error backtraces; add option to track read/write accesses

This came up while debugging https://github.com/rust-lang/rust/issues/121626. It didn't end up being useful there but still seems like good tools to have around.
2024-03-02 18:08:05 +00:00
Ralf Jung
fe545d62db add option to track all read/write accesses to tracked allocations 2024-03-02 19:06:43 +01:00
Ralf Jung
fe9dede3e2 print thread name in miri error backtraces 2024-03-02 17:56:56 +01:00
Ralf Jung
81fed2f200 remove some flags that haven't had an effect in a while 2024-03-02 16:41:29 +01:00
bors
14e162861b Auto merge of #3336 - RalfJung:rustup, r=RalfJung
Rustup

Also add regression test for https://github.com/rust-lang/rust/issues/121508.
2024-02-29 19:19:46 +00:00
Ralf Jung
2a376ceb8d add regression test 2024-02-29 19:45:14 +01:00
Ralf Jung
70758a788b Merge from rustc 2024-02-29 19:40:52 +01:00
Ralf Jung
96edeb8989 Preparing for merge from rustc 2024-02-29 19:40:27 +01:00
bors
1a1876c979 Auto merge of #121804 - GuillaumeGomez:rollup-jh0v3ex, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #119748 (Increase visibility of `join_path` and `split_paths`)
 - #120820 (Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64)
 - #121000 (pattern_analysis: rework how we hide empty private fields)
 - #121376 (Skip unnecessary comparison with half-open range patterns)
 - #121596 (Use volatile access instead of `#[used]` for `on_tls_callback`)
 - #121669 (Count stashed errors again)
 - #121783 (Emitter cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-29 16:10:05 +00:00
Guillaume Gomez
0e9f02d6fa
Rollup merge of #121783 - nnethercote:emitter-cleanups, r=oli-obk
Emitter cleanups

Some cleanups I made when reading emitter code. In particular, `HumanEmitter` and `JsonEmitter` have gone from three constructors to one.

r? `@oli-obk`
2024-02-29 17:08:38 +01:00
Guillaume Gomez
a5945b5d8d
Rollup merge of #121669 - nnethercote:count-stashed-errs-again, r=estebank
Count stashed errors again

Stashed diagnostics are such a pain. Their "might be emitted, might not" semantics messes with lots of things.

#120828 and #121206 made some big changes to how they work, improving some things, but still leaving some problems, as seen by the issues caused by #121206. This PR aims to fix all of them by restricting them in a way that eliminates the "might be emitted, might not" semantics while still allowing 98% of their benefit. Details in the individual commit logs.

r? `@oli-obk`
2024-02-29 17:08:38 +01:00
Guillaume Gomez
eea8ceed54
Rollup merge of #121596 - ChrisDenton:tls, r=joboet
Use volatile access instead of `#[used]` for `on_tls_callback`

The first commit adds a volatile load of `p_thread_callback` when registering a dtor so that the compiler knows if the callback is used or not. I don't believe the added volatile instruction is otherwise significant in the context. In my testing using the volatile load allowed the compiler to correctly reason about whether `on_tls_callback` is used or not, allowing it to be omitted entirely in some cases. Admittedly it usually is used due to `Thread` but that can be avoided (e.g. in DLLs or with custom entry points that avoid the offending APIs). Ideally this would be something the compiler could help a bit more with so we didn't have to use tricks like `#[used]` or volatile. But alas.

I also used this as an opportunity to clean up the `unused` lints which I don't think serve a purpose any more.

The second commit removes the volatile load of `_tls_used` with `#cfg[target_thread_local]` because `#[thread_local]` already implies it. And if it ever didn't then `#[thread_local]` would be broken when there aren't any dtors.
2024-02-29 17:08:37 +01:00
Guillaume Gomez
2e0a26a32a
Rollup merge of #121376 - Nadrieril:mir-half-ranges, r=pnkfelix
Skip unnecessary comparison with half-open range patterns

This is the last remaining detail in the implementation of half-open range patterns. Until now, a half-open range pattern like `10..` was converted to `10..T::MAX` before lowering to MIR, which generated an extra pointless comparison. With this PR we don't generate it.
2024-02-29 17:08:37 +01:00
Guillaume Gomez
9df7f26b1b
Rollup merge of #121000 - Nadrieril:keep_all_fields, r=compiler-errors
pattern_analysis: rework how we hide empty private fields

Consider this:
```rust
mod foo {
  pub struct Bar {
    pub a: bool,
    b: !,
  }
}

fn match_a_bar(bar: foo::Bar) -> bool {
  match bar {
    Bar { a, .. } => a,
  }
}
```

Because the field `b` is private, matches outside the module are not allowed to observe the fact that `Bar` is empty. In particular `match bar {}` is valid within the module `foo` but an error outside (assuming `exhaustive_patterns`).

We currently handle this by hiding the field `b` when it's both private and empty. This means that the pattern `Bar { a, .. }` is lowered to `Bar(a, _)` if we're inside of `foo` and to `Bar(a)` outside. This involves a bit of a dance to keep field indices straight. But most importantly this makes pattern lowering depend on the module.

In this PR, I instead do nothing special when lowering. Only during analysis do we track whether a place must be skipped.

r? `@compiler-errors`
2024-02-29 17:08:37 +01:00
Guillaume Gomez
36bd9ef5a8
Rollup merge of #120820 - CKingX:cpu-base-minimum, r=petrochenkov,ChrisDenton
Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64

As Rust plans to set Windows 10 as the minimum supported OS for target x86_64-pc-windows-msvc, I have added the cmpxchg16b and sse3 feature. Windows 10 requires CMPXCHG16B, LAHF/SAHF, and PrefetchW as stated in the requirements [here](https://download.microsoft.com/download/c/1/5/c150e1ca-4a55-4a7e-94c5-bfc8c2e785c5/Windows%2010%20Minimum%20Hardware%20Requirements.pdf). Furthermore, CPUs that meet these requirements also have SSE3 ([see](https://walbourn.github.io/directxmath-sse3-and-ssse3/))
2024-02-29 17:08:36 +01:00