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