@@ -116,3 +116,42 @@ fn projection_equality() {
116
116
expect_test:: expect![ "{Constraints { env: Env { variables: [?ty_1], bias: Soundness, pending: [] }, known_true: true, substitution: {?ty_1 => u32} }, Constraints { env: Env { variables: [?ty_1], bias: Soundness, pending: [] }, known_true: true, substitution: {?ty_1 => <S as Trait1>::Type} }}" ] ,
117
117
) ;
118
118
}
119
+
120
+
121
+ const TEST_TY_IS_INT : & str = "[
122
+ crate test {
123
+ trait Id {
124
+ type This: [];
125
+ }
126
+
127
+ impl<ty T> Id for T {
128
+ type This = T;
129
+ }
130
+ }
131
+ ]" ;
132
+
133
+
134
+ #[ test]
135
+ fn test_ty_is_int ( ) {
136
+ test_where_clause (
137
+ TEST_TY_IS_INT ,
138
+ "{} => { <u16 as Id>::This = u16 }" ,
139
+ )
140
+ . assert_ok ( expect_test:: expect![ "{Constraints { env: Env { variables: [], bias: Soundness, pending: [] }, known_true: true, substitution: {} }}" ] ) ;
141
+
142
+
143
+ test_where_clause (
144
+ TEST_TY_IS_INT ,
145
+ "{} => { @is_int(<u16 as Id>::This) }" ,
146
+ )
147
+ . assert_err ( expect_test:: expect![ [ r#"
148
+ judgment `prove { goal: {@ is_int(<u16 as Id>::This)}, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [] }, decls: decls(222, [trait Id <ty> ], [impl <ty> Id(^ty0_0)], [], [alias <ty> <^ty0_0 as Id>::This = ^ty0_0], [], [], {Id}, {}) }` failed at the following rule(s):
149
+ failed at (src/file.rs:LL:CC) because
150
+ judgment `prove_wc_list { goal: {@ is_int(<u16 as Id>::This)}, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [] } }` failed at the following rule(s):
151
+ the rule "some" failed at step #0 (src/file.rs:LL:CC) because
152
+ judgment `prove_wc { goal: @ is_int(<u16 as Id>::This), assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [] } }` failed at the following rule(s):
153
+ the rule "ty is int" failed at step #0 (src/file.rs:LL:CC) because
154
+ judgment had no applicable rules: `is_int { goal: <u16 as Id>::This, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [] } }`"# ] ] ) ;
155
+
156
+ }
157
+
0 commit comments