Skip to content

Commit cb2e15c

Browse files
Merge branch 'main' into strIterchallenges
2 parents 4ae8c79 + 0269891 commit cb2e15c

550 files changed

Lines changed: 12561 additions & 10440 deletions

File tree

Some content is hidden

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

.github/workflows/update-subtree.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ jobs:
117117
git remote add rust-filtered ../rust-tmp/
118118
git fetch rust-filtered
119119
git checkout -b subtree/library rust-filtered/subtree/library
120+
# The checkout still leaves behind the library folder with submodules.
121+
# We need to remove this as we'd otherwise have the create-pull-request
122+
# action create an extra commit.
123+
rm -rf library
120124
SUBTREE_HEAD_MSG=$(git log --format=%s -n 1 origin/subtree/library)
121125
UPSTREAM_FROM=$(git log --grep="${SUBTREE_HEAD_MSG}" -n 1 --format=%H rust-filtered/subtree/library)
122126
UPSTREAM_HEAD=$(git log --format=%H -n 1 rust-filtered/subtree/library)

doc/mdbook-metrics/src/main.rs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ fn run_kani_metrics_script() -> Result<(), Error> {
4444
Command::new("python")
4545
.args(&[
4646
"kani_std_analysis.py",
47+
"--crate",
48+
"core",
49+
"--metrics-file",
50+
"metrics-data-core.json",
51+
"--plot-only",
52+
"--plot-dir",
53+
&tools_path.to_string_lossy(),
54+
])
55+
.stdout(std::process::Stdio::null())
56+
.stderr(std::process::Stdio::null())
57+
.status()?;
58+
59+
Command::new("python")
60+
.args(&[
61+
"kani_std_analysis.py",
62+
"--crate",
63+
"std",
64+
"--metrics-file",
65+
"metrics-data-std.json",
4766
"--plot-only",
4867
"--plot-dir",
4968
&tools_path.to_string_lossy(),
@@ -83,12 +102,19 @@ fn add_graphs(chapter: &mut Chapter) {
83102
84103
Note that these metrics are for x86-64 architectures.
85104
86-
## `core`
105+
### `core`
87106
![Unsafe Metrics](core_unsafe_metrics.png)
88107
89108
![Safe Abstractions Metrics](core_safe_abstractions_metrics.png)
90109
91110
![Safe Metrics](core_safe_metrics.png)
111+
112+
### `std`
113+
![Unsafe Metrics](std_unsafe_metrics.png)
114+
115+
![Safe Abstractions Metrics](std_safe_abstractions_metrics.png)
116+
117+
![Safe Metrics](std_safe_metrics.png)
92118
"#;
93119

94120
chapter.content.push_str(new_content);

doc/src/challenges/0006-nonnull.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Challenge 6: Safety of NonNull
22

3-
- **Status:** Open
3+
- **Status:** Resolved
44
- **Tracking Issue:** [#53](https://github.com/model-checking/verify-rust-std/issues/53)
55
- **Start date:** *2024/08/16*
66
- **End date:** *2025/04/10*
77
- **Reward:** *N/A*
8-
8+
- **Contributors**: [Quinyuan Wu](https://github.com/QinyuanWu), [Daniel Tu](https://github.com/danielhumanmod), [Dhvani Kapadia](https://github.com/Dhvani-Kapadia) and [Jiun Chi Yang](https://github.com/Jimmycreative)
99
-------------------
1010

1111

doc/src/challenges/0008-smallsort.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
## Goal
1313

14-
The implementations of the traits `StableSmallSortTypeImpl`, `UnstableSmallSortTypeImpl`, and `UnstableSmallSortFreezeTypeImpl` in the `smallsort` [module](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/sort/shared/smallsort.rs) of the Rust standard library are the sorting
15-
algorithms optimized for slices with small lengths.
14+
The implementations of the traits `StableSmallSortTypeImpl`, `UnstableSmallSortTypeImpl`, and `UnstableSmallSortFreezeTypeImpl` in the `smallsort` [module](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/sort/shared/smallsort.rs) of the Rust standard library are the sorting algorithms with optimized implementations for slices with small lengths.
1615
In this challenge, the goal is to, first prove the memory safety of the public functions in the `smallsort` module, and, second, write contracts for them to
1716
show that the sorting algorithms actually sort the slices.
1817

doc/src/challenges/0012-nonzero.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ Verify the safety of the following functions and methods (all located within `co
7373
| `from_mut` |
7474
| `from_mut_unchecked` |
7575

76-
You are not required to write correctness contracts for these methods (e.g., for `max`, ensuring that the `result` is indeed the maximum of the inputs), but it would be great to do so!
7776

7877
### List of UBs
7978

doc/src/challenges/0014-convert-num.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Challenge 14: Safety of Primitive Conversions
22

3-
- **Status:** Open
4-
- **Tracking Issue:** https://github.com/model-checking/verify-rust-std/issues/220
3+
- **Status:** Resolved
4+
- **Tracking Issue:** [#220](https://github.com/model-checking/verify-rust-std/issues/220)
55
- **Start date:** 2024/12/15
66
- **End date:** 2025/2/28
77
- **Prize:** *TBD*
8-
8+
- **Contributors**: [Shoyu Vanilla](https://github.com/ShoyuVanilla)
99
-------------------
1010

1111
## Goal

doc/src/challenges/0015-intrinsics-simd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
- **Status:** Open
44
- **Reward:**
55
- **Solution:**
6-
- **Tracking Issue:** https://github.com/model-checking/verify-rust-std/issues/173
6+
- **Tracking Issue:** [#173](https://github.com/model-checking/verify-rust-std/issues/173)
77
- **Start date:** 2025/02/01
88
- **End date:** 2025/08/01
99

library/Cargo.lock

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

library/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ members = [
44
"std",
55
"sysroot",
66
"coretests",
7+
"alloctests",
78
]
89

910
exclude = [

library/alloc/Cargo.toml

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
cargo-features = ["public-dependency"]
2+
13
[package]
24
name = "alloc"
35
version = "0.0.0"
@@ -6,35 +8,17 @@ repository = "https://github.com/rust-lang/rust.git"
68
description = "The Rust core allocation and collections library"
79
autotests = false
810
autobenches = false
9-
edition = "2021"
11+
edition = "2024"
12+
13+
[lib]
14+
test = false
15+
bench = false
1016

1117
[dependencies]
12-
core = { path = "../core" }
13-
compiler_builtins = { version = "=0.1.145", features = ['rustc-dep-of-std'] }
18+
core = { path = "../core", public = true }
19+
compiler_builtins = { version = "=0.1.151", features = ['rustc-dep-of-std'] }
1420
safety = { path = "../contracts/safety" }
1521

16-
[dev-dependencies]
17-
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
18-
rand_xorshift = "0.3.0"
19-
20-
[[test]]
21-
name = "alloctests"
22-
path = "tests/lib.rs"
23-
24-
[[test]]
25-
name = "vec_deque_alloc_error"
26-
path = "tests/vec_deque_alloc_error.rs"
27-
28-
[[bench]]
29-
name = "allocbenches"
30-
path = "benches/lib.rs"
31-
test = true
32-
33-
[[bench]]
34-
name = "vec_deque_append_bench"
35-
path = "benches/vec_deque_append.rs"
36-
harness = false
37-
3822
[features]
3923
compiler-builtins-mem = ['compiler_builtins/mem']
4024
compiler-builtins-c = ["compiler_builtins/c"]

0 commit comments

Comments
 (0)