Skip to content

Commit 738cc0f

Browse files
committed
Auto merge of #127486 - matthiaskrgr:rollup-lvv018b, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #120248 (Make casts of pointers to trait objects stricter) - #127355 (Mark format! with must_use hint) - #127399 (Verify that allocations output by GVN are sufficiently aligned.) - #127460 (clarify `sys::unix::fd::FileDesc::drop` comment) - #127467 (bootstrap: once_cell::sync::Lazy -> std::sync::LazyLock) Failed merges: - #127357 (Remove `StructuredDiag`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f1644e5 + fa5f02d commit 738cc0f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

tests/pass/intptrcast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn cast_dangling() {
3535
fn format() {
3636
// Pointer string formatting! We can't check the output as it changes when libstd changes,
3737
// but we can make sure Miri does not error.
38-
format!("{:?}", &mut 13 as *mut _);
38+
let _ = format!("{:?}", &mut 13 as *mut _);
3939
}
4040

4141
fn transmute() {
@@ -52,7 +52,7 @@ fn ptr_bitops1() {
5252
let one = bytes.as_ptr().wrapping_offset(1);
5353
let three = bytes.as_ptr().wrapping_offset(3);
5454
let res = (one as usize) | (three as usize);
55-
format!("{}", res);
55+
let _ = format!("{}", res);
5656
}
5757

5858
fn ptr_bitops2() {

tests/pass/packed_struct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn test_derive() {
138138
assert_eq!(x.partial_cmp(&y).unwrap(), x.cmp(&y));
139139
x.hash(&mut DefaultHasher::new());
140140
P::default();
141-
format!("{:?}", x);
141+
let _ = format!("{:?}", x);
142142
}
143143

144144
fn main() {

tests/pass/shims/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn test_errors() {
202202
// Opening a non-existing file should fail with a "not found" error.
203203
assert_eq!(ErrorKind::NotFound, File::open(&path).unwrap_err().kind());
204204
// Make sure we can also format this.
205-
format!("{0}: {0:?}", File::open(&path).unwrap_err());
205+
let _ = format!("{0}: {0:?}", File::open(&path).unwrap_err());
206206
// Removing a non-existing file should fail with a "not found" error.
207207
assert_eq!(ErrorKind::NotFound, remove_file(&path).unwrap_err().kind());
208208
// Reading the metadata of a non-existing file should fail with a "not found" error.
@@ -301,5 +301,5 @@ fn test_from_raw_os_error() {
301301
let error = Error::from_raw_os_error(code);
302302
assert!(matches!(error.kind(), ErrorKind::Uncategorized));
303303
// Make sure we can also format this.
304-
format!("{error:?}");
304+
let _ = format!("{error:?}");
305305
}

tests/pass/shims/io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ fn main() {
1515
panic!("unsupported OS")
1616
};
1717
let err = io::Error::from_raw_os_error(raw_os_error);
18-
format!("{err}: {err:?}");
18+
let _ = format!("{err}: {err:?}");
1919
}

tests/pass/vecdeque.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fn main() {
3131
}
3232

3333
// Regression test for Debug impl's
34-
format!("{:?} {:?}", dst, dst.iter());
35-
format!("{:?}", VecDeque::<u32>::new().iter());
34+
let _ = format!("{:?} {:?}", dst, dst.iter());
35+
let _ = format!("{:?}", VecDeque::<u32>::new().iter());
3636

3737
for a in dst {
3838
assert_eq!(*a, 2);

0 commit comments

Comments
 (0)