Regression: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
When using enum_dispatch 0.3.3, rustc warns about methods with lifetime parameters, even though it didn't have a problem with enum_dispatch 0.3.2
use enum_dispatch::enum_dispatch;
#[enum_dispatch]
pub trait FooAPI
{
fn foo<'a>(&mut self) -> &'a u32 {
unimplemented!()
}
}
#[enum_dispatch(FooAPI)]
pub enum Foo
{
Something(Something),
}
pub struct Something(u32);
impl FooAPI for Something
{
}
Checking enum_dispatch v0.3.3 (/home/asomers/src/rust/enum_dispatch)
warning: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> examples/late_dispatch.rs:11:1
|
6 | fn foo<'a>(&mut self) -> &'a u32 {
| - the late bound lifetime parameter is introduced here
...
11 | #[enum_dispatch(FooAPI)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(late_bound_lifetime_arguments)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>
= note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 1 warning emitted
Finished dev [unoptimized + debuginfo] target(s) in 0.10s