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.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/crates/hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs
index b362add5c..57686dc6e 100644
--- a/crates/hir_def/src/item_tree/tests.rs
+++ b/crates/hir_def/src/item_tree/tests.rs
@@ -359,3 +359,41 @@ trait Tr<'a, T: 'a>: Super {}
359 "#]], 359 "#]],
360 ) 360 )
361} 361}
362
363#[test]
364fn inherit_visibility() {
365 check(
366 r#"
367pub(crate) enum En {
368 Var1(u8),
369 Var2 {
370 fld: u8,
371 },
372}
373
374pub(crate) trait Tr {
375 fn f();
376 fn method(&self) {}
377}
378 "#,
379 expect![[r#"
380 pub(crate) enum En {
381 Var1(
382 pub(crate) 0: u8,
383 ),
384 Var2 {
385 pub(crate) fld: u8,
386 },
387 }
388
389 pub(crate) trait Tr<Self> {
390 pub(crate) fn f() -> ();
391
392 // flags = 0x3
393 pub(crate) fn method(
394 _: &Self,
395 ) -> ();
396 }
397 "#]],
398 )
399}