]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/new-solver/provisional-result-done.rs
add (currently ICEing) test
[rust.git] / tests / ui / traits / new-solver / provisional-result-done.rs
1 // known-bug: unknown
2 // compile-flags: -Ztrait-solver=next
3 // failure-status: 101
4 // normalize-stderr-test "note: .*\n\n" -> ""
5 // normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
6 // rustc-env:RUST_BACKTRACE=0
7
8 // This tests checks that we update results in the provisional cache when
9 // we pop a goal from the stack.
10 #![feature(auto_traits)]
11 auto trait Coinductive {}
12 struct Foo<T>(T);
13 struct Bar<T>(T);
14
15 impl<T> Coinductive for Foo<T>
16 where
17     Bar<T>: Coinductive
18 {}
19
20 impl<T> Coinductive for Bar<T>
21 where
22     Foo<T>: Coinductive,
23     Bar<T>: ConstrainInfer,
24 {}
25
26 trait ConstrainInfer {}
27 impl ConstrainInfer for Bar<u8> {}
28 impl ConstrainInfer for Foo<u16> {}
29
30 fn impls<T: Coinductive>() -> T { todo!() }
31
32 fn constrain<T: ConstrainInfer>(_: T) {}
33
34 fn main() {
35     // This should constrain `_` to `u8`.
36     impls::<Foo<_>>();
37 }