File tree Expand file tree Collapse file tree 1 file changed +34
-2
lines changed Expand file tree Collapse file tree 1 file changed +34
-2
lines changed Original file line number Diff line number Diff line change 1
- #![ allow( non_snake_case) ]
2
-
3
1
#[ test]
4
2
fn dependent_where_clause ( ) {
5
3
crate :: assert_ok!(
@@ -126,3 +124,37 @@ fn const_param() {
126
124
expect_test:: expect![ "()" ]
127
125
)
128
126
}
127
+
128
+ #[ test]
129
+ #[ should_panic( expected = "wrong number of parameters" ) ]
130
+ fn type_with_wrong_number_of_parameters ( ) {
131
+ crate :: test_program_ok (
132
+ " [
133
+ crate foo {
134
+ trait Trait1 {}
135
+
136
+ struct S1 {}
137
+
138
+ struct S2<ty T> where S1<T> : Trait1 {
139
+ dummy: T,
140
+ }
141
+ }
142
+ ] " ,
143
+ )
144
+ . unwrap ( ) ;
145
+ }
146
+
147
+ #[ test]
148
+ #[ should_panic( expected = "no ADT named `Nonex`" ) ]
149
+ fn where_clause_with_nonexistent_type ( ) {
150
+ crate :: test_program_ok (
151
+ " [
152
+ crate foo {
153
+ trait Trait1 {}
154
+
155
+ struct S1 where Nonex: Trait1 {}
156
+ }
157
+ ] " ,
158
+ )
159
+ . unwrap ( ) ;
160
+ }
You can’t perform that action at this time.
0 commit comments