-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
1 / 11 of 1 issue completedLabels
C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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 {}
| ^^
cramertj
Sub-issues
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Status
Can do after stabilization