rust/tests/ui/traits/new-solver/runaway-impl-candidate-selection.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
469 B
Rust
Raw Normal View History

// compile-flags: -Ztrait-solver=next
// 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
}