rust/tests/ui/traits/next-solver/assembly/runaway-impl-candidate-selection.rs
2024-02-16 20:02:50 +00:00

16 lines
464 B
Rust

//@ compile-flags: -Znext-solver
// In the new solver, we are trying to select `<?0 as Iterator>::Item: Debug`,
// which, naively can be unified with every impl of `Debug` if we're not careful.
// This test makes sure that we treat projections with inference var substs as
// placeholders during fast reject.
fn iter<T: Iterator>() -> <T as Iterator>::Item {
todo!()
}
fn main() {
println!("{:?}", iter::<_>());
//~^ ERROR type annotations needed
}