rust-callback-bounds
Installation
SKILL.md
Rust callback bounds
for<'a> FnMut(&'a T) -> &'a K is legal and compiles on stable. Only a separate generic
parameter, as in FnMut(&T) -> K, cannot name the higher-ranked lifetime. Do not reach for a GAT,
a macro crate, or Box<dyn Fn> when the callback returns a plain borrow of its argument.
Every quoted diagnostic comes from rustc 1.98.1, edition 2024, on aarch64-apple-darwin.