Skip to content

Merge subtree update for toolchain nightly-2025-02-21 #11

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
132 changes: 91 additions & 41 deletions library/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion library/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resolver = "1"
members = [
"std",
"sysroot",
"coretests",
]

exclude = [
Expand Down Expand Up @@ -32,7 +33,7 @@ codegen-units = 10000
[profile.release.package]
addr2line.debug = 0
addr2line.opt-level = "s"
adler.debug = 0
adler2.debug = 0
gimli.debug = 0
gimli.opt-level = "s"
miniz_oxide.debug = 0
Expand Down
8 changes: 6 additions & 2 deletions library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ edition = "2021"

[dependencies]
core = { path = "../core" }
<<<<<<< HEAD
compiler_builtins = { version = "=0.1.138", features = ['rustc-dep-of-std'] }
safety = { path = "../contracts/safety" }
=======
compiler_builtins = { version = "=0.1.146", features = ['rustc-dep-of-std'] }
>>>>>>> 1ce7810500c125b4cba495211f908db2a9b1f1cb

[dev-dependencies]
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
rand_xorshift = "0.3.0"
rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
rand_xorshift = "0.4.0"

[[test]]
name = "alloctests"
Expand Down
25 changes: 13 additions & 12 deletions library/alloc/benches/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ macro_rules! map_insert_rand_bench {
($name: ident, $n: expr, $map: ident) => {
#[bench]
pub fn $name(b: &mut Bencher) {
let n: usize = $n;
let n: u32 = $n;
let mut map = $map::new();
// setup
let mut rng = crate::bench_rng();

for _ in 0..n {
let i = rng.gen::<usize>() % n;
let i = rng.random::<u32>() % n;
map.insert(i, i);
}

// measure
b.iter(|| {
let k = rng.gen::<usize>() % n;
let k = rng.random::<u32>() % n;
map.insert(k, k);
map.remove(&k);
});
Expand Down Expand Up @@ -57,13 +57,13 @@ macro_rules! map_from_iter_rand_bench {
($name: ident, $n: expr, $map: ident) => {
#[bench]
pub fn $name(b: &mut Bencher) {
let n: usize = $n;
let n: u32 = $n;
// setup
let mut rng = crate::bench_rng();
let mut vec = Vec::with_capacity(n);
let mut vec = Vec::with_capacity(n as usize);

for _ in 0..n {
let i = rng.gen::<usize>() % n;
let i = rng.random::<u32>() % n;
vec.push((i, i));
}

Expand Down Expand Up @@ -102,11 +102,11 @@ macro_rules! map_find_rand_bench {
#[bench]
pub fn $name(b: &mut Bencher) {
let mut map = $map::new();
let n: usize = $n;
let n: u32 = $n;

// setup
let mut rng = crate::bench_rng();
let mut keys: Vec<_> = (0..n).map(|_| rng.gen::<usize>() % n).collect();
let mut keys: Vec<_> = (0..n).map(|_| rng.random::<u32>() % n).collect();

for &k in &keys {
map.insert(k, k);
Expand All @@ -115,9 +115,9 @@ macro_rules! map_find_rand_bench {
keys.shuffle(&mut rng);

// measure
let mut i = 0;
let mut i = 0u32;
b.iter(|| {
let t = map.get(&keys[i]);
let t = map.get(&keys[i as usize]);
i = (i + 1) % n;
black_box(t);
})
Expand Down Expand Up @@ -171,7 +171,7 @@ fn bench_iteration(b: &mut Bencher, size: i32) {
let mut rng = crate::bench_rng();

for _ in 0..size {
map.insert(rng.gen(), rng.gen());
map.insert(rng.random(), rng.random());
}

b.iter(|| {
Expand Down Expand Up @@ -201,7 +201,7 @@ fn bench_iteration_mut(b: &mut Bencher, size: i32) {
let mut rng = crate::bench_rng();

for _ in 0..size {
map.insert(rng.gen(), rng.gen());
map.insert(rng.random(), rng.random());
}

b.iter(|| {
Expand Down Expand Up @@ -353,6 +353,7 @@ pub fn iter_10k(b: &mut Bencher) {
}

#[bench]
#[cfg_attr(target_os = "emscripten", ignore)] // hits an OOM
pub fn iter_1m(b: &mut Bencher) {
bench_iter(b, 1_000, 1_000_000);
}
Expand Down
Loading