Skip to content

Commit e75fa89

Browse files
Don't imply function pointers are references
Co-authored-by: David Tolnay <[email protected]>
1 parent 15cd51a commit e75fa89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/mem/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ pub const fn needs_drop<T>() -> bool {
583583
///
584584
/// There is no guarantee that an all-zero byte-pattern represents a valid value
585585
/// of some type `T`. For example, the all-zero byte-pattern is not a valid value
586-
/// for reference types (`&T`, `&mut T` and functions pointers). Using `zeroed` on
586+
/// for reference types (`&T`, `&mut T`) and functions pointers. Using `zeroed` on
587587
/// such types on such types causes immediate [undefined behavior][ub] because
588588
/// [the Rust compiler assumes][inv] that there always is a valid value in a
589589
/// variable it considers initialized.
@@ -613,7 +613,7 @@ pub const fn needs_drop<T>() -> bool {
613613
/// use std::mem;
614614
///
615615
/// let _x: &i32 = unsafe { mem::zeroed() }; // Undefined behavior!
616-
/// let _y: fn() = unsafe { mem::zeroed() }; // And again !
616+
/// let _y: fn() = unsafe { mem::zeroed() }; // And again!
617617
/// ```
618618
#[inline(always)]
619619
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)