emilk opened a new pull request, #10761:
URL: https://github.com/apache/arrow-rs/pull/10761

   # Which issue does this PR close?
   
   - Part of https://github.com/apache/arrow-rs/issues/10553
   
   # Rationale for this change
   
   Part 4 of 4, splitting out the `clippy::missing_panics_doc` work.
   **Stacked on https://github.com/apache/arrow-rs/pull/10760** - the diff shown
   here includes #10755, #10759 and #10760, so review only the commits after
   `docs: say why the remaining panics are not errors`.
   
   1. #10755 - return errors from fallible functions
   2. #10759 - remove unreachable panics
   3. #10760 - document the panics that genuinely remain
   4. **this PR** - `#[expect]` the unreachable ones
   
   What is left is functions whose `unwrap` cannot fail, but where removing it
   would mean restructuring code for no gain. Those get an `#[expect]` with a
   reason, which is the repo's documented convention for a lint you disagree 
with
   on a given item.
   
   With this PR, `clippy::missing_panics_doc` is clean across the workspace, so 
it
   can be turned on with the rest of the pedantic lints.
   
   # What changes are included in this PR?
   
   * `#[expect(clippy::missing_panics_doc, reason = "...")]` on the functions 
whose
     panic is unreachable, each reason naming the invariant that makes it so, 
for
     example "an `OffsetBuffer` is never empty" or "an array always matches the
     concrete type of its data type"
   * file-level `#![expect(...)]` for tests, benchmarks and the helpers they 
use,
     since those are free to panic
   * records that convention in CONTRIBUTING.md, next to the existing guidance 
on
     suppressing lints
   
   The lint itself is still not enabled here; that comes with the rest of the
   pedantic lints.
   
   # Are these changes tested?
   
   Verified with `cargo clippy --workspace --all-features --all-targets` with
   `missing_panics_doc = "warn"` added to `[workspace.lints.clippy]` locally: no
   warnings, and no unfulfilled expectations.
   
   # Are there any user-facing changes?
   
   No.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to