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