change documentation of lint
This commit is contained in:
parent
c7bc41f97a
commit
3d215bdf42
1 changed files with 14 additions and 5 deletions
|
@ -2969,16 +2969,25 @@ declare_lint! {
|
|||
/// which causes [undefined behavior].
|
||||
///
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust,no_run
|
||||
/// let x: i32 = unsafe {
|
||||
/// *ptr::null()
|
||||
/// unsafe {
|
||||
/// &*core::ptr::null::<i32>()
|
||||
/// };
|
||||
/// ```
|
||||
/// ```rust,no_run
|
||||
/// unsafe {
|
||||
/// *(0 as *const i32);
|
||||
/// }
|
||||
/// 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}}
|
||||
|
|
Loading…
Add table
Reference in a new issue