-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
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-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
I tried this code:
#![feature(type_alias_impl_trait)]
struct Foo;
impl Trait for Foo {}
pub trait Trait {}
pub type TAIT<T> = impl Trait;
async fn foo<T>() -> TAIT<T> {
Foo
}
It failed with a confusing error message. (error: concrete type differs from previous defining opaque type use, at the same location)
error: concrete type differs from previous defining opaque type use
--> src/main.rs:11:5
|
11 | Foo
| ^^^ expected `TAIT<T>`, got `Foo`
|
note: previous use here
--> src/main.rs:10:30
|
10 | async fn foo<T>() -> TAIT<T> {
| ______________________________^
11 | | Foo
12 | | }
| |_^
I'm trying to minimize #114727, and found the problem.
nightly-2023-06-17
compiles, but nightly-2023-06-18
fails. Although not 100% sure, I think it's caused by the same problem as #114727 (regression caused by #108860)
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-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.