Skip to content

Commit 094ac61

Browse files
authored
Merge pull request #19126 from lnicola/sync-from-rust
minor: Sync from downstream
2 parents 5db5b3f + 30811cf commit 094ac61

File tree

125 files changed

+1725
-810
lines changed

Some content is hidden

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

125 files changed

+1725
-810
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ test = false # we have no unit tests
1818
doctest = false # and no doc tests
1919

2020
[dependencies]
21-
getrandom = { version = "0.2", features = ["std"] }
22-
rand = "0.8"
21+
getrandom = { version = "0.3", features = ["std"] }
22+
rand = "0.9"
2323
smallvec = { version = "1.7", features = ["drain_filter"] }
2424
aes = { version = "0.8.3", features = ["hazmat"] }
2525
measureme = "11"
@@ -47,8 +47,8 @@ windows-sys = { version = "0.52", features = [
4747
] }
4848

4949
[dev-dependencies]
50+
ui_test = "0.28.0"
5051
colored = "2"
51-
ui_test = "0.26.5"
5252
rustc_version = "0.4"
5353
regex = "1.5.5"
5454
tempfile = "3"

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
01706e1a34c87656fcbfce198608f4cd2ac6461a
1+
6dd75f0d6802f56564f5f9c947a85ded286d3986

src/alloc_addresses/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
217217
// We have to pick a fresh address.
218218
// Leave some space to the previous allocation, to give it some chance to be less aligned.
219219
// We ensure that `(global_state.next_base_addr + slack) % 16` is uniformly distributed.
220-
let slack = rng.gen_range(0..16);
220+
let slack = rng.random_range(0..16);
221221
// From next_base_addr + slack, round up to adjust for alignment.
222222
let base_addr = global_state
223223
.next_base_addr

src/alloc_addresses/reuse_pool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl ReusePool {
5858
// We don't remember stack addresses: there's a lot of them (so the perf impact is big),
5959
// and we only want to reuse stack slots within the same thread or else we'll add a lot of
6060
// undesired synchronization.
61-
if kind == MemoryKind::Stack || !rng.gen_bool(self.address_reuse_rate) {
61+
if kind == MemoryKind::Stack || !rng.random_bool(self.address_reuse_rate) {
6262
return;
6363
}
6464
let clock = clock();
@@ -88,10 +88,10 @@ impl ReusePool {
8888
thread: ThreadId,
8989
) -> Option<(u64, Option<VClock>)> {
9090
// Determine whether we'll even attempt a reuse. As above, we don't do reuse for stack addresses.
91-
if kind == MemoryKind::Stack || !rng.gen_bool(self.address_reuse_rate) {
91+
if kind == MemoryKind::Stack || !rng.random_bool(self.address_reuse_rate) {
9292
return None;
9393
}
94-
let cross_thread_reuse = rng.gen_bool(self.address_reuse_cross_thread_rate);
94+
let cross_thread_reuse = rng.random_bool(self.address_reuse_cross_thread_rate);
9595
// Determine the pool to take this from.
9696
let subpool = self.subpool(align);
9797
// Let's see if we can find something of the right size. We want to find the full range of
@@ -118,7 +118,7 @@ impl ReusePool {
118118
return None;
119119
}
120120
// Pick a random element with the desired size.
121-
let idx = rng.gen_range(begin..end);
121+
let idx = rng.random_range(begin..end);
122122
// Remove it from the pool and return.
123123
let (chosen_addr, chosen_size, chosen_thread, clock) = subpool.remove(idx);
124124
debug_assert!(chosen_size >= size && chosen_addr % align.bytes() == 0);

0 commit comments

Comments
 (0)