Skip to content

Commit 96ab09d

Browse files
committed
Auto merge of #116138 - RalfJung:miri, r=RalfJung
Miri subtree update r? `@ghost`
2 parents 67ad3c2 + efd04b6 commit 96ab09d

30 files changed

+3199
-2069
lines changed

src/tools/miri/.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches:
1111
- 'master'
1212
schedule:
13-
- cron: '11 5 * * *' # At 5:11 UTC every day.
13+
- cron: '44 4 * * *' # At 4:44 UTC every day.
1414

1515
defaults:
1616
run:
@@ -208,7 +208,7 @@ jobs:
208208
git push -u origin $BRANCH
209209
- name: Create Pull Request
210210
run: |
211-
PR=$(gh pr create -B master --title 'Automatic sync from rustc' --body '' --label subtree-sync)
211+
PR=$(gh pr create -B master --title 'Automatic sync from rustc' --body '')
212212
~/.local/bin/zulip-send --user $ZULIP_BOT_EMAIL --api-key $ZULIP_API_TOKEN --site https://rust-lang.zulipchat.com \
213213
--stream miri --subject "Cron Job Failure (miri, $(date -u +%Y-%m))" \
214214
--message "A PR doing a rustc-pull [has been automatically created]($PR) for your convenience."

src/tools/miri/Cargo.lock

+52-36
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ version = "1.0.71"
3232
source = "registry+https://github.com/rust-lang/crates.io-index"
3333
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
3434

35-
[[package]]
36-
name = "atty"
37-
version = "0.2.14"
38-
source = "registry+https://github.com/rust-lang/crates.io-index"
39-
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
40-
dependencies = [
41-
"hermit-abi 0.1.19",
42-
"libc",
43-
"winapi",
44-
]
45-
4635
[[package]]
4736
name = "autocfg"
4837
version = "1.1.0"
@@ -70,6 +59,12 @@ version = "1.3.2"
7059
source = "registry+https://github.com/rust-lang/crates.io-index"
7160
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
7261

62+
[[package]]
63+
name = "bitflags"
64+
version = "2.4.0"
65+
source = "registry+https://github.com/rust-lang/crates.io-index"
66+
checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
67+
7368
[[package]]
7469
name = "bstr"
7570
version = "1.4.0"
@@ -155,13 +150,13 @@ dependencies = [
155150

156151
[[package]]
157152
name = "colored"
158-
version = "2.0.0"
153+
version = "2.0.4"
159154
source = "registry+https://github.com/rust-lang/crates.io-index"
160-
checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd"
155+
checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6"
161156
dependencies = [
162-
"atty",
157+
"is-terminal",
163158
"lazy_static",
164-
"winapi",
159+
"windows-sys 0.48.0",
165160
]
166161

167162
[[package]]
@@ -201,12 +196,12 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
201196

202197
[[package]]
203198
name = "env_logger"
204-
version = "0.9.3"
199+
version = "0.10.0"
205200
source = "registry+https://github.com/rust-lang/crates.io-index"
206-
checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
201+
checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
207202
dependencies = [
208-
"atty",
209203
"humantime",
204+
"is-terminal",
210205
"log",
211206
"regex",
212207
"termcolor",
@@ -269,15 +264,6 @@ version = "0.27.2"
269264
source = "registry+https://github.com/rust-lang/crates.io-index"
270265
checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4"
271266

272-
[[package]]
273-
name = "hermit-abi"
274-
version = "0.1.19"
275-
source = "registry+https://github.com/rust-lang/crates.io-index"
276-
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
277-
dependencies = [
278-
"libc",
279-
]
280-
281267
[[package]]
282268
name = "hermit-abi"
283269
version = "0.3.1"
@@ -311,11 +297,22 @@ version = "1.0.10"
311297
source = "registry+https://github.com/rust-lang/crates.io-index"
312298
checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
313299
dependencies = [
314-
"hermit-abi 0.3.1",
300+
"hermit-abi",
315301
"libc",
316302
"windows-sys 0.48.0",
317303
]
318304

305+
[[package]]
306+
name = "is-terminal"
307+
version = "0.4.9"
308+
source = "registry+https://github.com/rust-lang/crates.io-index"
309+
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
310+
dependencies = [
311+
"hermit-abi",
312+
"rustix 0.38.14",
313+
"windows-sys 0.48.0",
314+
]
315+
319316
[[package]]
320317
name = "itoa"
321318
version = "1.0.6"
@@ -330,9 +327,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
330327

331328
[[package]]
332329
name = "libc"
333-
version = "0.2.142"
330+
version = "0.2.148"
334331
source = "registry+https://github.com/rust-lang/crates.io-index"
335-
checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317"
332+
checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
336333

337334
[[package]]
338335
name = "libffi"
@@ -369,6 +366,12 @@ version = "0.3.7"
369366
source = "registry+https://github.com/rust-lang/crates.io-index"
370367
checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f"
371368

369+
[[package]]
370+
name = "linux-raw-sys"
371+
version = "0.4.7"
372+
source = "registry+https://github.com/rust-lang/crates.io-index"
373+
checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"
374+
372375
[[package]]
373376
name = "lock_api"
374377
version = "0.4.9"
@@ -454,7 +457,7 @@ version = "0.26.2"
454457
source = "registry+https://github.com/rust-lang/crates.io-index"
455458
checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a"
456459
dependencies = [
457-
"bitflags",
460+
"bitflags 1.3.2",
458461
"cfg-if",
459462
"libc",
460463
"static_assertions",
@@ -581,7 +584,7 @@ version = "0.2.16"
581584
source = "registry+https://github.com/rust-lang/crates.io-index"
582585
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
583586
dependencies = [
584-
"bitflags",
587+
"bitflags 1.3.2",
585588
]
586589

587590
[[package]]
@@ -590,7 +593,7 @@ version = "0.3.5"
590593
source = "registry+https://github.com/rust-lang/crates.io-index"
591594
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
592595
dependencies = [
593-
"bitflags",
596+
"bitflags 1.3.2",
594597
]
595598

596599
[[package]]
@@ -655,11 +658,24 @@ version = "0.37.19"
655658
source = "registry+https://github.com/rust-lang/crates.io-index"
656659
checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d"
657660
dependencies = [
658-
"bitflags",
661+
"bitflags 1.3.2",
659662
"errno",
660663
"io-lifetimes",
661664
"libc",
662-
"linux-raw-sys",
665+
"linux-raw-sys 0.3.7",
666+
"windows-sys 0.48.0",
667+
]
668+
669+
[[package]]
670+
name = "rustix"
671+
version = "0.38.14"
672+
source = "registry+https://github.com/rust-lang/crates.io-index"
673+
checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f"
674+
dependencies = [
675+
"bitflags 2.4.0",
676+
"errno",
677+
"libc",
678+
"linux-raw-sys 0.4.7",
663679
"windows-sys 0.48.0",
664680
]
665681

@@ -756,7 +772,7 @@ dependencies = [
756772
"cfg-if",
757773
"fastrand",
758774
"redox_syscall 0.3.5",
759-
"rustix",
775+
"rustix 0.37.19",
760776
"windows-sys 0.45.0",
761777
]
762778

src/tools/miri/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Some of these are **unsound**, which means they can lead
362362
to Miri failing to detect cases of undefined behavior in a program.
363363

364364
* `-Zmiri-disable-abi-check` disables checking [function ABI]. Using this flag
365-
is **unsound**.
365+
is **unsound**. This flag is **deprecated**.
366366
* `-Zmiri-disable-alignment-check` disables checking pointer alignment, so you
367367
can focus on other failures, but it means Miri can miss bugs in your program.
368368
Using this flag is **unsound**.

src/tools/miri/miri-script/src/commands.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ impl Command {
339339
"Confirmed that the push round-trips back to Miri properly. Please create a rustc PR:"
340340
);
341341
println!(
342-
// Open PR with `subtree-sync` label to satisfy the `no-merges` triagebot check
342+
// Open PR with `subtree update` title to silence the `no-merges` triagebot check
343343
// See https://github.com/rust-lang/rust/pull/114157
344-
" https://github.com/rust-lang/rust/compare/{github_user}:{branch}?quick_pull=1&labels=subtree-sync"
344+
" https://github.com/rust-lang/rust/compare/{github_user}:{branch}?quick_pull=1&title=Miri+subtree+update"
345345
);
346346

347347
drop(josh);

src/tools/miri/rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
366dab13f711df90a6891411458544199d159cbc
1+
42ca6e4e5760a548a6fa858482de6d237f6fb3b8

src/tools/miri/src/bin/miri.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ use rustc_middle::{
2828
middle::exported_symbols::{
2929
ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel,
3030
},
31-
query::{LocalCrate},
32-
util::Providers,
31+
query::LocalCrate,
3332
ty::TyCtxt,
33+
util::Providers,
3434
};
3535
use rustc_session::config::{CrateType, ErrorOutputType, OptLevel};
3636
use rustc_session::search_paths::PathKind;
@@ -359,6 +359,10 @@ fn main() {
359359
since it is now enabled by default"
360360
);
361361
} else if arg == "-Zmiri-disable-abi-check" {
362+
eprintln!(
363+
"WARNING: the flag `-Zmiri-disable-abi-check` is deprecated and planned to be removed.\n\
364+
If you have a use-case for it, please file an issue."
365+
);
362366
miri_config.check_abi = false;
363367
} else if arg == "-Zmiri-disable-isolation" {
364368
if matches!(isolation_enabled, Some(true)) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
//! Exhaustive testing utilities.
2+
//! (These are used in Tree Borrows `#[test]`s for thorough verification
3+
//! of the behavior of the state machine of permissions,
4+
//! but the contents of this file are extremely generic)
5+
#![cfg(test)]
6+
7+
pub trait Exhaustive: Sized {
8+
fn exhaustive() -> Box<dyn Iterator<Item = Self>>;
9+
}
10+
11+
macro_rules! precondition {
12+
($cond:expr) => {
13+
if !$cond {
14+
continue;
15+
}
16+
};
17+
}
18+
pub(crate) use precondition;
19+
20+
// Trivial impls of `Exhaustive` for the standard types with 0, 1 and 2 elements respectively.
21+
22+
impl Exhaustive for ! {
23+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
24+
Box::new(std::iter::empty())
25+
}
26+
}
27+
28+
impl Exhaustive for () {
29+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
30+
Box::new(std::iter::once(()))
31+
}
32+
}
33+
34+
impl Exhaustive for bool {
35+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
36+
Box::new(vec![true, false].into_iter())
37+
}
38+
}
39+
40+
// Some container impls for `Exhaustive`.
41+
42+
impl<T> Exhaustive for Option<T>
43+
where
44+
T: Exhaustive + 'static,
45+
{
46+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
47+
Box::new(std::iter::once(None).chain(T::exhaustive().map(Some)))
48+
}
49+
}
50+
51+
impl<T1, T2> Exhaustive for (T1, T2)
52+
where
53+
T1: Exhaustive + Clone + 'static,
54+
T2: Exhaustive + 'static,
55+
{
56+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
57+
Box::new(T1::exhaustive().flat_map(|t1| T2::exhaustive().map(move |t2| (t1.clone(), t2))))
58+
}
59+
}
60+
61+
impl<T> Exhaustive for [T; 1]
62+
where
63+
T: Exhaustive + 'static,
64+
{
65+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
66+
Box::new(T::exhaustive().map(|t| [t]))
67+
}
68+
}
69+
70+
impl<T> Exhaustive for [T; 2]
71+
where
72+
T: Exhaustive + Clone + 'static,
73+
{
74+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
75+
Box::new(T::exhaustive().flat_map(|t1| T::exhaustive().map(move |t2| [t1.clone(), t2])))
76+
}
77+
}
78+
79+
impl<T> Exhaustive for [T; 3]
80+
where
81+
T: Exhaustive + Clone + 'static,
82+
{
83+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
84+
Box::new(
85+
<[T; 2]>::exhaustive()
86+
.flat_map(|[t1, t2]| T::exhaustive().map(move |t3| [t1.clone(), t2.clone(), t3])),
87+
)
88+
}
89+
}
90+
91+
impl<T> Exhaustive for [T; 4]
92+
where
93+
T: Exhaustive + Clone + 'static,
94+
{
95+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
96+
Box::new(<[T; 2]>::exhaustive().flat_map(|[t1, t2]| {
97+
<[T; 2]>::exhaustive().map(move |[t3, t4]| [t1.clone(), t2.clone(), t3, t4])
98+
}))
99+
}
100+
}
101+
102+
impl<T> Exhaustive for [T; 5]
103+
where
104+
T: Exhaustive + Clone + 'static,
105+
{
106+
fn exhaustive() -> Box<dyn Iterator<Item = Self>> {
107+
Box::new(<[T; 2]>::exhaustive().flat_map(|[t1, t2]| {
108+
<[T; 3]>::exhaustive().map(move |[t3, t4, t5]| [t1.clone(), t2.clone(), t3, t4, t5])
109+
}))
110+
}
111+
}

0 commit comments

Comments
 (0)