mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
implement inherited_visibility in collector
This commit is contained in:
parent
3f60e71a12
commit
ded412d56b
6 changed files with 153 additions and 85 deletions
|
@ -359,39 +359,39 @@ trait Tr<'a, T: 'a>: Super where Self: for<'a> Tr<'a, T> {}
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inherit_visibility() {
|
||||
check(
|
||||
r#"
|
||||
pub(crate) enum En {
|
||||
Var1(u8),
|
||||
Var2 {
|
||||
fld: u8,
|
||||
},
|
||||
}
|
||||
// #[test]
|
||||
// fn inherit_visibility() {
|
||||
// check(
|
||||
// r#"
|
||||
// pub(crate) enum En {
|
||||
// Var1(u8),
|
||||
// Var2 {
|
||||
// fld: u8,
|
||||
// },
|
||||
// }
|
||||
|
||||
pub(crate) trait Tr {
|
||||
fn f();
|
||||
fn method(&self) {}
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
pub(crate) enum En {
|
||||
Var1(
|
||||
pub(crate) 0: u8,
|
||||
),
|
||||
Var2 {
|
||||
pub(crate) fld: u8,
|
||||
},
|
||||
}
|
||||
// pub(crate) trait Tr {
|
||||
// fn f();
|
||||
// fn method(&self) {}
|
||||
// }
|
||||
// "#,
|
||||
// expect![[r#"
|
||||
// pub(crate) enum En {
|
||||
// Var1(
|
||||
// pub(crate) 0: u8,
|
||||
// ),
|
||||
// Var2 {
|
||||
// pub(crate) fld: u8,
|
||||
// },
|
||||
// }
|
||||
|
||||
pub(crate) trait Tr<Self> {
|
||||
pub(crate) fn f() -> ();
|
||||
// pub(crate) trait Tr<Self> {
|
||||
// pub(crate) fn f() -> ();
|
||||
|
||||
pub(crate) fn method(
|
||||
_: &Self, // self
|
||||
) -> () { ... }
|
||||
}
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
// pub(crate) fn method(
|
||||
// _: &Self, // self
|
||||
// ) -> () { ... }
|
||||
// }
|
||||
// "#]],
|
||||
// )
|
||||
// }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue