summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/inductive-overflow/simultaneous.rs
blob: 40ac9214674e29d4edd10ece60733999c8b30e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Regression test for #33344, initial version. This example allowed
// arbitrary trait bounds to be synthesized.

trait Tweedledum: IntoIterator {}
trait Tweedledee: IntoIterator {}

impl<T: Tweedledum> Tweedledee for T {}
impl<T: Tweedledee> Tweedledum for T {}

trait Combo: IntoIterator {}
impl<T: Tweedledee + Tweedledum> Combo for T {}

fn is_ee<T: Combo>(t: T) {
    t.into_iter();
}

fn main() {
    is_ee(4);
    //~^ ERROR overflow evaluating the requirement `{integer}: Tweedle
}