Hasty Briefsbeta

Bilingual

&'borrow mut dyn FnMut(BrokenLink<'input>) -> CowStr<'input> and other valid rust programs

a day ago
  • The article describes a lifetime-related bug when using a callback with pulldown-cmark's Parser::new_with_broken_link_callback, where the lifetimes are unnecessarily tied together, causing confusing errors like 'static lifetime requirement.
  • The fix involves separating the lifetimes of the input and the borrow of the callback, as shown in the updated type signature.
  • Additionally, there is a diagnostics bug in the Rust compiler where the error message states the same type must implement a trait that it already implements, causing confusion.
  • The author also discusses the background of rustdoc hiding brackets in intra-doc links and the need for a reusable callback.