Open
1 of 1 issue completedDescription
I tried this code:
#![feature(impl_trait_in_assoc_type)]
trait Callable {
type Out;
fn call() -> Self::Out;
}
impl<'a> Callable for () {
type Out = impl Sized;
fn call() -> Self::Out {}
}
I expected this to compile fine since it is accepted without TAIT.
Instead, code was rejected because lifetime 'a
is non-constraining.
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
--> src/main.rs:8:6
|
8 | impl<'a> Callable for () {
| ^^ unconstrained lifetime parameter
error[E0792]: expected generic lifetime parameter, found `'_`
--> src/main.rs:10:28
|
8 | impl<'a> Callable for () {
| -- this generic parameter must be used with a generic lifetime parameter
9 | type Out = impl Sized;
10 | fn call() -> Self::Out {}
| ^^
Sub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Can do after stabilization