We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7bc41f commit 3d215bdCopy full SHA for 3d215bd
compiler/rustc_lint/src/builtin.rs
@@ -2969,16 +2969,25 @@ declare_lint! {
2969
/// which causes [undefined behavior].
2970
///
2971
/// ### Example
2972
- ///
2973
/// ```rust,no_run
2974
- /// let x: i32 = unsafe {
2975
- /// *ptr::null()
+ /// unsafe {
+ /// &*core::ptr::null::<i32>()
2976
/// };
2977
/// ```
2978
2979
/// unsafe {
2980
- /// *(0 as *const i32);
2981
- /// }
+ /// core::ptr::addr_of!(*std::ptr::null::<i32>())
+ /// };
+ /// ```
2982
+ /// ```rust,no_run
2983
2984
+ /// *core::ptr::null::<i32>()
2985
2986
2987
2988
2989
+ /// *(0 as *const i32)
2990
2991
2992
2993
/// {{produces}}
0 commit comments