2022-04-12 14:02:57 +00:00
|
|
|
// Test that encountering closures during coherence does not cause issues.
|
2023-10-19 21:46:28 +00:00
|
|
|
#![feature(type_alias_impl_trait, coroutines)]
|
2023-01-17 09:39:35 +00:00
|
|
|
#![cfg_attr(specialized, feature(specialization))]
|
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
//@ revisions: stock specialized
|
|
|
|
//@ [specialized]check-pass
|
|
|
|
|
2023-10-19 16:06:43 +00:00
|
|
|
type OpaqueCoroutine = impl Sized;
|
|
|
|
fn defining_use() -> OpaqueCoroutine {
|
2024-04-11 13:15:34 +00:00
|
|
|
#[coroutine]
|
2022-04-12 14:02:57 +00:00
|
|
|
|| {
|
|
|
|
for i in 0..10 {
|
|
|
|
yield i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Wrapper<T>(T);
|
|
|
|
trait Trait {}
|
2023-10-19 16:06:43 +00:00
|
|
|
impl Trait for Wrapper<OpaqueCoroutine> {}
|
2022-04-12 14:02:57 +00:00
|
|
|
impl<T: Sync> Trait for Wrapper<T> {}
|
2023-10-19 16:06:43 +00:00
|
|
|
//[stock]~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper<OpaqueCoroutine>`
|
2022-04-12 14:02:57 +00:00
|
|
|
|
|
|
|
fn main() {}
|