File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,61 @@ fn missing_dependent_where_clause() {
68
68
expression evaluated to an empty collection: `decls.trait_invariants()`"# ] ]
69
69
)
70
70
}
71
+
72
+ #[ test]
73
+ fn lifetime_param ( ) {
74
+ crate :: assert_ok!(
75
+ //@check-pass
76
+ [
77
+ crate foo {
78
+ trait Trait1 <lt a> { }
79
+
80
+ struct S1 { }
81
+
82
+ struct S2 <lt a> where S1 : Trait1 <a> { }
83
+ }
84
+ ]
85
+
86
+ expect_test:: expect![ "()" ]
87
+ )
88
+ }
89
+
90
+ #[ test]
91
+ fn static_lifetime_param ( ) {
92
+ crate :: assert_ok!(
93
+ //@check-pass
94
+ [
95
+ crate foo {
96
+ trait Trait1 <lt a> { }
97
+
98
+ struct S1 { }
99
+
100
+ impl Trait1 <static > for S1 { }
101
+
102
+ struct S2 where S1 : Trait1 <static > { }
103
+ }
104
+ ]
105
+
106
+ expect_test:: expect![ "()" ]
107
+ )
108
+ }
109
+
110
+ #[ test]
111
+ fn const_param ( ) {
112
+ crate :: assert_ok!(
113
+ //@check-pass
114
+ [
115
+ crate foo {
116
+ trait Trait1 <const C > where type_of_const C is u32 { }
117
+
118
+ struct S1 { }
119
+
120
+ impl Trait1 <const 3_u32 > for S1 { }
121
+
122
+ struct S2 where S1 : Trait1 <const 3_u32 > { }
123
+ }
124
+ ]
125
+
126
+ expect_test:: expect![ "()" ]
127
+ )
128
+ }
You can’t perform that action at this time.
0 commit comments