Skip to content

Commit 1cd895c

Browse files
committed
Auto merge of rust-lang#138693 - matthiaskrgr:rollup-ejq8mwp, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#136177 (clarify BufRead::{fill_buf, consume} docs) - rust-lang#138654 (Remove the regex dependency from coretests) - rust-lang#138655 (rustc-dev-guide sync) - rust-lang#138656 (Remove double nesting in post-merge workflow) - rust-lang#138658 (CI: mirror alpine and centos images to ghcr) - rust-lang#138659 (coverage: Don't store a body span in `FunctionCoverageInfo`) - rust-lang#138661 (Revert: Add *_value methods to proc_macro lib) - rust-lang#138670 (Remove existing AFIDT implementation) - rust-lang#138674 (Various codegen_llvm cleanups) - rust-lang#138684 (use then in docs for `fuse` to enhance readability) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9d668f3 + edd6f85 commit 1cd895c

File tree

12 files changed

+29
-938
lines changed

12 files changed

+29
-938
lines changed

Cargo.lock

-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ members = [
88
]
99

1010
exclude = [
11-
"literal-escaper",
1211
# stdarch has its own Cargo workspace
1312
"stdarch",
1413
"windows_targets"

core/src/iter/traits/iterator.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1704,11 +1704,7 @@ pub trait Iterator {
17041704
/// self.state = self.state + 1;
17051705
///
17061706
/// // if it's even, Some(i32), else None
1707-
/// if val % 2 == 0 {
1708-
/// Some(val)
1709-
/// } else {
1710-
/// None
1711-
/// }
1707+
/// (val % 2 == 0).then_some(val)
17121708
/// }
17131709
/// }
17141710
///

coretests/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ test = true
2525
[dev-dependencies]
2626
rand = { version = "0.9.0", default-features = false }
2727
rand_xorshift = { version = "0.4.0", default-features = false }
28-
regex = { version = "1.11.1", default-features = false }

coretests/tests/fmt/mod.rs

+11-19
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,24 @@ fn test_pointer_formats_data_pointer() {
2222
#[test]
2323
fn test_fmt_debug_of_raw_pointers() {
2424
use core::fmt::Debug;
25+
use core::ptr;
2526

26-
fn check_fmt<T: Debug>(t: T, expected: &str) {
27-
use std::sync::LazyLock;
28-
29-
use regex::Regex;
30-
31-
static ADDR_REGEX: LazyLock<Regex> =
32-
LazyLock::new(|| Regex::new(r"0x[0-9a-fA-F]+").unwrap());
33-
27+
fn check_fmt<T: Debug>(t: T, start: &str, contains: &str) {
3428
let formatted = format!("{:?}", t);
35-
let normalized = ADDR_REGEX.replace_all(&formatted, "$$HEX");
36-
37-
assert_eq!(normalized, expected);
29+
assert!(formatted.starts_with(start), "{formatted:?} doesn't start with {start:?}");
30+
assert!(formatted.contains(contains), "{formatted:?} doesn't contain {contains:?}");
3831
}
3932

40-
let plain = &mut 100;
41-
check_fmt(plain as *mut i32, "$HEX");
42-
check_fmt(plain as *const i32, "$HEX");
33+
assert_eq!(format!("{:?}", ptr::without_provenance_mut::<i32>(0x100)), "0x100");
34+
assert_eq!(format!("{:?}", ptr::without_provenance::<i32>(0x100)), "0x100");
4335

44-
let slice = &mut [200, 300, 400][..];
45-
check_fmt(slice as *mut [i32], "Pointer { addr: $HEX, metadata: 3 }");
46-
check_fmt(slice as *const [i32], "Pointer { addr: $HEX, metadata: 3 }");
36+
let slice = ptr::slice_from_raw_parts(ptr::without_provenance::<i32>(0x100), 3);
37+
assert_eq!(format!("{:?}", slice as *mut [i32]), "Pointer { addr: 0x100, metadata: 3 }");
38+
assert_eq!(format!("{:?}", slice as *const [i32]), "Pointer { addr: 0x100, metadata: 3 }");
4739

4840
let vtable = &mut 500 as &mut dyn Debug;
49-
check_fmt(vtable as *mut dyn Debug, "Pointer { addr: $HEX, metadata: DynMetadata($HEX) }");
50-
check_fmt(vtable as *const dyn Debug, "Pointer { addr: $HEX, metadata: DynMetadata($HEX) }");
41+
check_fmt(vtable as *mut dyn Debug, "Pointer { addr: ", ", metadata: DynMetadata(");
42+
check_fmt(vtable as *const dyn Debug, "Pointer { addr: ", ", metadata: DynMetadata(");
5143
}
5244

5345
#[test]

literal-escaper/Cargo.toml

-10
This file was deleted.

literal-escaper/README.md

-4
This file was deleted.

0 commit comments

Comments
 (0)