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.

Route the symptom to a section

Installs
8
GitHub Stars
7
First Seen
Aug 20, 2026