Closed
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)