Skip to content

Commit

Permalink
Auto merge of #128313 - GuillaumeGomez:rollup-kacb489, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Rollup of 6 pull requests

Successful merges:

 - #125779 ([rustdoc] Add copy code feature)
 - #127765 (Fix doc nits)
 - #127860 (deps: dedup object, wasmparser, wasm-encoder)
 - #128103 (add `is_multiple_of` for unsigned integer types)
 - #128228 (Stabilize `const_waker`)
 - #128240 (Add links from `assert_eq!` docs to `debug_assert_eq!`, etc.)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jul 28, 2024
2 parents 188ddf4 + eeb76cc commit 2cbbe8b
Show file tree
Hide file tree
Showing 167 changed files with 1,152 additions and 871 deletions.
66 changes: 25 additions & 41 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2571,18 +2571,6 @@ dependencies = [
"indexmap",
"memchr",
"ruzstd 0.5.0",
"wasmparser 0.118.2",
]

[[package]]
name = "object"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7090bae93f8585aad99e595b7073c5de9ba89fbd6b4e9f0cdd7a10177273ac8"
dependencies = [
"flate2",
"memchr",
"ruzstd 0.6.0",
]

[[package]]
Expand All @@ -2596,14 +2584,20 @@ dependencies = [

[[package]]
name = "object"
version = "0.36.0"
version = "0.36.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434"
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
dependencies = [
"compiler_builtins",
"crc32fast",
"flate2",
"hashbrown",
"indexmap",
"memchr",
"rustc-std-workspace-alloc",
"rustc-std-workspace-core",
"ruzstd 0.7.0",
"wasmparser 0.214.0",
]

[[package]]
Expand Down Expand Up @@ -3344,10 +3338,10 @@ dependencies = [
"bstr",
"build_helper",
"gimli 0.31.0",
"object 0.34.0",
"object 0.36.2",
"regex",
"similar",
"wasmparser 0.118.2",
"wasmparser 0.214.0",
]

[[package]]
Expand Down Expand Up @@ -3653,7 +3647,7 @@ dependencies = [
"itertools",
"libc",
"measureme",
"object 0.32.2",
"object 0.36.2",
"rustc-demangle",
"rustc_ast",
"rustc_attr",
Expand Down Expand Up @@ -3692,7 +3686,7 @@ dependencies = [
"itertools",
"jobserver",
"libc",
"object 0.32.2",
"object 0.36.2",
"pathdiff",
"regex",
"rustc_arena",
Expand Down Expand Up @@ -3722,7 +3716,7 @@ dependencies = [
"thin-vec",
"thorin-dwp",
"tracing",
"wasm-encoder 0.200.0",
"wasm-encoder 0.210.0",
"windows",
]

Expand Down Expand Up @@ -4675,7 +4669,7 @@ name = "rustc_target"
version = "0.0.0"
dependencies = [
"bitflags 2.5.0",
"object 0.32.2",
"object 0.36.2",
"rustc_abi",
"rustc_data_structures",
"rustc_feature",
Expand Down Expand Up @@ -4960,12 +4954,11 @@ dependencies = [

[[package]]
name = "ruzstd"
version = "0.6.0"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5174a470eeb535a721ae9fdd6e291c2411a906b96592182d05217591d5c5cf7b"
checksum = "5022b253619b1ba797f243056276bed8ed1a73b0f5a7ce7225d524067644bf8f"
dependencies = [
"byteorder",
"derive_more",
"twox-hash",
]

Expand Down Expand Up @@ -5252,7 +5245,7 @@ dependencies = [
"hermit-abi 0.4.0",
"libc",
"miniz_oxide",
"object 0.36.0",
"object 0.36.2",
"panic_abort",
"panic_unwind",
"profiler_builtins",
Expand Down Expand Up @@ -6188,15 +6181,6 @@ dependencies = [
"wasm-component-ld",
]

[[package]]
name = "wasm-encoder"
version = "0.200.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e3fb0c8fbddd78aa6095b850dfeedbc7506cf5f81e633f69cf8f2333ab84b9"
dependencies = [
"leb128",
]

[[package]]
name = "wasm-encoder"
version = "0.210.0"
Expand Down Expand Up @@ -6233,26 +6217,26 @@ dependencies = [

[[package]]
name = "wasmparser"
version = "0.118.2"
version = "0.210.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c"
checksum = "a7bbcd21e7581619d9f6ca00f8c4f08f1cacfe58bf63f83af57cd0476f1026f5"
dependencies = [
"ahash",
"bitflags 2.5.0",
"hashbrown",
"indexmap",
"semver",
"serde",
]

[[package]]
name = "wasmparser"
version = "0.210.0"
version = "0.214.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7bbcd21e7581619d9f6ca00f8c4f08f1cacfe58bf63f83af57cd0476f1026f5"
checksum = "5309c1090e3e84dad0d382f42064e9933fdaedb87e468cc239f0eabea73ddcb6"
dependencies = [
"ahash",
"bitflags 2.5.0",
"hashbrown",
"indexmap",
"semver",
"serde",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bitflags = "2.4.1"
itertools = "0.12"
libc = "0.2"
measureme = "11"
object = { version = "0.32.0", default-features = false, features = ["std", "read"] }
object = { version = "0.36.2", default-features = false, features = ["std", "read"] }
rustc-demangle = "0.1.21"
rustc_ast = { path = "../rustc_ast" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tempfile = "3.2"
thin-vec = "0.2.12"
thorin-dwp = "0.7"
tracing = "0.1"
wasm-encoder = "0.200.0"
wasm-encoder = "0.210.0"
# tidy-alphabetical-end

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

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

Expand Down
22 changes: 9 additions & 13 deletions compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,11 @@ impl<'a> ArArchiveBuilder<'a> {
}

fn try_filter_fat_archs(
archs: object::read::Result<&[impl FatArch]>,
archs: &[impl FatArch],
target_arch: object::Architecture,
archive_path: &Path,
archive_map_data: &[u8],
) -> io::Result<Option<PathBuf>> {
let archs = archs.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;

let desired = match archs.iter().find(|a| a.architecture() == target_arch) {
Some(a) => a,
None => return Ok(None),
Expand Down Expand Up @@ -146,17 +144,15 @@ pub fn try_extract_macho_fat_archive(
_ => return Ok(None),
};

match object::macho::FatHeader::parse(&*archive_map) {
Ok(h) if h.magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC => {
let archs = object::macho::FatHeader::parse_arch32(&*archive_map);
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
}
Ok(h) if h.magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC_64 => {
let archs = object::macho::FatHeader::parse_arch64(&*archive_map);
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
}
if let Ok(h) = object::read::macho::MachOFatFile32::parse(&*archive_map) {
let archs = h.arches();
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
} else if let Ok(h) = object::read::macho::MachOFatFile64::parse(&*archive_map) {
let archs = h.arches();
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
} else {
// Not a FatHeader at all, just return None.
_ => Ok(None),
Ok(None)
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out
.truncate(true)
.open(dwp_out_filename)?,
);
let mut output_stream = object::write::StreamingBuffer::new(output_stream);
let mut output_stream = thorin::object::write::StreamingBuffer::new(output_stream);
package.finish()?.emit(&mut output_stream)?;
output_stream.result()?;
output_stream.into_inner().flush()?;
Expand Down
8 changes: 7 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,13 @@ pub fn create_metadata_file_for_wasm(sess: &Session, data: &[u8], section_name:
imports.import(
"env",
"__linear_memory",
wasm_encoder::MemoryType { minimum: 0, maximum: None, memory64: true, shared: false },
wasm_encoder::MemoryType {
minimum: 0,
maximum: None,
memory64: true,
shared: false,
page_size_log2: None,
},
);
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ tracing = "0.1"
# tidy-alphabetical-start
default-features = false
features = ["elf", "macho"]
version = "0.32.0"
version = "0.36.2"
# tidy-alphabetical-end
10 changes: 5 additions & 5 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct Global;
#[cfg(test)]
pub use std::alloc::Global;

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

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

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

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

/// Signal a memory allocation error.
/// Signals a memory allocation error.
///
/// Callers of memory allocation APIs wishing to cease execution
/// in response to an allocation error are encouraged to call this function,
Expand Down
14 changes: 8 additions & 6 deletions library/alloc/src/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,9 +1268,11 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
}

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

impl<A: Allocator> Box<dyn Any, A> {
/// Attempt to downcast the box to a concrete type.
/// Attempts to downcast the box to a concrete type.
///
/// # Examples
///
Expand Down Expand Up @@ -1912,7 +1914,7 @@ impl<A: Allocator> Box<dyn Any, A> {
}

impl<A: Allocator> Box<dyn Any + Send, A> {
/// Attempt to downcast the box to a concrete type.
/// Attempts to downcast the box to a concrete type.
///
/// # Examples
///
Expand Down Expand Up @@ -1971,7 +1973,7 @@ impl<A: Allocator> Box<dyn Any + Send, A> {
}

impl<A: Allocator> Box<dyn Any + Send + Sync, A> {
/// Attempt to downcast the box to a concrete type.
/// Attempts to downcast the box to a concrete type.
///
/// # Examples
///
Expand Down
3 changes: 2 additions & 1 deletion library/alloc/src/collections/binary_heap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ impl<T, A: Allocator> BinaryHeap<T, A> {
}

/// Returns an iterator which retrieves elements in heap order.
///
/// This method consumes the original heap.
///
/// # Examples
Expand Down Expand Up @@ -1361,7 +1362,7 @@ struct Hole<'a, T: 'a> {
}

impl<'a, T> Hole<'a, T> {
/// Create a new `Hole` at index `pos`.
/// Creates a new `Hole` at index `pos`.
///
/// Unsafe because pos must be within the data slice.
#[inline]
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/collections/btree/map/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ impl<'a, K: Ord, V, A: Allocator + Clone> Entry<'a, K, V, A> {
}

/// Ensures a value is in the entry by inserting, if empty, the result of the default function.
///
/// This method allows for generating key-derived values for insertion by providing the default
/// function a reference to the key that was moved during the `.entry(key)` method call.
///
Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,7 @@ pub use core::fmt::{LowerHex, Pointer, UpperHex};
#[cfg(not(no_global_oom_handling))]
use crate::string;

/// The `format` function takes an [`Arguments`] struct and returns the resulting
/// formatted string.
/// Takes an [`Arguments`] struct and returns the resulting formatted string.
///
/// The [`Arguments`] instance can be created with the [`format_args!`] macro.
///
Expand Down
1 change: 0 additions & 1 deletion library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
#![feature(const_pin)]
#![feature(const_refs_to_cell)]
#![feature(const_size_of_val)]
#![feature(const_waker)]
#![feature(core_intrinsics)]
#![feature(deprecated_suggestion)]
#![feature(deref_pure_trait)]
Expand Down
Loading

0 comments on commit 2cbbe8b

Please sign in to comment.