Skip to content

Commit c7026a0

Browse files
committed
Auto merge of #116138 - RalfJung:miri, r=RalfJung
Miri subtree update r? `@ghost`
2 parents dc73c54 + 15d1ac5 commit c7026a0

30 files changed

+3199
-2069
lines changed

.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."

Cargo.lock

+52-36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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**.

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);

rust-version

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

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)