Skip to content

Commit cdfd027

Browse files
Merge branch 'main' into strIterchallenges
2 parents 14fc35a + 05d9d56 commit cdfd027

File tree

649 files changed

+18108
-9510
lines changed

Some content is hidden

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

649 files changed

+18108
-9510
lines changed

.github/workflows/update-subtree.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,27 @@ jobs:
5858
echo "NEXT_TOOLCHAIN_DATE=${NEXT_TOOLCHAIN_DATE}" >> $GITHUB_ENV
5959
echo "CURRENT_COMMIT_HASH=${CURRENT_COMMIT_HASH}" >> $GITHUB_ENV
6060
echo "NEXT_COMMIT_HASH=${NEXT_COMMIT_HASH}" >> $GITHUB_ENV
61+
KANI_COMMIT_HASH=$(git -C kani-tmp rev-parse HEAD)
62+
echo "KANI_COMMIT_HASH=${KANI_COMMIT_HASH}" >> $GITHUB_ENV
63+
64+
- name: Check for existing pull requests
65+
run: |
66+
cd verify-rust-std
67+
if gh pr list --json title --jq '.[] | select(.title | startswith("Update subtree/library to")) | .title' | grep -q .; then
68+
echo "SUBTREE_PR_EXISTS=yes" >> $GITHUB_ENV
69+
else
70+
echo "SUBTREE_PR_EXISTS=no" >> $GITHUB_ENV
71+
fi
72+
if gh pr list --json title --jq '.[] | select(.title | startswith("Merge subtree update for toolchain nightly-")) | .title' | grep -q .; then
73+
echo "MERGE_PR_EXISTS=yes" >> $GITHUB_ENV
74+
else
75+
echo "MERGE_PR_EXISTS=no" >> $GITHUB_ENV
76+
fi
77+
env:
78+
GH_TOKEN: ${{ github.token }}
6179

6280
- name: Update subtree/library locally
81+
if: ${{ env.SUBTREE_PR_EXISTS == 'no' }}
6382
run: |
6483
cd rust-tmp
6584
@@ -77,6 +96,9 @@ jobs:
7796
git remote add rust-filtered ../rust-tmp/
7897
git fetch rust-filtered
7998
git checkout -b subtree/library rust-filtered/subtree/library
99+
# The filter-subtree operation adds an extraneous `library/` folder containing the submodules
100+
# (c.f. https://github.com/model-checking/verify-rust-std/issues/249), so remove that before committing.
101+
rm -rf library
80102
SUBTREE_HEAD_MSG=$(git log --format=%s -n 1 origin/subtree/library)
81103
UPSTREAM_FROM=$(git log --grep="${SUBTREE_HEAD_MSG}" -n 1 --format=%H rust-filtered/subtree/library)
82104
UPSTREAM_HEAD=$(git log --format=%H -n 1 rust-filtered/subtree/library)
@@ -89,22 +111,23 @@ jobs:
89111
echo "MERGE_CONFLICTS=maybe" >> $GITHUB_ENV
90112
fi
91113
92-
- name: Create Pull Request
93-
if: ${{ env.MERGE_CONFLICTS != 'noop' }}
114+
- name: Create Pull Request to update subtree/library
115+
if: ${{ env.MERGE_CONFLICTS != 'noop' && env.SUBTREE_PR_EXISTS == 'no' }}
94116
uses: peter-evans/create-pull-request@v7
95117
with:
96118
title: 'Update subtree/library to ${{ env.NEXT_TOOLCHAIN_DATE }}'
97119
body: |
98120
This is an automated PR to update the subtree/library branch to the changes
99121
from ${{ env.CURRENT_TOOLCHAIN_DATE }} (${{ env.CURRENT_COMMIT_HASH }})
100122
to ${{ env.NEXT_TOOLCHAIN_DATE }} (${{ env.NEXT_COMMIT_HASH }}), inclusive.
123+
**Do not merge this PR using the merge queue. Instead, use the rebase strategy.**
101124
branch: update-subtree/library
102125
delete-branch: true
103126
base: subtree/library
104127
path: verify-rust-std
105128

106129
- name: Merge subtree/library changes
107-
if: ${{ env.MERGE_CONFLICTS != 'noop' }}
130+
if: ${{ env.MERGE_CONFLICTS != 'noop' && env.MERGE_PR_EXISTS == 'no' }}
108131
run: |
109132
cd verify-rust-std
110133
git checkout main
@@ -119,12 +142,15 @@ jobs:
119142
echo "MERGE_CONFLICTS=no" >> $GITHUB_ENV
120143
fi
121144
122-
sed -i "s/^channel = \"nightly-.*\"/channel = \"${NEXT_TOOLCHAIN_DATE}\"/" rust-toolchain.toml
145+
sed -i "s/^channel = \"nightly-.*\"/channel = \"nightly-${NEXT_TOOLCHAIN_DATE}\"/" rust-toolchain.toml
123146
git -c user.name=gitbot -c user.email=git@bot \
124147
commit -m "Update toolchain to ${NEXT_TOOLCHAIN_DATE}" rust-toolchain.toml
125-
148+
# Update kani-version.toml with the new Kani commit hash
149+
sed -i "s/commit = .*/commit = \"${KANI_COMMIT_HASH}\"/" tool_config/kani-version.toml
150+
git -c user.name=gitbot -c user.email=git@bot \
151+
commit -m "Update Kani version to ${KANI_COMMIT_HASH}" tool_config/kani-version.toml
126152
- name: Create Pull Request without conflicts
127-
if: ${{ env.MERGE_CONFLICTS == 'no' }}
153+
if: ${{ env.MERGE_CONFLICTS == 'no' && env.MERGE_PR_EXISTS == 'no' }}
128154
uses: peter-evans/create-pull-request@v7
129155
with:
130156
title: 'Merge subtree update for toolchain nightly-${{ env.NEXT_TOOLCHAIN_DATE }}'
@@ -139,7 +165,7 @@ jobs:
139165
path: verify-rust-std
140166

141167
- name: Create Pull Request with conflicts
142-
if: ${{ env.MERGE_CONFLICTS == 'yes' }}
168+
if: ${{ env.MERGE_CONFLICTS == 'yes' && env.MERGE_PR_EXISTS == 'no' }}
143169
uses: peter-evans/create-pull-request@v7
144170
with:
145171
title: 'Merge subtree update for toolchain nightly-${{ env.NEXT_TOOLCHAIN_DATE }}'

library/Cargo.lock

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

library/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ resolver = "1"
33
members = [
44
"std",
55
"sysroot",
6+
"coretests",
67
]
78

89
exclude = [
@@ -32,7 +33,7 @@ codegen-units = 10000
3233
[profile.release.package]
3334
addr2line.debug = 0
3435
addr2line.opt-level = "s"
35-
adler.debug = 0
36+
adler2.debug = 0
3637
gimli.debug = 0
3738
gimli.opt-level = "s"
3839
miniz_oxide.debug = 0

library/alloc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2021"
1010

1111
[dependencies]
1212
core = { path = "../core" }
13-
compiler_builtins = { version = "=0.1.138", features = ['rustc-dep-of-std'] }
13+
compiler_builtins = { version = "=0.1.145", features = ['rustc-dep-of-std'] }
1414
safety = { path = "../contracts/safety" }
1515

1616
[dev-dependencies]

library/alloc/benches/btree/map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ pub fn iter_10k(b: &mut Bencher) {
353353
}
354354

355355
#[bench]
356+
#[cfg_attr(target_os = "emscripten", ignore)] // hits an OOM
356357
pub fn iter_1m(b: &mut Bencher) {
357358
bench_iter(b, 1_000, 1_000_000);
358359
}

library/alloc/benches/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#![feature(iter_next_chunk)]
55
#![feature(repr_simd)]
66
#![feature(slice_partition_dedup)]
7-
#![cfg_attr(bootstrap, feature(strict_provenance))]
8-
#![cfg_attr(not(bootstrap), feature(strict_provenance_lints))]
7+
#![feature(strict_provenance_lints)]
98
#![feature(test)]
109
#![deny(fuzzy_provenance_casts)]
1110

library/alloc/benches/slice.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,25 @@ rotate!(rotate_medium_half, gen_random, 9158, 9158 / 2);
366366
rotate!(rotate_medium_half_plus_one, gen_random, 9158, 9158 / 2 + 1);
367367

368368
// Intended to use more RAM than the machine has cache
369+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
369370
rotate!(rotate_huge_by1, gen_random, 5 * 1024 * 1024, 1);
371+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
370372
rotate!(rotate_huge_by9199_u64, gen_random, 5 * 1024 * 1024, 9199);
373+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
371374
rotate!(rotate_huge_by9199_bytes, gen_random_bytes, 5 * 1024 * 1024, 9199);
375+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
372376
rotate!(rotate_huge_by9199_strings, gen_strings, 5 * 1024 * 1024, 9199);
377+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
373378
rotate!(rotate_huge_by9199_big, gen_big_random, 5 * 1024 * 1024, 9199);
379+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
374380
rotate!(rotate_huge_by1234577_u64, gen_random, 5 * 1024 * 1024, 1234577);
381+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
375382
rotate!(rotate_huge_by1234577_bytes, gen_random_bytes, 5 * 1024 * 1024, 1234577);
383+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
376384
rotate!(rotate_huge_by1234577_strings, gen_strings, 5 * 1024 * 1024, 1234577);
385+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
377386
rotate!(rotate_huge_by1234577_big, gen_big_random, 5 * 1024 * 1024, 1234577);
387+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
378388
rotate!(rotate_huge_half, gen_random, 5 * 1024 * 1024, 5 * 1024 * 1024 / 2);
389+
#[cfg(not(target_os = "emscripten"))] // hits an OOM
379390
rotate!(rotate_huge_half_plus_one, gen_random, 5 * 1024 * 1024, 5 * 1024 * 1024 / 2 + 1);

library/alloc/benches/vec.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ fn bench_in_place_collect_droppable(b: &mut Bencher) {
547547
})
548548
}
549549

550+
// node.js gives out of memory error to use with length 1_100_000
551+
#[cfg(target_os = "emscripten")]
552+
const LEN: usize = 4096;
553+
554+
#[cfg(not(target_os = "emscripten"))]
550555
const LEN: usize = 16384;
551556

552557
#[bench]

library/alloc/src/alloc.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ use core::hint;
1010
#[cfg(not(test))]
1111
use core::ptr::{self, NonNull};
1212

13-
#[cfg(test)]
14-
mod tests;
15-
1613
extern "Rust" {
1714
// These are the magic symbols to call the global allocator. rustc generates
1815
// them to call `__rg_alloc` etc. if there is a `#[global_allocator]` attribute
@@ -342,7 +339,7 @@ unsafe impl Allocator for Global {
342339
}
343340
}
344341

345-
/// The allocator for unique pointers.
342+
/// The allocator for `Box`.
346343
#[cfg(all(not(no_global_oom_handling), not(test)))]
347344
#[lang = "exchange_malloc"]
348345
#[inline]

0 commit comments

Comments
 (0)