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.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs
index 91c44362e..e0847dc75 100644
--- a/crates/hir_def/src/item_tree/tests.rs
+++ b/crates/hir_def/src/item_tree/tests.rs
@@ -288,3 +288,36 @@ struct S {
288 "#]], 288 "#]],
289 ) 289 )
290} 290}
291
292#[test]
293fn generics() {
294 check(
295 r#"
296struct S<'a, 'b: 'a, T: Copy + 'a + 'b, const K: u8 = 0> {}
297
298impl<'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 {}
300}
301
302enum Enum<'a, T, const U: u8> {}
303union Union<'a, T, const U: u8> {}
304 "#,
305 expect![[r#"
306 pub(self) struct S<'a, 'b, T, const K: u8> {
307 }
308
309 impl<'a, 'b, T, const K: u8> S<'a, 'b, T, K> {
310 // flags = 0x2
311 pub(self) fn f<G>(
312 _: impl Copy,
313 ) -> impl Copy;
314 }
315
316 pub(self) enum Enum<'a, T, const U: u8> {
317 }
318
319 pub(self) union Union<'a, T, const U: u8> {
320 }
321 "#]],
322 )
323}