Skip to content

Commit 2cbbe8b

Browse files
committed
Auto merge of rust-lang#128313 - GuillaumeGomez:rollup-kacb489, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - rust-lang#125779 ([rustdoc] Add copy code feature) - rust-lang#127765 (Fix doc nits) - rust-lang#127860 (deps: dedup object, wasmparser, wasm-encoder) - rust-lang#128103 (add `is_multiple_of` for unsigned integer types) - rust-lang#128228 (Stabilize `const_waker`) - rust-lang#128240 (Add links from `assert_eq!` docs to `debug_assert_eq!`, etc.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 188ddf4 + eeb76cc commit 2cbbe8b

File tree

167 files changed

+1152
-871
lines changed

Some content is hidden

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

167 files changed

+1152
-871
lines changed

Cargo.lock

+25-41
Original file line numberDiff line numberDiff line change
@@ -2571,18 +2571,6 @@ dependencies = [
25712571
"indexmap",
25722572
"memchr",
25732573
"ruzstd 0.5.0",
2574-
"wasmparser 0.118.2",
2575-
]
2576-
2577-
[[package]]
2578-
name = "object"
2579-
version = "0.34.0"
2580-
source = "registry+https://github.com/rust-lang/crates.io-index"
2581-
checksum = "d7090bae93f8585aad99e595b7073c5de9ba89fbd6b4e9f0cdd7a10177273ac8"
2582-
dependencies = [
2583-
"flate2",
2584-
"memchr",
2585-
"ruzstd 0.6.0",
25862574
]
25872575

25882576
[[package]]
@@ -2596,14 +2584,20 @@ dependencies = [
25962584

25972585
[[package]]
25982586
name = "object"
2599-
version = "0.36.0"
2587+
version = "0.36.2"
26002588
source = "registry+https://github.com/rust-lang/crates.io-index"
2601-
checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434"
2589+
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
26022590
dependencies = [
26032591
"compiler_builtins",
2592+
"crc32fast",
2593+
"flate2",
2594+
"hashbrown",
2595+
"indexmap",
26042596
"memchr",
26052597
"rustc-std-workspace-alloc",
26062598
"rustc-std-workspace-core",
2599+
"ruzstd 0.7.0",
2600+
"wasmparser 0.214.0",
26072601
]
26082602

26092603
[[package]]
@@ -3344,10 +3338,10 @@ dependencies = [
33443338
"bstr",
33453339
"build_helper",
33463340
"gimli 0.31.0",
3347-
"object 0.34.0",
3341+
"object 0.36.2",
33483342
"regex",
33493343
"similar",
3350-
"wasmparser 0.118.2",
3344+
"wasmparser 0.214.0",
33513345
]
33523346

33533347
[[package]]
@@ -3653,7 +3647,7 @@ dependencies = [
36533647
"itertools",
36543648
"libc",
36553649
"measureme",
3656-
"object 0.32.2",
3650+
"object 0.36.2",
36573651
"rustc-demangle",
36583652
"rustc_ast",
36593653
"rustc_attr",
@@ -3692,7 +3686,7 @@ dependencies = [
36923686
"itertools",
36933687
"jobserver",
36943688
"libc",
3695-
"object 0.32.2",
3689+
"object 0.36.2",
36963690
"pathdiff",
36973691
"regex",
36983692
"rustc_arena",
@@ -3722,7 +3716,7 @@ dependencies = [
37223716
"thin-vec",
37233717
"thorin-dwp",
37243718
"tracing",
3725-
"wasm-encoder 0.200.0",
3719+
"wasm-encoder 0.210.0",
37263720
"windows",
37273721
]
37283722

@@ -4675,7 +4669,7 @@ name = "rustc_target"
46754669
version = "0.0.0"
46764670
dependencies = [
46774671
"bitflags 2.5.0",
4678-
"object 0.32.2",
4672+
"object 0.36.2",
46794673
"rustc_abi",
46804674
"rustc_data_structures",
46814675
"rustc_feature",
@@ -4960,12 +4954,11 @@ dependencies = [
49604954

49614955
[[package]]
49624956
name = "ruzstd"
4963-
version = "0.6.0"
4957+
version = "0.7.0"
49644958
source = "registry+https://github.com/rust-lang/crates.io-index"
4965-
checksum = "5174a470eeb535a721ae9fdd6e291c2411a906b96592182d05217591d5c5cf7b"
4959+
checksum = "5022b253619b1ba797f243056276bed8ed1a73b0f5a7ce7225d524067644bf8f"
49664960
dependencies = [
49674961
"byteorder",
4968-
"derive_more",
49694962
"twox-hash",
49704963
]
49714964

@@ -5252,7 +5245,7 @@ dependencies = [
52525245
"hermit-abi 0.4.0",
52535246
"libc",
52545247
"miniz_oxide",
5255-
"object 0.36.0",
5248+
"object 0.36.2",
52565249
"panic_abort",
52575250
"panic_unwind",
52585251
"profiler_builtins",
@@ -6188,15 +6181,6 @@ dependencies = [
61886181
"wasm-component-ld",
61896182
]
61906183

6191-
[[package]]
6192-
name = "wasm-encoder"
6193-
version = "0.200.0"
6194-
source = "registry+https://github.com/rust-lang/crates.io-index"
6195-
checksum = "b9e3fb0c8fbddd78aa6095b850dfeedbc7506cf5f81e633f69cf8f2333ab84b9"
6196-
dependencies = [
6197-
"leb128",
6198-
]
6199-
62006184
[[package]]
62016185
name = "wasm-encoder"
62026186
version = "0.210.0"
@@ -6233,26 +6217,26 @@ dependencies = [
62336217

62346218
[[package]]
62356219
name = "wasmparser"
6236-
version = "0.118.2"
6220+
version = "0.210.0"
62376221
source = "registry+https://github.com/rust-lang/crates.io-index"
6238-
checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c"
6222+
checksum = "a7bbcd21e7581619d9f6ca00f8c4f08f1cacfe58bf63f83af57cd0476f1026f5"
62396223
dependencies = [
6224+
"ahash",
6225+
"bitflags 2.5.0",
6226+
"hashbrown",
62406227
"indexmap",
62416228
"semver",
6229+
"serde",
62426230
]
62436231

62446232
[[package]]
62456233
name = "wasmparser"
6246-
version = "0.210.0"
6234+
version = "0.214.0"
62476235
source = "registry+https://github.com/rust-lang/crates.io-index"
6248-
checksum = "a7bbcd21e7581619d9f6ca00f8c4f08f1cacfe58bf63f83af57cd0476f1026f5"
6236+
checksum = "5309c1090e3e84dad0d382f42064e9933fdaedb87e468cc239f0eabea73ddcb6"
62496237
dependencies = [
6250-
"ahash",
62516238
"bitflags 2.5.0",
6252-
"hashbrown",
62536239
"indexmap",
6254-
"semver",
6255-
"serde",
62566240
]
62576241

62586242
[[package]]

compiler/rustc_codegen_llvm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bitflags = "2.4.1"
1212
itertools = "0.12"
1313
libc = "0.2"
1414
measureme = "11"
15-
object = { version = "0.32.0", default-features = false, features = ["std", "read"] }
15+
object = { version = "0.36.2", default-features = false, features = ["std", "read"] }
1616
rustc-demangle = "0.1.21"
1717
rustc_ast = { path = "../rustc_ast" }
1818
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_codegen_ssa/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ tempfile = "3.2"
4141
thin-vec = "0.2.12"
4242
thorin-dwp = "0.7"
4343
tracing = "0.1"
44-
wasm-encoder = "0.200.0"
44+
wasm-encoder = "0.210.0"
4545
# tidy-alphabetical-end
4646

4747
[target.'cfg(unix)'.dependencies]
@@ -50,7 +50,7 @@ libc = "0.2.50"
5050
# tidy-alphabetical-end
5151

5252
[dependencies.object]
53-
version = "0.32.1"
53+
version = "0.36.2"
5454
default-features = false
5555
features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"]
5656

compiler/rustc_codegen_ssa/src/back/archive.rs

+9-13
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,11 @@ impl<'a> ArArchiveBuilder<'a> {
110110
}
111111

112112
fn try_filter_fat_archs(
113-
archs: object::read::Result<&[impl FatArch]>,
113+
archs: &[impl FatArch],
114114
target_arch: object::Architecture,
115115
archive_path: &Path,
116116
archive_map_data: &[u8],
117117
) -> io::Result<Option<PathBuf>> {
118-
let archs = archs.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
119-
120118
let desired = match archs.iter().find(|a| a.architecture() == target_arch) {
121119
Some(a) => a,
122120
None => return Ok(None),
@@ -146,17 +144,15 @@ pub fn try_extract_macho_fat_archive(
146144
_ => return Ok(None),
147145
};
148146

149-
match object::macho::FatHeader::parse(&*archive_map) {
150-
Ok(h) if h.magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC => {
151-
let archs = object::macho::FatHeader::parse_arch32(&*archive_map);
152-
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
153-
}
154-
Ok(h) if h.magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC_64 => {
155-
let archs = object::macho::FatHeader::parse_arch64(&*archive_map);
156-
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
157-
}
147+
if let Ok(h) = object::read::macho::MachOFatFile32::parse(&*archive_map) {
148+
let archs = h.arches();
149+
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
150+
} else if let Ok(h) = object::read::macho::MachOFatFile64::parse(&*archive_map) {
151+
let archs = h.arches();
152+
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
153+
} else {
158154
// Not a FatHeader at all, just return None.
159-
_ => Ok(None),
155+
Ok(None)
160156
}
161157
}
162158

compiler/rustc_codegen_ssa/src/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out
700700
.truncate(true)
701701
.open(dwp_out_filename)?,
702702
);
703-
let mut output_stream = object::write::StreamingBuffer::new(output_stream);
703+
let mut output_stream = thorin::object::write::StreamingBuffer::new(output_stream);
704704
package.finish()?.emit(&mut output_stream)?;
705705
output_stream.result()?;
706706
output_stream.into_inner().flush()?;

compiler/rustc_codegen_ssa/src/back/metadata.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,13 @@ pub fn create_metadata_file_for_wasm(sess: &Session, data: &[u8], section_name:
656656
imports.import(
657657
"env",
658658
"__linear_memory",
659-
wasm_encoder::MemoryType { minimum: 0, maximum: None, memory64: true, shared: false },
659+
wasm_encoder::MemoryType {
660+
minimum: 0,
661+
maximum: None,
662+
memory64: true,
663+
shared: false,
664+
page_size_log2: None,
665+
},
660666
);
661667
}
662668

compiler/rustc_target/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ tracing = "0.1"
2222
# tidy-alphabetical-start
2323
default-features = false
2424
features = ["elf", "macho"]
25-
version = "0.32.0"
25+
version = "0.36.2"
2626
# tidy-alphabetical-end

library/alloc/src/alloc.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct Global;
5757
#[cfg(test)]
5858
pub use std::alloc::Global;
5959

60-
/// Allocate memory with the global allocator.
60+
/// Allocates memory with the global allocator.
6161
///
6262
/// This function forwards calls to the [`GlobalAlloc::alloc`] method
6363
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -101,7 +101,7 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
101101
}
102102
}
103103

104-
/// Deallocate memory with the global allocator.
104+
/// Deallocates memory with the global allocator.
105105
///
106106
/// This function forwards calls to the [`GlobalAlloc::dealloc`] method
107107
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -119,7 +119,7 @@ pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) {
119119
unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
120120
}
121121

122-
/// Reallocate memory with the global allocator.
122+
/// Reallocates memory with the global allocator.
123123
///
124124
/// This function forwards calls to the [`GlobalAlloc::realloc`] method
125125
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -138,7 +138,7 @@ pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8
138138
unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) }
139139
}
140140

141-
/// Allocate zero-initialized memory with the global allocator.
141+
/// Allocates zero-initialized memory with the global allocator.
142142
///
143143
/// This function forwards calls to the [`GlobalAlloc::alloc_zeroed`] method
144144
/// of the allocator registered with the `#[global_allocator]` attribute
@@ -345,7 +345,7 @@ extern "Rust" {
345345
fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
346346
}
347347

348-
/// Signal a memory allocation error.
348+
/// Signals a memory allocation error.
349349
///
350350
/// Callers of memory allocation APIs wishing to cease execution
351351
/// in response to an allocation error are encouraged to call this function,

library/alloc/src/boxed.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1268,9 +1268,11 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
12681268
}
12691269

12701270
/// Consumes and leaks the `Box`, returning a mutable reference,
1271-
/// `&'a mut T`. Note that the type `T` must outlive the chosen lifetime
1272-
/// `'a`. If the type has only static references, or none at all, then this
1273-
/// may be chosen to be `'static`.
1271+
/// `&'a mut T`.
1272+
///
1273+
/// Note that the type `T` must outlive the chosen lifetime `'a`. If the type
1274+
/// has only static references, or none at all, then this may be chosen to be
1275+
/// `'static`.
12741276
///
12751277
/// This function is mainly useful for data that lives for the remainder of
12761278
/// the program's life. Dropping the returned reference will cause a memory
@@ -1853,7 +1855,7 @@ impl<T, const N: usize> TryFrom<Vec<T>> for Box<[T; N]> {
18531855
}
18541856

18551857
impl<A: Allocator> Box<dyn Any, A> {
1856-
/// Attempt to downcast the box to a concrete type.
1858+
/// Attempts to downcast the box to a concrete type.
18571859
///
18581860
/// # Examples
18591861
///
@@ -1912,7 +1914,7 @@ impl<A: Allocator> Box<dyn Any, A> {
19121914
}
19131915

19141916
impl<A: Allocator> Box<dyn Any + Send, A> {
1915-
/// Attempt to downcast the box to a concrete type.
1917+
/// Attempts to downcast the box to a concrete type.
19161918
///
19171919
/// # Examples
19181920
///
@@ -1971,7 +1973,7 @@ impl<A: Allocator> Box<dyn Any + Send, A> {
19711973
}
19721974

19731975
impl<A: Allocator> Box<dyn Any + Send + Sync, A> {
1974-
/// Attempt to downcast the box to a concrete type.
1976+
/// Attempts to downcast the box to a concrete type.
19751977
///
19761978
/// # Examples
19771979
///

library/alloc/src/collections/binary_heap/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
965965
}
966966

967967
/// Returns an iterator which retrieves elements in heap order.
968+
///
968969
/// This method consumes the original heap.
969970
///
970971
/// # Examples
@@ -1361,7 +1362,7 @@ struct Hole<'a, T: 'a> {
13611362
}
13621363

13631364
impl<'a, T> Hole<'a, T> {
1364-
/// Create a new `Hole` at index `pos`.
1365+
/// Creates a new `Hole` at index `pos`.
13651366
///
13661367
/// Unsafe because pos must be within the data slice.
13671368
#[inline]

library/alloc/src/collections/btree/map/entry.rs

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
189189
}
190190

191191
/// Ensures a value is in the entry by inserting, if empty, the result of the default function.
192+
///
192193
/// This method allows for generating key-derived values for insertion by providing the default
193194
/// function a reference to the key that was moved during the `.entry(key)` method call.
194195
///

library/alloc/src/fmt.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,7 @@ pub use core::fmt::{LowerHex, Pointer, UpperHex};
600600
#[cfg(not(no_global_oom_handling))]
601601
use crate::string;
602602

603-
/// The `format` function takes an [`Arguments`] struct and returns the resulting
604-
/// formatted string.
603+
/// Takes an [`Arguments`] struct and returns the resulting formatted string.
605604
///
606605
/// The [`Arguments`] instance can be created with the [`format_args!`] macro.
607606
///

library/alloc/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
#![feature(const_pin)]
117117
#![feature(const_refs_to_cell)]
118118
#![feature(const_size_of_val)]
119-
#![feature(const_waker)]
120119
#![feature(core_intrinsics)]
121120
#![feature(deprecated_suggestion)]
122121
#![feature(deref_pure_trait)]

0 commit comments

Comments
 (0)