Skip to content

Commit 8ef507a

Browse files
committed
Extend unused_must_use to cover block exprs
1 parent 83e727b commit 8ef507a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

core/src/primitive_docs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ mod prim_never {}
308308
///
309309
/// ```no_run
310310
/// // Undefined behaviour
311-
/// unsafe { char::from_u32_unchecked(0x110000) };
311+
/// let _ = unsafe { char::from_u32_unchecked(0x110000) };
312312
/// ```
313313
///
314314
/// USVs are also the exact set of values that may be encoded in UTF-8. Because

core/tests/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ fn nonnull_tagged_pointer_with_provenance() {
10011001
assert_eq!(p.tag(), 3);
10021002
assert_eq!(unsafe { *p.pointer().as_ptr() }, 10);
10031003

1004-
unsafe { Box::from_raw(p.pointer().as_ptr()) };
1004+
unsafe { drop(Box::from_raw(p.pointer().as_ptr())) };
10051005

10061006
/// A non-null pointer type which carries several bits of metadata and maintains provenance.
10071007
#[repr(transparent)]

std/src/primitive_docs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ mod prim_never {}
308308
///
309309
/// ```no_run
310310
/// // Undefined behaviour
311-
/// unsafe { char::from_u32_unchecked(0x110000) };
311+
/// let _ = unsafe { char::from_u32_unchecked(0x110000) };
312312
/// ```
313313
///
314314
/// USVs are also the exact set of values that may be encoded in UTF-8. Because

0 commit comments

Comments
 (0)