Skip to content

Commit f5d8b9d

Browse files
committed
Merge commit '9d7b4208352e30d0e2a3090a964ef6f711c407e9' into sync-2024-08-07
2 parents 01e4da0 + 9d7b420 commit f5d8b9d

File tree

642 files changed

+8219
-4867
lines changed

Some content is hidden

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

642 files changed

+8219
-4867
lines changed

library/Cargo.lock

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

library/Cargo.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[workspace]
2+
resolver = "1"
3+
members = [
4+
"std",
5+
"sysroot",
6+
]
7+
8+
exclude = [
9+
# stdarch has its own Cargo workspace
10+
"stdarch",
11+
]
12+
13+
[profile.release.package.compiler_builtins]
14+
# For compiler-builtins we always use a high number of codegen units.
15+
# The goal here is to place every single intrinsic into its own object
16+
# file to avoid symbol clashes with the system libgcc if possible. Note
17+
# that this number doesn't actually produce this many object files, we
18+
# just don't create more than this number of object files.
19+
#
20+
# It's a bit of a bummer that we have to pass this here, unfortunately.
21+
# Ideally this would be specified through an env var to Cargo so Cargo
22+
# knows how many CGUs are for this specific crate, but for now
23+
# per-crate configuration isn't specifiable in the environment.
24+
codegen-units = 10000
25+
26+
# These dependencies of the standard library implement symbolication for
27+
# backtraces on most platforms. Their debuginfo causes both linking to be slower
28+
# (more data to chew through) and binaries to be larger without really all that
29+
# much benefit. This section turns them all to down to have no debuginfo which
30+
# helps to improve link times a little bit.
31+
[profile.release.package]
32+
addr2line.debug = 0
33+
adler.debug = 0
34+
gimli.debug = 0
35+
miniz_oxide.debug = 0
36+
object.debug = 0
37+
rustc-demangle.debug = 0
38+
39+
[patch.crates-io]
40+
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on
41+
# here
42+
rustc-std-workspace-core = { path = 'rustc-std-workspace-core' }
43+
rustc-std-workspace-alloc = { path = 'rustc-std-workspace-alloc' }
44+
rustc-std-workspace-std = { path = 'rustc-std-workspace-std' }

library/alloc/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ edition = "2021"
1010

1111
[dependencies]
1212
core = { path = "../core" }
13-
compiler_builtins = { version = "0.1.40", features = ['rustc-dep-of-std'] }
13+
compiler_builtins = { version = "0.1.114", features = ['rustc-dep-of-std'] }
14+
15+
[target.'cfg(not(any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")))'.dependencies]
16+
compiler_builtins = { version = "0.1.114", features = ["no-f16-f128"] }
1417

1518
[dev-dependencies]
1619
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
@@ -38,8 +41,8 @@ harness = false
3841
compiler-builtins-mem = ['compiler_builtins/mem']
3942
compiler-builtins-c = ["compiler_builtins/c"]
4043
compiler-builtins-no-asm = ["compiler_builtins/no-asm"]
44+
compiler-builtins-no-f16-f128 = ["compiler_builtins/no-f16-f128"]
4145
compiler-builtins-mangled-names = ["compiler_builtins/mangled-names"]
42-
compiler-builtins-weak-intrinsics = ["compiler_builtins/weak-intrinsics"]
4346
# Make panics and failed asserts immediately abort without formatting any message
4447
panic_immediate_abort = ["core/panic_immediate_abort"]
4548
# Choose algorithms that are optimized for binary size instead of runtime performance

library/alloc/benches/btree/map.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use std::collections::BTreeMap;
22
use std::ops::RangeBounds;
33

4-
use rand::{seq::SliceRandom, Rng};
4+
use rand::seq::SliceRandom;
5+
use rand::Rng;
56
use test::{black_box, Bencher};
67

78
macro_rules! map_insert_rand_bench {

library/alloc/benches/linked_list.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::collections::LinkedList;
2+
23
use test::Bencher;
34

45
#[bench]

library/alloc/benches/string.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::iter::repeat;
2+
23
use test::{black_box, Bencher};
34

45
#[bench]

library/alloc/benches/vec.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
use rand::RngCore;
21
use std::iter::repeat;
2+
3+
use rand::RngCore;
34
use test::{black_box, Bencher};
45

56
#[bench]

library/alloc/benches/vec_deque.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use std::{
2-
collections::{vec_deque, VecDeque},
3-
mem,
4-
};
1+
use std::collections::{vec_deque, VecDeque};
2+
use std::mem;
3+
54
use test::{black_box, Bencher};
65

76
#[bench]

library/alloc/benches/vec_deque_append.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use std::{collections::VecDeque, time::Instant};
1+
use std::collections::VecDeque;
2+
use std::time::Instant;
23

34
const VECDEQUE_LEN: i32 = 100000;
45
const WARMUP_N: usize = 100;

library/alloc/src/alloc.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
33
#![stable(feature = "alloc_module", since = "1.28.0")]
44

5+
#[stable(feature = "alloc_module", since = "1.28.0")]
6+
#[doc(inline)]
7+
pub use core::alloc::*;
58
#[cfg(not(test))]
69
use core::hint;
7-
810
#[cfg(not(test))]
911
use core::ptr::{self, NonNull};
1012

11-
#[stable(feature = "alloc_module", since = "1.28.0")]
12-
#[doc(inline)]
13-
pub use core::alloc::*;
14-
1513
#[cfg(test)]
1614
mod tests;
1715

@@ -57,7 +55,7 @@ pub struct Global;
5755
#[cfg(test)]
5856
pub use std::alloc::Global;
5957

60-
/// Allocate memory with the global allocator.
58+
/// Allocates memory with the global allocator.
6159
///
6260
/// This function forwards calls to the [`GlobalAlloc::alloc`] method
6361
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -101,7 +99,7 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
10199
}
102100
}
103101

104-
/// Deallocate memory with the global allocator.
102+
/// Deallocates memory with the global allocator.
105103
///
106104
/// This function forwards calls to the [`GlobalAlloc::dealloc`] method
107105
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -119,7 +117,7 @@ pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
119117
unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
120118
}
121119

122-
/// Reallocate memory with the global allocator.
120+
/// Reallocates memory with the global allocator.
123121
///
124122
/// This function forwards calls to the [`GlobalAlloc::realloc`] method
125123
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -138,7 +136,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
138136
unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) }
139137
}
140138

141-
/// Allocate zero-initialized memory with the global allocator.
139+
/// Allocates zero-initialized memory with the global allocator.
142140
///
143141
/// This function forwards calls to the [`GlobalAlloc::alloc_zeroed`] method
144142
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -345,7 +343,7 @@ extern "Rust" {
345343
fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
346344
}
347345

348-
/// Signal a memory allocation error.
346+
/// Signals a memory allocation error.
349347
///
350348
/// Callers of memory allocation APIs wishing to cease execution
351349
/// in response to an allocation error are encouraged to call this function,

0 commit comments

Comments
 (0)