fix lint doc
This commit is contained in:
parent
3d215bdf42
commit
0531ed0b62
1 changed files with 7 additions and 18 deletions
|
@ -2969,32 +2969,21 @@ declare_lint! {
|
||||||
/// which causes [undefined behavior].
|
/// which causes [undefined behavior].
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
|
///
|
||||||
/// ```rust,no_run
|
/// ```rust,no_run
|
||||||
|
/// # #![allow(unused)]
|
||||||
/// unsafe {
|
/// unsafe {
|
||||||
/// &*core::ptr::null::<i32>()
|
/// let x = &*core::ptr::null::<i32>();
|
||||||
/// };
|
/// let x = core::ptr::addr_of!(*std::ptr::null::<i32>());
|
||||||
/// ```
|
/// let x = *core::ptr::null::<i32>();
|
||||||
/// ```rust,no_run
|
/// let x = *(0 as *const i32);
|
||||||
/// unsafe {
|
/// }
|
||||||
/// core::ptr::addr_of!(*std::ptr::null::<i32>())
|
|
||||||
/// };
|
|
||||||
/// ```
|
|
||||||
/// ```rust,no_run
|
|
||||||
/// unsafe {
|
|
||||||
/// *core::ptr::null::<i32>()
|
|
||||||
/// };
|
|
||||||
/// ```
|
|
||||||
/// ```rust,no_run
|
|
||||||
/// unsafe {
|
|
||||||
/// *(0 as *const i32)
|
|
||||||
/// };
|
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// {{produces}}
|
/// {{produces}}
|
||||||
///
|
///
|
||||||
/// ### Explanation
|
/// ### Explanation
|
||||||
///
|
///
|
||||||
///
|
|
||||||
/// Dereferencing a null pointer causes [undefined behavior] even as a place expression,
|
/// Dereferencing a null pointer causes [undefined behavior] even as a place expression,
|
||||||
/// like `&*(0 as *const i32)` or `addr_of!(*(0 as *const i32))`.
|
/// like `&*(0 as *const i32)` or `addr_of!(*(0 as *const i32))`.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue