Open
Description
openedon Jul 22, 2016
This was encountered from a derive plugin that created where bounds for all member types. Occurs on stable, beta, and nightly.
struct S<'a>(&'a ());
trait Tr { }
impl<T> Tr for Option<T> { }
impl<'a> Tr for S<'a> where Option<&'a str>: Tr, Option<&'static str>: Tr { }
error: mismatched types [--explain E0308]
--> <anon>:5:1
|>
5 |> impl<'a> Tr for S<'a> where Option<&'a str>: Tr, Option<&'static str>: Tr { }
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
note: expected type `Tr`
note: found type `Tr`
note: the lifetime 'a as defined on the impl at 5:0...
--> <anon>:5:1
|>
5 |> impl<'a> Tr for S<'a> where Option<&'a str>: Tr, Option<&'static str>: Tr { }
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...does not necessarily outlive the static lifetime
error: aborting due to previous error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment