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](https://github.com/rust-lang/miri/pull/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 https://github.com/josh-project/josh/pull/961 (or something compatible).
This commit is contained in:
commit
7b30b26145
17 changed files with 56 additions and 23 deletions
|
|
@ -435,11 +435,10 @@ Moreover, Miri recognizes some environment variables:
|
|||
purpose.
|
||||
* `MIRI_NO_STD` (recognized by `cargo miri` and the test suite) makes sure that the target's
|
||||
sysroot is built without libstd. This allows testing and running no_std programs.
|
||||
* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
|
||||
instead of checking whether the output matches.
|
||||
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite) don't check whether the
|
||||
`stderr` or `stdout` files match the actual output. Useful for the rustc test suite
|
||||
which has subtle differences that we don't care about.
|
||||
* `MIRI_BLESS` (recognized by the test suite and `cargo-miri-test/run-test.py`): overwrite all
|
||||
`stderr` and `stdout` files instead of checking whether the output matches.
|
||||
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite): don't check whether the
|
||||
`stderr` or `stdout` files match the actual output.
|
||||
|
||||
The following environment variables are *internal* and must not be used by
|
||||
anyone but Miri itself. They are used to communicate between different Miri
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#![cfg_attr(bootstrap, feature(let_else))]
|
||||
#![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]
|
||||
|
||||
#[macro_use]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
acb8934fd57b3c2740c4abac0a5728c2c9b1423b
|
||||
e42c4d7218b2596276152c5eb1e69335621f3086
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@
|
|||
#![feature(int_log)]
|
||||
#![feature(variant_count)]
|
||||
#![feature(yeet_expr)]
|
||||
#![feature(is_some_with)]
|
||||
#![feature(is_some_and)]
|
||||
#![feature(nonzero_ops)]
|
||||
#![feature(local_key_cell_methods)]
|
||||
#![cfg_attr(bootstrap, feature(let_else))]
|
||||
// Configure clippy and other lints
|
||||
#![allow(
|
||||
clippy::collapsible_else_if,
|
||||
|
|
@ -27,6 +28,7 @@
|
|||
clippy::type_complexity,
|
||||
clippy::single_element_loop,
|
||||
clippy::needless_return,
|
||||
clippy::bool_to_int_with_if,
|
||||
// We are not implementing queries here so it's fine
|
||||
rustc::potential_query_instability
|
||||
)]
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||
);
|
||||
}
|
||||
|
||||
let &[ref _sig, ref _func] = check_arg_count(args)?;
|
||||
let [_sig, _func] = check_arg_count(args)?;
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1073,7 +1073,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||
mask |= this.eval_libc("STATX_ATIME")?.to_u32()?;
|
||||
InterpResult::Ok(tup)
|
||||
})
|
||||
.unwrap_or(Ok((0, 0)))?;
|
||||
.unwrap_or_else(|| Ok((0, 0)))?;
|
||||
|
||||
let (created_sec, created_nsec) = metadata
|
||||
.created
|
||||
|
|
@ -1081,7 +1081,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||
mask |= this.eval_libc("STATX_BTIME")?.to_u32()?;
|
||||
InterpResult::Ok(tup)
|
||||
})
|
||||
.unwrap_or(Ok((0, 0)))?;
|
||||
.unwrap_or_else(|| Ok((0, 0)))?;
|
||||
|
||||
let (modified_sec, modified_nsec) = metadata
|
||||
.modified
|
||||
|
|
@ -1089,7 +1089,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||
mask |= this.eval_libc("STATX_MTIME")?.to_u32()?;
|
||||
InterpResult::Ok(tup)
|
||||
})
|
||||
.unwrap_or(Ok((0, 0)))?;
|
||||
.unwrap_or_else(|| Ok((0, 0)))?;
|
||||
|
||||
// Now we write everything to `statxbuf`. We write a zero for the unavailable fields.
|
||||
this.write_int_fields_named(
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ impl SbTag {
|
|||
}
|
||||
|
||||
// The default to be used when SB is disabled
|
||||
#[allow(clippy::should_implement_trait)]
|
||||
pub fn default() -> Self {
|
||||
Self::new(1).unwrap()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ impl<'tcx> Stack {
|
|||
}
|
||||
|
||||
// Couldn't find it in the stack; but if there is an unknown bottom it might be there.
|
||||
let found = self.unknown_bottom.is_some_and(|&unknown_limit| {
|
||||
let found = self.unknown_bottom.is_some_and(|unknown_limit| {
|
||||
tag.0 < unknown_limit.0 // unknown_limit is an upper bound for what can be in the unknown bottom.
|
||||
});
|
||||
if found { Ok(None) } else { Err(()) }
|
||||
|
|
|
|||
|
|
@ -33,10 +33,13 @@ def normalize_stderr(str):
|
|||
return str
|
||||
|
||||
def check_output(actual, path, name):
|
||||
if 'MIRI_BLESS' in os.environ:
|
||||
open(path, mode='w').write(actual)
|
||||
return True
|
||||
expected = open(path).read()
|
||||
if expected == actual:
|
||||
return True
|
||||
print(f"{path} did not match reference!")
|
||||
print(f"{name} output did not match reference in {path}!")
|
||||
print(f"--- BEGIN diff {name} ---")
|
||||
for text in difflib.unified_diff(expected.split("\n"), actual.split("\n")):
|
||||
print(text)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
|
||||
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
|
||||
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
|
||||
|
|
@ -10,8 +15,3 @@ test simple ... ok
|
|||
|
||||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out
|
||||
|
||||
|
||||
running 0 tests
|
||||
|
||||
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in $TIME
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ LL | let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(
|
|||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
= note: BACKTRACE:
|
||||
= note: inside `std::sys::PLATFORM::thread::Thread::join` at RUSTLIB/std/src/sys/PLATFORM/thread.rs:LL:CC
|
||||
= note: inside `std::thread::JoinInner::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
|
||||
= note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
|
||||
= note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
|
||||
note: inside `main` at $DIR/windows_join_detached.rs:LL:CC
|
||||
--> $DIR/windows_join_detached.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ error: any use of this value will cause an error
|
|||
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
||||
| -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
|
||||
|
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
|
||||
error[E0080]: evaluation of constant value failed
|
||||
--> $DIR/erroneous_const2.rs:LL:CC
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Validation makes this fail in the wrong place
|
||||
// Make sure we find these even with many checks disabled.
|
||||
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation
|
||||
#![feature(bench_black_box)]
|
||||
|
||||
fn main() {
|
||||
let b = unsafe { std::mem::transmute::<u8, bool>(2) };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(stmt_expr_attributes, bench_black_box)]
|
||||
#![feature(stmt_expr_attributes)]
|
||||
#![allow(arithmetic_overflow)]
|
||||
use std::fmt::Debug;
|
||||
use std::hint::black_box;
|
||||
|
|
|
|||
24
src/tools/miri/tests/pass/issues/issue-miri-2433.rs
Normal file
24
src/tools/miri/tests/pass/issues/issue-miri-2433.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait T {
|
||||
type Item;
|
||||
}
|
||||
|
||||
type Alias<'a> = impl T<Item = &'a ()>;
|
||||
|
||||
struct S;
|
||||
impl<'a> T for &'a S {
|
||||
type Item = &'a ();
|
||||
}
|
||||
|
||||
fn filter_positive<'a>() -> Alias<'a> {
|
||||
&S
|
||||
}
|
||||
|
||||
fn with_positive(fun: impl Fn(Alias<'_>)) {
|
||||
fun(filter_positive());
|
||||
}
|
||||
|
||||
fn main() {
|
||||
with_positive(|_| ());
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(bench_black_box)]
|
||||
use std::hint::black_box as b;
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue