Skip to content

Commit 88462f5

Browse files
Merge branch 'main' into repeatinvariant
2 parents 67758db + 1231f86 commit 88462f5

File tree

77 files changed

+3726
-888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3726
-888
lines changed

doc/src/challenges/0005-linked-list.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Challenge 5: Verify functions iterating over inductive data type: `linked_list`
22

3-
- **Status:** Open
3+
- **Status:** Resolved
44
- **Tracking Issue:** [#29](https://github.com/model-checking/verify-rust-std/issues/29)
55
- **Start date:** *2024/07/01*
6-
- **End date:** *2025/04/10*
6+
- **End date:** *2025/08/12*
77
- **Reward:** *5,000 USD*
8+
- **Contributors:** [Bart Jacobs](https://github.com/btj)
89

910
-------------------
1011

library/Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/std/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ crate-type = ["dylib", "rlib"]
1414

1515
[dependencies]
1616
alloc = { path = "../alloc", public = true }
17+
# std no longer uses cfg-if directly, but the included copy of backtrace does.
1718
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
1819
panic_unwind = { path = "../panic_unwind", optional = true }
1920
panic_abort = { path = "../panic_abort" }

library/std/src/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3119,7 +3119,7 @@ pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
31193119
/// On UNIX-like systems, this function will update the permission bits
31203120
/// of the file pointed to by the symlink.
31213121
///
3122-
/// Note that this behavior can lead to privalage escalation vulnerabilities,
3122+
/// Note that this behavior can lead to privilege escalation vulnerabilities,
31233123
/// where the ability to create a symlink in one directory allows you to
31243124
/// cause the permissions of another file or directory to be modified.
31253125
///

library/std/src/io/copy.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ where
6363
R: Read,
6464
W: Write,
6565
{
66-
cfg_if::cfg_if! {
67-
if #[cfg(any(target_os = "linux", target_os = "android"))] {
66+
cfg_select! {
67+
any(target_os = "linux", target_os = "android") => {
6868
crate::sys::kernel_copy::copy_spec(reader, writer)
69-
} else {
69+
}
70+
_ => {
7071
generic_copy(reader, writer)
7172
}
7273
}

library/std/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@
331331
#![feature(bstr)]
332332
#![feature(bstr_internals)]
333333
#![feature(cast_maybe_uninit)]
334+
#![feature(cfg_select)]
334335
#![feature(char_internals)]
335336
#![feature(clone_to_uninit)]
336337
#![feature(const_cmp)]

library/std/src/os/unix/net/stream.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
cfg_if::cfg_if! {
2-
if #[cfg(any(
1+
cfg_select! {
2+
any(
33
target_os = "linux", target_os = "android",
44
target_os = "hurd",
55
target_os = "dragonfly", target_os = "freebsd",
66
target_os = "openbsd", target_os = "netbsd",
77
target_os = "solaris", target_os = "illumos",
88
target_os = "haiku", target_os = "nto",
9-
target_os = "cygwin"))] {
9+
target_os = "cygwin",
10+
) => {
1011
use libc::MSG_NOSIGNAL;
11-
} else {
12+
}
13+
_ => {
1214
const MSG_NOSIGNAL: core::ffi::c_int = 0x0;
1315
}
1416
}

library/std/src/os/unix/process.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
55
#![stable(feature = "rust1", since = "1.0.0")]
66

7-
use cfg_if::cfg_if;
8-
97
use crate::ffi::OsStr;
108
use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd};
119
use crate::path::Path;
1210
use crate::sealed::Sealed;
1311
use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
1412
use crate::{io, process, sys};
1513

16-
cfg_if! {
17-
if #[cfg(any(target_os = "vxworks", target_os = "espidf", target_os = "horizon", target_os = "vita"))] {
14+
cfg_select! {
15+
any(target_os = "vxworks", target_os = "espidf", target_os = "horizon", target_os = "vita") => {
1816
type UserId = u16;
1917
type GroupId = u16;
20-
} else if #[cfg(target_os = "nto")] {
18+
}
19+
target_os = "nto" => {
2120
// Both IDs are signed, see `sys/target_nto.h` of the QNX Neutrino SDP.
2221
// Only positive values should be used, see e.g.
2322
// https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/s/setuid.html
2423
type UserId = i32;
2524
type GroupId = i32;
26-
} else {
25+
}
26+
_ => {
2727
type UserId = u32;
2828
type GroupId = u32;
2929
}

library/std/src/sync/reentrant_lock.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use cfg_if::cfg_if;
2-
31
use crate::cell::UnsafeCell;
42
use crate::fmt;
53
use crate::ops::Deref;
@@ -87,8 +85,8 @@ pub struct ReentrantLock<T: ?Sized> {
8785
data: T,
8886
}
8987

90-
cfg_if!(
91-
if #[cfg(target_has_atomic = "64")] {
88+
cfg_select!(
89+
target_has_atomic = "64" => {
9290
use crate::sync::atomic::{Atomic, AtomicU64, Ordering::Relaxed};
9391

9492
struct Tid(Atomic<u64>);
@@ -110,7 +108,8 @@ cfg_if!(
110108
self.0.store(value, Relaxed);
111109
}
112110
}
113-
} else {
111+
}
112+
_ => {
114113
/// Returns the address of a TLS variable. This is guaranteed to
115114
/// be unique across all currently alive threads.
116115
fn tls_addr() -> usize {

library/std/src/sys/alloc/mod.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,29 +68,37 @@ unsafe fn realloc_fallback(
6868
}
6969
}
7070

71-
cfg_if::cfg_if! {
72-
if #[cfg(any(
71+
cfg_select! {
72+
any(
7373
target_family = "unix",
7474
target_os = "wasi",
7575
target_os = "teeos",
7676
target_os = "trusty",
77-
))] {
77+
) => {
7878
mod unix;
79-
} else if #[cfg(target_os = "windows")] {
79+
}
80+
target_os = "windows" => {
8081
mod windows;
81-
} else if #[cfg(target_os = "hermit")] {
82+
}
83+
target_os = "hermit" => {
8284
mod hermit;
83-
} else if #[cfg(all(target_vendor = "fortanix", target_env = "sgx"))] {
85+
}
86+
all(target_vendor = "fortanix", target_env = "sgx") => {
8487
mod sgx;
85-
} else if #[cfg(target_os = "solid_asp3")] {
88+
}
89+
target_os = "solid_asp3" => {
8690
mod solid;
87-
} else if #[cfg(target_os = "uefi")] {
91+
}
92+
target_os = "uefi" => {
8893
mod uefi;
89-
} else if #[cfg(target_family = "wasm")] {
94+
}
95+
target_family = "wasm" => {
9096
mod wasm;
91-
} else if #[cfg(target_os = "xous")] {
97+
}
98+
target_os = "xous" => {
9299
mod xous;
93-
} else if #[cfg(target_os = "zkvm")] {
100+
}
101+
target_os = "zkvm" => {
94102
mod zkvm;
95103
}
96104
}

0 commit comments

Comments
 (0)