Skip to content

Miri subtree update #131036

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

Merged
merged 43 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0332581
add test for new abort_unwind function
RalfJung Sep 23, 2024
c36614b
Auto merge of #3906 - RalfJung:abort_unwind, r=RalfJung
bors Sep 23, 2024
51d90bb
fix workflow permissions
RalfJung Sep 23, 2024
09e8122
Auto merge of #3907 - RalfJung:perm, r=RalfJung
bors Sep 23, 2024
3a108a7
looks like we need more permissions
RalfJung Sep 24, 2024
d47e254
Auto merge of #3908 - RalfJung:perms, r=RalfJung
bors Sep 24, 2024
8885ae9
Scope CI permissions to the job that needs it
Kobzol Sep 24, 2024
878925e
Auto merge of #3909 - Kobzol:ci-permissions, r=RalfJung
bors Sep 24, 2024
f319ce7
Preparing for merge from rustc
Sep 25, 2024
3209f2a
Merge from rustc
Sep 25, 2024
e057c17
fmt
Sep 25, 2024
cbe2ec0
add test for std::random
RalfJung Sep 25, 2024
60265e4
avoid using HashMap in fs test
RalfJung Sep 25, 2024
a374d1c
update BASIC test list: no longer test HashMap, add libc-mem instead …
RalfJung Sep 25, 2024
9433958
disable AVR test since it doesn't work
RalfJung Sep 25, 2024
b862076
Auto merge of #3913 - rust-lang:rustup-2024-09-25, r=RalfJung
bors Sep 25, 2024
b44888f
Android: Fixed tests for libc time API
YohDeadfall Sep 24, 2024
c69b457
enable pthread_cond_timedwait test on Android
RalfJung Sep 25, 2024
4ef8f60
Auto merge of #3910 - YohDeadfall:android-libc-time, r=RalfJung
bors Sep 25, 2024
897e941
switch custom target JSON test to a less exotic target
RalfJung Sep 25, 2024
b7fe0b4
Auto merge of #3915 - RalfJung:target-json-test, r=RalfJung
bors Sep 25, 2024
824884d
Preparing for merge from rustc
Sep 26, 2024
51087d2
Merge from rustc
Sep 26, 2024
adbaf13
bump rustc-build-sysroot version
RalfJung Sep 26, 2024
fcc59fe
Auto merge of #3917 - RalfJung:sysroot, r=RalfJung
bors Sep 26, 2024
294fdb8
clippy
RalfJung Sep 26, 2024
bf78aec
fix clippy::needless_return
RalfJung Sep 26, 2024
18aa926
remove some clippy lints from the list that we do not even trigger an…
RalfJung Sep 26, 2024
c361d52
Auto merge of #3916 - rust-lang:rustup-2024-09-26, r=RalfJung
bors Sep 26, 2024
74d7b22
Update cc to 1.1.22
ChrisDenton Sep 27, 2024
68790c0
Auto merge of #3920 - ChrisDenton:cc, r=RalfJung
bors Sep 27, 2024
c1401da
add tests for validity of Box with custom allocator
RalfJung Sep 28, 2024
5790eb9
Auto merge of #3922 - RalfJung:box-custom-alloc, r=RalfJung
bors Sep 28, 2024
f14f72e
implements arc4random_buf shim for freebsd/solarish platforms.
devnexen Sep 26, 2024
7cb5a79
make sure the new function is tested
RalfJung Sep 28, 2024
dd572c4
Auto merge of #3918 - devnexen:solaris_arc4random_buf, r=RalfJung
bors Sep 28, 2024
ab8fa80
skip old getrandom crate on Solaris
RalfJung Sep 29, 2024
c38fa99
Auto merge of #3925 - RalfJung:solarish-random, r=RalfJung
bors Sep 29, 2024
3e4f64c
bump few deps
klensy Sep 29, 2024
6abc731
Auto merge of #3926 - klensy:deps-up2, r=RalfJung
bors Sep 29, 2024
ad8a5ce
let rustfmt format imports
RalfJung Sep 29, 2024
e239d07
Auto merge of #3927 - RalfJung:fmt-imports, r=oli-obk,saethlin
bors Sep 29, 2024
8c0adc6
update lockfile
RalfJung Sep 29, 2024
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
2 changes: 2 additions & 0 deletions src/tools/miri/cargo-miri/src/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ pub fn phase_runner(mut binary_args: impl Iterator<Item = String>, phase: Runner
match phase {
RunnerPhase::Rustdoc => {
cmd.stdin(std::process::Stdio::piped());
// the warning is wrong, we have a `wait` inside the `scope` closure.
#[expect(clippy::zombie_processes)]
let mut child = cmd.spawn().expect("failed to spawn process");
let child_stdin = child.stdin.take().unwrap();
// Write stdin in a background thread, as it may block.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1b5aa96d6016bafe50e071b45d4d2e3c90fd766f
76ed7a1fa40c3f54d3fd3f834e12bf9c932d0146
2 changes: 1 addition & 1 deletion src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl NewPermission {
/// F2b: No `SharedReadWrite` or `Unique` will ever be added on top of our `SharedReadOnly`.
/// F3: If an access happens with an `&` outside `UnsafeCell`,
/// it requires the `SharedReadOnly` to still be in the stack.

///
/// Core relation on `Permission` to define which accesses are allowed
impl Permission {
/// This defines for a given permission, whether it permits the given kind of access.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/concurrency/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
}
),
);
return Ok(());
Ok(())
}

/// Wake up some thread (if there is any) sleeping on the conditional
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/concurrency/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
// https://github.com/rust-lang/miri/issues/1763). In this case,
// just do nothing, which effectively just returns to the
// scheduler.
return Ok(());
Ok(())
}

#[inline]
Expand Down
3 changes: 0 additions & 3 deletions src/tools/miri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
clippy::derived_hash_with_manual_eq,
clippy::too_many_arguments,
clippy::type_complexity,
clippy::single_element_loop,
clippy::needless_return,
clippy::bool_to_int_with_if,
clippy::box_default,
clippy::needless_question_mark,
clippy::needless_lifetimes,
clippy::too_long_first_doc_paragraph,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
// and not execute any Miri shim. Somewhat unintuitively doing so is done
// by returning `NotSupported`, which triggers the `lookup_exported_symbol`
// fallback case in `emulate_foreign_item`.
return Ok(EmulateItemResult::NotSupported);
Ok(EmulateItemResult::NotSupported)
}
AllocatorKind::Default => {
default(this)?;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
fn get_env_var(&mut self, name: &OsStr) -> InterpResult<'tcx, Option<OsString>> {
let this = self.eval_context_ref();
match &this.machine.env_vars {
EnvVars::Uninit => return Ok(None),
EnvVars::Uninit => Ok(None),
EnvVars::Unix(vars) => vars.get(this, name),
EnvVars::Windows(vars) => vars.get(name),
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/shims/unix/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
this.write_bytes_ptr(buf, bytes[..read_bytes].iter().copied())?;
// The actual read size is always less than what got originally requested so this cannot fail.
this.write_int(u64::try_from(read_bytes).unwrap(), dest)?;
return Ok(());
Ok(())
}
Err(e) => {
this.set_last_error_from_io_error(e)?;
this.write_int(-1, dest)?;
return Ok(());
Ok(())
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions src/tools/miri/src/shims/unix/linux/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,19 +401,19 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
/// list about file descriptors in the interest list that have some
/// events available. Up to `maxevents` are returned by `epoll_wait()`.
/// The `maxevents` argument must be greater than zero.

///
/// The `timeout` argument specifies the number of milliseconds that
/// `epoll_wait()` will block. Time is measured against the
/// CLOCK_MONOTONIC clock. If the timeout is zero, the function will not block,
/// while if the timeout is -1, the function will block
/// until at least one event has been retrieved (or an error
/// occurred).

///
/// A call to `epoll_wait()` will block until either:
/// • a file descriptor delivers an event;
/// • the call is interrupted by a signal handler; or
/// • the timeout expires.

///
/// Note that the timeout interval will be rounded up to the system
/// clock granularity, and kernel scheduling delays mean that the
/// blocking interval may overrun by a small amount. Specifying a
Expand Down Expand Up @@ -596,7 +596,7 @@ fn ready_list_next(
return Some(epoll_event_instance);
}
}
return None;
None
}

/// This helper function checks whether an epoll notification should be triggered for a specific
Expand All @@ -623,9 +623,10 @@ fn check_and_update_one_event_interest<'tcx>(
let event_instance = EpollEventInstance::new(flags, epoll_event_interest.data);
// Triggers the notification by inserting it to the ready list.
ready_list.insert(epoll_key, event_instance);
return Ok(true);
Ok(true)
} else {
Ok(false)
}
return Ok(false);
}

/// Callback function after epoll_wait unblocks
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/unix/linux/eventfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl FileDescription for Event {
/// write either blocks until a read is performed on the
/// file descriptor, or fails with the error EAGAIN if the
/// file descriptor has been made nonblocking.

///
/// A write fails with the error EINVAL if the size of the
/// supplied buffer is less than 8 bytes, or if an attempt is
/// made to write the value 0xffffffffffffffff.
Expand Down
4 changes: 2 additions & 2 deletions src/tools/miri/src/shims/windows/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ pub fn is_dyn_sym(name: &str) -> bool {

#[cfg(windows)]
fn win_absolute<'tcx>(path: &Path) -> InterpResult<'tcx, io::Result<PathBuf>> {
// We are on Windows so we can simply lte the host do this.
return Ok(path::absolute(path));
// We are on Windows so we can simply let the host do this.
Ok(path::absolute(path))
}

#[cfg(unix)]
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/shims/windows/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
}
),
);
return Ok(());
Ok(())
}

fn InitOnceComplete(
Expand Down