File tree 2 files changed +43
-0
lines changed
tests/ui/traits/new-solver
2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
1
+ error: the compiler unexpectedly panicked. this is a bug.
2
+
3
+ query stack during panic:
4
+ #0 [check_well_formed] checking that `<impl at $DIR/provisional-result-done.rs:20:1: 20:31>` is well-formed
5
+ #1 [check_mod_type_wf] checking that types are well-formed in top-level module
6
+ end of query stack
You can’t perform that action at this time.
0 commit comments