Skip to content

Commit

Permalink
doc-comment non_reentrant_functions
Browse files Browse the repository at this point in the history
Signed-off-by: mojave2 <[email protected]>
  • Loading branch information
kiscad committed Jun 26, 2023
1 parent eb80bb0 commit a3a1415
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clippy_lints/src/non_reentrant_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};

declare_clippy_lint! {
/// ### What it does
/// Checks for non-reentrant functions.
///
/// ### Why is this bad?
/// This makes code safer, especially in the context of concurrency.
///
/// ### Example
/// ```rust
/// // example code where clippy issues a warning
/// let _tm = libc::localtime(&0i64 as *const libc::time_t);
/// ```
/// Use instead:
/// ```rust
/// // example code which does not raise clippy warning
/// let res = libc::malloc(std::mem::size_of::<libc::tm>());
///
/// libc::locatime_r(&0i64 as *const libc::time_t, res);
/// ```
#[clippy::version = "1.70.0"]
pub NON_REENTRANT_FUNCTIONS,
Expand Down

0 comments on commit a3a1415

Please sign in to comment.