Skip to content

Commit a3a1415

Browse files
committed
doc-comment non_reentrant_functions
Signed-off-by: mojave2 <[email protected]>
1 parent eb80bb0 commit a3a1415

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clippy_lints/src/non_reentrant_functions.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,20 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
55

66
declare_clippy_lint! {
77
/// ### What it does
8+
/// Checks for non-reentrant functions.
89
///
910
/// ### Why is this bad?
11+
/// This makes code safer, especially in the context of concurrency.
1012
///
1113
/// ### Example
1214
/// ```rust
13-
/// // example code where clippy issues a warning
15+
/// let _tm = libc::localtime(&0i64 as *const libc::time_t);
1416
/// ```
1517
/// Use instead:
1618
/// ```rust
17-
/// // example code which does not raise clippy warning
19+
/// let res = libc::malloc(std::mem::size_of::<libc::tm>());
20+
///
21+
/// libc::locatime_r(&0i64 as *const libc::time_t, res);
1822
/// ```
1923
#[clippy::version = "1.70.0"]
2024
pub NON_REENTRANT_FUNCTIONS,

0 commit comments

Comments
 (0)