Re: [PATCH] Rust: Implement a unique reference type URef supplementing ARef
From: Miguel Ojeda
Date: Fri Feb 28 2025 - 08:17:59 EST
On Fri, Feb 28, 2025 at 12:11 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> When the trait is unsafe, we need to specify the conditions under which
> it is safe to implement:
>
> # Safety
>
> - Requirement 1
> - Requirement 2
> - etc
>
> See `AlwaysRefCounted` for reference on formatting.
I think should be caught by Clippy -- Oliver, please try building with
`CLIPPY=1` (we would like Clippy-clean builds as much as reasonably
possible), you should be getting something like:
error: docs for unsafe trait missing `# Safety` section
--> rust/........rs:23:1
|
23 | pub unsafe trait A {}
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
= note: `-D clippy::missing-safety-doc` implied by `-D warnings`
= help: to override `-D warnings` add
`#[allow(clippy::missing_safety_doc)]`
Thanks!
Cheers,
Miguel