rust/tests/ui/traits/inductive-overflow/simultaneous.rs

21 lines
491 B
Rust
Raw Normal View History

2016-05-07 16:52:45 -05:00
// 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);
2016-07-28 11:49:31 -05:00
//~^ ERROR overflow evaluating the requirement `{integer}: Tweedle
2016-05-07 16:52:45 -05:00
}