rust/tests/ui/lint/issue-99387.rs
Oli Scherer 40d5609548 Make DefiningAnchor::Bind only store the opaque types that may be constrained, instead of the current infcx root item.
This makes `Bind` almost always be empty, so we can start forwarding it to queries, allowing us to remove `Bubble` entirely
2024-03-11 17:19:37 +00:00

27 lines
461 B
Rust

//! Test that we don't follow through projections to find
//! opaque types.
#![feature(type_alias_impl_trait)]
#![allow(private_interfaces)]
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()
//~^ ERROR mismatched types
}
fn main() {}