X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fui%2Ftraits%2Fnew-solver%2Fprovisional-result-done.rs;fp=tests%2Fui%2Ftraits%2Fnew-solver%2Fprovisional-result-done.rs;h=a3d97927bad2222037e19e1b5baa705e897a2278;hb=e7acd078f443156b95cee11759a735db1cfc796e;hp=0000000000000000000000000000000000000000;hpb=575d424c94e0d4feea8cf4fcf04d47b83f28eaef;p=rust.git diff --git a/tests/ui/traits/new-solver/provisional-result-done.rs b/tests/ui/traits/new-solver/provisional-result-done.rs new file mode 100644 index 00000000000..a3d97927bad --- /dev/null +++ b/tests/ui/traits/new-solver/provisional-result-done.rs @@ -0,0 +1,37 @@ +// known-bug: unknown +// compile-flags: -Ztrait-solver=next +// failure-status: 101 +// normalize-stderr-test "note: .*\n\n" -> "" +// normalize-stderr-test "thread 'rustc' panicked.*\n" -> "" +// rustc-env:RUST_BACKTRACE=0 + +// This tests checks that we update results in the provisional cache when +// we pop a goal from the stack. +#![feature(auto_traits)] +auto trait Coinductive {} +struct Foo(T); +struct Bar(T); + +impl Coinductive for Foo +where + Bar: Coinductive +{} + +impl Coinductive for Bar +where + Foo: Coinductive, + Bar: ConstrainInfer, +{} + +trait ConstrainInfer {} +impl ConstrainInfer for Bar {} +impl ConstrainInfer for Foo {} + +fn impls() -> T { todo!() } + +fn constrain(_: T) {} + +fn main() { + // This should constrain `_` to `u8`. + impls::>(); +}