Updating documentation and lint formatting.
This commit is contained in:
parent
339cd14f27
commit
8330887e1b
@ -17,10 +17,10 @@ declare_clippy_lint! {
|
|||||||
/// Wrapping a type in Arc doesn't add thread safety to the underlying data, so data races
|
/// Wrapping a type in Arc doesn't add thread safety to the underlying data, so data races
|
||||||
/// could occur when touching the underlying data.
|
/// could occur when touching the underlying data.
|
||||||
///
|
///
|
||||||
/// ### Example.
|
/// ### Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use std::cell::RefCell;
|
/// # use std::cell::RefCell;
|
||||||
/// use std::sync::Arc;
|
/// # use std::sync::Arc;
|
||||||
///
|
///
|
||||||
/// fn main() {
|
/// fn main() {
|
||||||
/// // This is safe, as `i32` implements `Send` and `Sync`.
|
/// // This is safe, as `i32` implements `Send` and `Sync`.
|
||||||
@ -30,7 +30,6 @@ declare_clippy_lint! {
|
|||||||
/// let b = Arc::new(RefCell::new(42));
|
/// let b = Arc::new(RefCell::new(42));
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
/// ```
|
|
||||||
#[clippy::version = "1.72.0"]
|
#[clippy::version = "1.72.0"]
|
||||||
pub ARC_WITH_NON_SEND_SYNC,
|
pub ARC_WITH_NON_SEND_SYNC,
|
||||||
correctness,
|
correctness,
|
||||||
@ -63,7 +62,7 @@ impl LateLintPass<'_> for ArcWithNonSendSync {
|
|||||||
"usage of `Arc<T>` where `T` is not `Send` or `Sync`",
|
"usage of `Arc<T>` where `T` is not `Send` or `Sync`",
|
||||||
None,
|
None,
|
||||||
"consider using `Rc<T>` instead or wrapping `T` in a std::sync type like \
|
"consider using `Rc<T>` instead or wrapping `T` in a std::sync type like \
|
||||||
Mutex<T>",
|
`Mutex<T>`",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user