2023-06-26 17:49:35 +00:00
|
|
|
//! Test that we don't follow through projections to find
|
|
|
|
//! opaque types.
|
2022-07-29 06:48:39 +00:00
|
|
|
|
|
|
|
#![feature(type_alias_impl_trait)]
|
2023-06-19 14:06:00 +00:00
|
|
|
#![allow(private_interfaces)]
|
2022-07-29 06:48:39 +00: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 {
|
2023-06-26 17:49:35 +00:00
|
|
|
//~^ ERROR item constrains opaque type that is not in its signature
|
2022-07-29 06:48:39 +00:00
|
|
|
None.into_iter()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|