2023-06-26 12:49:35 -05:00
|
|
|
//! Test that we don't follow through projections to find
|
|
|
|
//! opaque types.
|
2022-07-29 01:48:39 -05:00
|
|
|
|
|
|
|
#![feature(type_alias_impl_trait)]
|
2023-06-19 09:06:00 -05:00
|
|
|
#![allow(private_interfaces)]
|
2022-07-29 01:48:39 -05:00
|
|
|
|
|
|
|
pub type Successors<'a> = impl Iterator<Item = &'a ()>;
|
|
|
|
|
|
|
|
pub fn f<'a>() -> Successors<'a> {
|
|
|
|
None.into_iter()
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Tr {
|
|
|
|
type Item;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Tr for &'a () {
|
|
|
|
type Item = Successors<'a>;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn ohno<'a>() -> <&'a () as Tr>::Item {
|
|
|
|
None.into_iter()
|
2024-02-29 06:21:20 -06:00
|
|
|
//~^ ERROR mismatched types
|
2022-07-29 01:48:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|