::fix_hidden_lifetime_bug

Repository Latest version Documentation MSRV unsafe forbidden License CI

Are you getting one of the following errors (E700)?

Then you can add the attribute provided by this crate to automagically generate an equivalent signature that soothes such a grumpy compiler 🙃

Usage

  1. cargo add fix_hidden_lifetime_bug, or add the following to your Cargo.toml file:

    toml [dependencies] fix_hidden_lifetime_bug = "x.y.z"

  2. Add the following to your lib.rs file:

    ```rust,ignore

    [macro_use]

    extern crate fixhiddenlifetime_bug; ```

  3. Slap a #[fix_hidden_lifetime_bug] on the problematic function:

    ```rust,ignore

    [fixhiddenlifetime_bug] // <-- Add this!

    fn foo<'a, 'b>(it: &'a mut &'b ()) -> impl 'a + Sized { it } ```

    ```rust,ignore

    [fixhiddenlifetime_bug] // <-- Add this!

    async fn baz<'a>(fst: &'static str, snd: &str, thrd: &str) { /* … */ } ```

Extra features