Skip to content

Commit

Permalink
fix: stop dead branch in proc macro from emitting clippy::missing_pan…
Browse files Browse the repository at this point in the history
…ics_doc
  • Loading branch information
paolobarbolini committed Nov 6, 2024
1 parent 82d332f commit a34ebcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sqlx-macros-core/src/query/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ pub fn quote_args<DB: DatabaseExt>(
_ty_check = match_borrow.match_borrow();

// this causes move-analysis to effectively ignore this block
::std::panic!();
// `panic!` would be enough here but we would then get a warning on `clippy::missing_panics_doc`
// SAFETY: this branch is never reached.
unsafe { ::std::hint::unreachable_unchecked() }
}
))
})
Expand Down

0 comments on commit a34ebcd

Please sign in to comment.