Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial josh subtree sync #2583

Merged
merged 53 commits into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
5c3bfaf
add regression test for miri issue 2433
RalfJung Sep 22, 2022
7a0ba90
make Miri build in stage 0
RalfJung Sep 22, 2022
8be9674
Rollup merge of #102148 - RalfJung:miri-test, r=oli-obk
matthiaskrgr Sep 23, 2022
633027d
Rollup merge of #102158 - notriddle:notriddle/stab-p, r=GuillaumeGomez
matthiaskrgr Sep 23, 2022
b59fd3c
Rollup merge of #102177 - inquisitivecrystal:std-doc-typo, r=Dylan-DPC
matthiaskrgr Sep 23, 2022
6e81886
Auto merge of #102192 - matthiaskrgr:rollup-0ctjzco, r=matthiaskrgr
bors Sep 23, 2022
26db3e3
Bless miri.
cjgillot Sep 23, 2022
e4b14ce
Auto merge of #102068 - cjgillot:erased-lifetime-print, r=eholk
bors Sep 24, 2022
93e726b
Auto merge of #102064 - cjgillot:revert, r=Mark-Simulacrum
bors Sep 24, 2022
6784b45
Auto merge of #102167 - thomcc:exclusive-inline, r=scottmcm
bors Sep 24, 2022
5269806
Stabilize bench_black_box
Urgau Sep 24, 2022
985cc02
Rollup merge of #102232 - Urgau:stabilize-bench_black_box, r=TaKO8Ki
JohnTitor Sep 28, 2022
7d8d8f3
Rollup merge of #102288 - mejrs:inner, r=compiler-errors
JohnTitor Sep 28, 2022
b9c8fb0
Rollup merge of #102338 - compiler-errors:assoc-ty-binding-in-assoc-t…
JohnTitor Sep 28, 2022
22dc633
Rollup merge of #102347 - nnethercote:unescaping-cleanups, r=matklad
JohnTitor Sep 28, 2022
28b3615
Rollup merge of #102348 - nnethercote:tweak-FulfillProcessor, r=jackh726
JohnTitor Sep 28, 2022
a62aae2
Rollup merge of #102378 - compiler-errors:issue-102289, r=jackh726
JohnTitor Sep 28, 2022
12d81c2
Rollup merge of #102380 - notriddle:notriddle/rustdoc-source-sidebar,…
JohnTitor Sep 28, 2022
cf62e8a
Auto merge of #102388 - JohnTitor:rollup-mbyw6fl, r=JohnTitor
bors Sep 28, 2022
ebc5fd4
Auto merge of #102302 - nnethercote:more-lexer-improvements, r=matklad
bors Sep 28, 2022
94048e7
Auto merge of #101619 - Xiretza:rustc_parse-session-diagnostics, r=da…
bors Sep 28, 2022
e1e3801
Auto merge of #101454 - cjgillot:concat-binders, r=estebank
bors Sep 28, 2022
021d246
Auto merge of #100719 - CohenArthur:rust-safe-intrinsic-attribute, r=…
bors Sep 28, 2022
91f15c8
Auto merge of #102384 - camelid:extrainfo, r=GuillaumeGomez
bors Sep 28, 2022
c130a60
Auto merge of #102328 - cuviper:ibm-stack-probes, r=nagisa
bors Sep 29, 2022
596ff7f
Auto merge of #102304 - lcnr:coherence-cleanup, r=compiler-errors
bors Sep 30, 2022
f37d280
Auto merge of #102164 - compiler-errors:rpitit-foreign, r=TaKO8Ki
bors Sep 30, 2022
32cf908
bless a miri test
WaffleLapkin Sep 23, 2022
a429148
Auto merge of #101986 - WaffleLapkin:move_lint_note_to_the_bottom, r=…
bors Oct 1, 2022
bcf9310
Auto merge of #102519 - Alexendoo:format-args-macro-str, r=m-ou-se
bors Oct 1, 2022
d411873
Change is_some_and to take by value
camsteffen Jun 21, 2022
d5d270e
Change feature name to is_some_and
camsteffen Jun 23, 2022
65ed928
Auto merge of #102193 - ferrocene:pa-remote-test-server-improvements,…
bors Oct 1, 2022
a94487c
Auto merge of #102424 - sunfishcode:sunfishcode/hidden-main, r=nagisa
bors Oct 2, 2022
ebe2484
Auto merge of #102535 - scottmcm:optimize-split-at-partition-point, r…
bors Oct 2, 2022
c5cdf74
Auto merge of #98354 - camsteffen:is-some-and-by-value, r=m-ou-se
bors Oct 2, 2022
27aacf7
Rollup merge of #102538 - cjgillot:def-span-ctxt, r=fee1-dead
Dylan-DPC Oct 2, 2022
9b517a4
Rollup merge of #102556 - WaffleLapkin:implied_by_btree_new, r=Mark-S…
Dylan-DPC Oct 2, 2022
cdc743a
Auto merge of #102586 - Dylan-DPC:rollup-g107h6z, r=Dylan-DPC
bors Oct 2, 2022
a7a822b
Auto merge of #102530 - cuviper:upgrade-i586-gnu, r=pietroalbini
bors Oct 2, 2022
a79ee0a
Auto merge of #102305 - flba-eb:remove_exclude_list, r=Mark-Simulacrum
bors Oct 2, 2022
ca969b7
Auto merge of #102503 - cuviper:x86-stack-probes, r=nagisa
bors Oct 3, 2022
338c50e
Auto merge of #102551 - bjorn3:cg_ssa_cleanup, r=davidtwco
bors Oct 3, 2022
0c5a645
Auto merge of #101768 - sunfishcode:sunfishcode/wasi-stdio-lock-asfd,…
bors Oct 4, 2022
c0a616e
Auto merge of #102438 - andrewpollack:add-target-rustc-flags, r=Mark-…
bors Oct 5, 2022
7ee48ea
Auto merge of #102394 - dingxiangfei2009:issue-102317, r=oli-obk
bors Oct 5, 2022
f6016e2
Auto merge of #102573 - RalfJung:mirisync, r=oli-obk
bors Oct 6, 2022
a47b834
Auto merge of #99324 - reez12g:issue-99144, r=jyn514
bors Oct 6, 2022
08e1f6f
Auto merge of #102707 - fmease:rustdoc-render-more-cross-crate-hrtbs-…
bors Oct 6, 2022
9125d0d
Auto merge of #99497 - vladimir-ea:stdlib_os_api_watchos, r=thomcc
bors Oct 6, 2022
8c41f67
rustup
RalfJung Oct 7, 2022
dc0faf3
clippy learned some new tricks
RalfJung Oct 7, 2022
3ef7f91
bless cargo-miri output
RalfJung Oct 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cargo-miri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(bootstrap, feature(let_else))]
#![allow(clippy::useless_format, clippy::derive_partial_eq_without_eq, rustc::internal)]

#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
acb8934fd57b3c2740c4abac0a5728c2c9b1423b
e42c4d7218b2596276152c5eb1e69335621f3086
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
)]
Expand Down
2 changes: 1 addition & 1 deletion src/shims/unix/android/dlsym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/shims/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,23 +1073,23 @@ 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
.map(|tup| {
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
.map(|tup| {
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(
Expand Down
1 change: 1 addition & 0 deletions src/stacked_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion src/stacked_borrows/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(()) }
Expand Down
5 changes: 4 additions & 1 deletion test-cargo-miri/run-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions test-cargo-miri/test.filter.cross-target.stdout.ref
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions test-cargo-miri/test.filter.stdout.ref
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

2 changes: 1 addition & 1 deletion tests/fail/concurrency/windows_join_detached.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/erroneous_const2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/fail/invalid_bool.rs
Original file line number Diff line number Diff line change
@@ -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) };
Expand Down
2 changes: 1 addition & 1 deletion tests/pass/float.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
24 changes: 24 additions & 0 deletions tests/pass/issues/issue-miri-2433.rs
Original file line number Diff line number Diff line change
@@ -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 change: 0 additions & 1 deletion tests/pass/u128.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(bench_black_box)]
use std::hint::black_box as b;

fn main() {
Expand Down