aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/item_tree/tests.rs')
-rw-r--r--crates/hir_def/src/item_tree/tests.rs53
1 files changed, 47 insertions, 6 deletions
diff --git a/crates/hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs
index e0847dc75..6407871b5 100644
--- a/crates/hir_def/src/item_tree/tests.rs
+++ b/crates/hir_def/src/item_tree/tests.rs
@@ -183,7 +183,11 @@ trait Tr: SuperTrait + 'lifetime {
183 _: (), 183 _: (),
184 ) -> (); 184 ) -> ();
185 185
186 pub(self) trait Tr: SuperTrait + 'lifetime { 186 pub(self) trait Tr<Self>: SuperTrait + 'lifetime
187 where
188 Self: SuperTrait,
189 Self: 'lifetime
190 {
187 pub(self) type Assoc: AssocBound = Default; 191 pub(self) type Assoc: AssocBound = Default;
188 192
189 // flags = 0x1 193 // flags = 0x1
@@ -207,6 +211,8 @@ mod inline {
207 211
208 fn fn_in_module() {} 212 fn fn_in_module() {}
209} 213}
214
215mod outline;
210 "#, 216 "#,
211 expect![[r##" 217 expect![[r##"
212 #[doc = " outer"] // AttrId { is_doc_comment: true, ast_index: 0 } 218 #[doc = " outer"] // AttrId { is_doc_comment: true, ast_index: 0 }
@@ -217,6 +223,8 @@ mod inline {
217 // flags = 0x2 223 // flags = 0x2
218 pub(self) fn fn_in_module() -> (); 224 pub(self) fn fn_in_module() -> ();
219 } 225 }
226
227 pub(self) mod outline;
220 "##]], 228 "##]],
221 ); 229 );
222} 230}
@@ -293,7 +301,11 @@ struct S {
293fn generics() { 301fn generics() {
294 check( 302 check(
295 r#" 303 r#"
296struct S<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> {} 304struct S<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> {
305 field: &'a &'b T,
306}
307
308struct Tuple<T: Copy>(T);
297 309
298impl<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> S<'a, 'b, T, K> { 310impl<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> S<'a, 'b, T, K> {
299 fn f<G: 'a>(arg: impl Copy) -> impl Copy {} 311 fn f<G: 'a>(arg: impl Copy) -> impl Copy {}
@@ -301,16 +313,38 @@ impl<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> S<'a, 'b, T, K> {
301 313
302enum Enum<'a, T, const U: u8> {} 314enum Enum<'a, T, const U: u8> {}
303union Union<'a, T, const U: u8> {} 315union Union<'a, T, const U: u8> {}
316
317trait Tr<'a, T: 'a>: Super {}
304 "#, 318 "#,
305 expect![[r#" 319 expect![[r#"
306 pub(self) struct S<'a, 'b, T, const K: u8> { 320 pub(self) struct S<'a, 'b, T, const K: u8>
321 where
322 T: Copy,
323 T: 'a,
324 T: 'b
325 {
326 pub(self) field: &'a &'b T,
307 } 327 }
308 328
309 impl<'a, 'b, T, const K: u8> S<'a, 'b, T, K> { 329 pub(self) struct Tuple<T>(
330 pub(self) 0: T,
331 )
332 where
333 T: Copy;
334
335 impl<'a, 'b, T, const K: u8> S<'a, 'b, T, K>
336 where
337 T: Copy,
338 T: 'a,
339 T: 'b
340 {
310 // flags = 0x2 341 // flags = 0x2
311 pub(self) fn f<G>( 342 pub(self) fn f<G, _anon_1>(
312 _: impl Copy, 343 _: impl Copy,
313 ) -> impl Copy; 344 ) -> impl Copy
345 where
346 G: 'a,
347 _anon_1: Copy;
314 } 348 }
315 349
316 pub(self) enum Enum<'a, T, const U: u8> { 350 pub(self) enum Enum<'a, T, const U: u8> {
@@ -318,6 +352,13 @@ union Union<'a, T, const U: u8> {}
318 352
319 pub(self) union Union<'a, T, const U: u8> { 353 pub(self) union Union<'a, T, const U: u8> {
320 } 354 }
355
356 pub(self) trait Tr<'a, Self, T>: Super
357 where
358 Self: Super,
359 T: 'a
360 {
361 }
321 "#]], 362 "#]],
322 ) 363 )
323} 364}