Skip to content

Commit 7b30b26

Browse files
committed
Auto merge of #2583 - RalfJung:rustup, r=oli-obk
initial josh subtree sync This demonstrates what a josh-based rustup would look like with my patched josh. To create it I did ``` git fetch http://localhost:8000/rust-lang/rust.git:start=75dd959a3a40eb5b4574f8d2e23aa6efbeb33573[:prefix=src/tools/miri]:/src/tools/miri.git master git merge FETCH_HEAD ./rustup-toolchain HEAD && ./miri fmt git commit -am rustup ``` Unlike the [previous attempt](rust-lang/miri#2554), this does not add a new root commit to the repo. Once we merge this, we committed to using josh for subtree syncing, and in particular a version of josh that includes josh-project/josh#961 (or something compatible).
2 parents ce4620b + 5243ae9 commit 7b30b26

File tree

17 files changed

+56
-23
lines changed

17 files changed

+56
-23
lines changed

src/tools/miri/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,10 @@ Moreover, Miri recognizes some environment variables:
435435
purpose.
436436
* `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
437437
sysroot is built without libstd. This allows testing and running no_std programs.
438-
* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
439-
instead of checking whether the output matches.
440-
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite) don't check whether the
441-
`stderr` or `stdout` files match the actual output. Useful for the rustc test suite
442-
which has subtle differences that we don't care about.
438+
* `MIRI_BLESS` (recognized by the test suite and `cargo-miri-test/run-test.py`): overwrite all
439+
`stderr` and `stdout` files instead of checking whether the output matches.
440+
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite): don't check whether the
441+
`stderr` or `stdout` files match the actual output.
443442

444443
The following environment variables are *internal* and must not be used by
445444
anyone but Miri itself. They are used to communicate between different Miri

src/tools/miri/cargo-miri/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(bootstrap, feature(let_else))]
12
#![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]
23

34
#[macro_use]

src/tools/miri/rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
acb8934fd57b3c2740c4abac0a5728c2c9b1423b
1+
e42c4d7218b2596276152c5eb1e69335621f3086

src/tools/miri/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
#![feature(int_log)]
88
#![feature(variant_count)]
99
#![feature(yeet_expr)]
10-
#![feature(is_some_with)]
10+
#![feature(is_some_and)]
1111
#![feature(nonzero_ops)]
1212
#![feature(local_key_cell_methods)]
13+
#![cfg_attr(bootstrap, feature(let_else))]
1314
// Configure clippy and other lints
1415
#![allow(
1516
clippy::collapsible_else_if,
@@ -27,6 +28,7 @@
2728
clippy::type_complexity,
2829
clippy::single_element_loop,
2930
clippy::needless_return,
31+
clippy::bool_to_int_with_if,
3032
// We are not implementing queries here so it's fine
3133
rustc::potential_query_instability
3234
)]

src/tools/miri/src/shims/unix/android/dlsym.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
4242
);
4343
}
4444

45-
let &[ref _sig, ref _func] = check_arg_count(args)?;
45+
let [_sig, _func] = check_arg_count(args)?;
4646
this.write_null(dest)?;
4747
}
4848
}

src/tools/miri/src/shims/unix/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,23 +1073,23 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
10731073
mask |= this.eval_libc("STATX_ATIME")?.to_u32()?;
10741074
InterpResult::Ok(tup)
10751075
})
1076-
.unwrap_or(Ok((0, 0)))?;
1076+
.unwrap_or_else(|| Ok((0, 0)))?;
10771077

10781078
let (created_sec, created_nsec) = metadata
10791079
.created
10801080
.map(|tup| {
10811081
mask |= this.eval_libc("STATX_BTIME")?.to_u32()?;
10821082
InterpResult::Ok(tup)
10831083
})
1084-
.unwrap_or(Ok((0, 0)))?;
1084+
.unwrap_or_else(|| Ok((0, 0)))?;
10851085

10861086
let (modified_sec, modified_nsec) = metadata
10871087
.modified
10881088
.map(|tup| {
10891089
mask |= this.eval_libc("STATX_MTIME")?.to_u32()?;
10901090
InterpResult::Ok(tup)
10911091
})
1092-
.unwrap_or(Ok((0, 0)))?;
1092+
.unwrap_or_else(|| Ok((0, 0)))?;
10931093

10941094
// Now we write everything to `statxbuf`. We write a zero for the unavailable fields.
10951095
this.write_int_fields_named(

src/tools/miri/src/stacked_borrows/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl SbTag {
4545
}
4646

4747
// The default to be used when SB is disabled
48+
#[allow(clippy::should_implement_trait)]
4849
pub fn default() -> Self {
4950
Self::new(1).unwrap()
5051
}

src/tools/miri/src/stacked_borrows/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl<'tcx> Stack {
214214
}
215215

216216
// Couldn't find it in the stack; but if there is an unknown bottom it might be there.
217-
let found = self.unknown_bottom.is_some_and(|&unknown_limit| {
217+
let found = self.unknown_bottom.is_some_and(|unknown_limit| {
218218
tag.0 < unknown_limit.0 // unknown_limit is an upper bound for what can be in the unknown bottom.
219219
});
220220
if found { Ok(None) } else { Err(()) }

src/tools/miri/test-cargo-miri/run-test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ def normalize_stderr(str):
3333
return str
3434

3535
def check_output(actual, path, name):
36+
if 'MIRI_BLESS' in os.environ:
37+
open(path, mode='w').write(actual)
38+
return True
3639
expected = open(path).read()
3740
if expected == actual:
3841
return True
39-
print(f"{path} did not match reference!")
42+
print(f"{name} output did not match reference in {path}!")
4043
print(f"--- BEGIN diff {name} ---")
4144
for text in difflib.unified_diff(expected.split("\n"), actual.split("\n")):
4245
print(text)

src/tools/miri/test-cargo-miri/test.filter.cross-target.stdout.ref

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
running 0 tests
3+
4+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
5+
6+
27
running 0 tests
38

49
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out

0 commit comments

Comments
 (0)