]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-72839-error-overflow.rs
New upstream version 1.45.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-72839-error-overflow.rs
1 // Regression test for issue #72839
2 // Tests that we do not overflow during trait selection after
3 // a type error occurs
4 use std::ops::Rem;
5 trait Foo {}
6 struct MyStruct<T>(T);
7
8 impl<T, U> Rem<MyStruct<T>> for MyStruct<U> where MyStruct<U>: Rem<MyStruct<T>> {
9 type Output = u8;
10 fn rem(self, _: MyStruct<T>) -> Self::Output {
11 panic!()
12 }
13 }
14
15 fn main() {}
16
17 fn foo() {
18 if missing_var % 8 == 0 {} //~ ERROR cannot find
19 }