Skip to content

Commit

Permalink
Ignore clippy::unnecessary_safety_doc lint
Browse files Browse the repository at this point in the history
```
warning: safe function's docs have unnecessary `# Safety` section
   --> futures-task/src/future_obj.rs:151:5
    |
151 |     fn into_raw(self) -> *mut (dyn Future<Output = T> + 'a);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
    = note: `#[warn(clippy::unnecessary_safety_doc)]` on by default

warning: safe function's docs have unnecessary `# Safety` section
   --> futures-util/src/future/future/shared.rs:141:5
    |
141 |     pub fn strong_count(&self) -> Option<usize> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
    = note: `#[warn(clippy::unnecessary_safety_doc)]` on by default

warning: safe function's docs have unnecessary `# Safety` section
   --> futures-util/src/future/future/shared.rs:154:5
    |
154 |     pub fn weak_count(&self) -> Option<usize> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
```
  • Loading branch information
taiki-e committed Nov 27, 2022
1 parent 86f0626 commit 3b0378b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions futures-task/src/future_obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ pub unsafe trait UnsafeFutureObj<'a, T>: 'a {
/// provided `*mut (dyn Future<Output = T> + 'a)` into a `Pin<&mut (dyn
/// Future<Output = T> + 'a)>` and call methods on it, non-reentrantly,
/// until `UnsafeFutureObj::drop` is called with it.
#[allow(clippy::unnecessary_safety_doc)]
fn into_raw(self) -> *mut (dyn Future<Output = T> + 'a);

/// Drops the future represented by the given fat pointer.
Expand Down
2 changes: 2 additions & 0 deletions futures-util/src/future/future/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ where
/// This method by itself is safe, but using it correctly requires extra care. Another thread
/// can change the strong count at any time, including potentially between calling this method
/// and acting on the result.
#[allow(clippy::unnecessary_safety_doc)]
pub fn strong_count(&self) -> Option<usize> {
self.inner.as_ref().map(Arc::strong_count)
}
Expand All @@ -151,6 +152,7 @@ where
/// This method by itself is safe, but using it correctly requires extra care. Another thread
/// can change the weak count at any time, including potentially between calling this method
/// and acting on the result.
#[allow(clippy::unnecessary_safety_doc)]
pub fn weak_count(&self) -> Option<usize> {
self.inner.as_ref().map(Arc::weak_count)
}
Expand Down

0 comments on commit 3b0378b

Please sign in to comment.